Skip to content

Commit cc2dc68

Browse files
authored
Merge pull request #452 from digital-preservation/id-447-create-deliverable-package-including-jre
Id 447 create deliverable package including jre
2 parents 87d39f6 + 4673181 commit cc2dc68

File tree

16 files changed

+640
-74
lines changed

16 files changed

+640
-74
lines changed

csv-validator-cmd/pom.xml

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -74,49 +74,27 @@
7474
</includes>
7575
</configuration>
7676
</plugin>
77-
<plugin>
78-
<groupId>org.codehaus.mojo</groupId>
79-
<artifactId>appassembler-maven-plugin</artifactId>
80-
<executions>
81-
<execution>
82-
<phase>package</phase>
83-
<goals>
84-
<goal>assemble</goal>
85-
</goals>
86-
</execution>
87-
</executions>
88-
<configuration>
89-
<includeConfigurationDirectoryInClasspath>false</includeConfigurationDirectoryInClasspath>
90-
<repositoryLayout>flat</repositoryLayout>
91-
<repositoryName>lib</repositoryName>
92-
<programs>
93-
<program>
94-
<id>validate</id>
95-
<mainClass>uk.gov.nationalarchives.csv.validator.cmd.CsvValidatorCmdApp</mainClass>
96-
</program>
97-
</programs>
98-
</configuration>
99-
</plugin>
10077
<plugin>
10178
<groupId>org.apache.maven.plugins</groupId>
102-
<artifactId>maven-assembly-plugin</artifactId>
103-
<executions>
104-
<execution>
105-
<phase>package</phase>
106-
<goals>
107-
<goal>single</goal>
108-
</goals>
109-
</execution>
110-
</executions>
79+
<artifactId>maven-jar-plugin</artifactId>
11180
<configuration>
112-
<descriptors>
113-
<descriptor>src/main/assembly/appassembler-output.xml</descriptor>
114-
</descriptors>
81+
<archive>
82+
<manifest>
83+
<addClasspath>true</addClasspath>
84+
<classpathPrefix>lib/</classpathPrefix>
85+
<mainClass>uk.gov.nationalarchives.csv.validator.cmd.CsvValidatorCmdApp</mainClass>
86+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
87+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
88+
</manifest>
89+
<manifestEntries>
90+
<Description>${project.description}</Description>
91+
<Implementation-URL>${project.url}</Implementation-URL>
92+
</manifestEntries>
93+
</archive>
11594
</configuration>
11695
</plugin>
11796
</plugins>
11897
</build>
119-
12098
<dependencies>
12199
<dependency>
122100
<groupId>org.scala-lang</groupId>
@@ -227,5 +205,4 @@
227205
</build>
228206
</profile>
229207
</profiles>
230-
231208
</project>

csv-validator-core/nohup.out

Whitespace-only changes.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
CSV Validator Application
2+
=========================
3+
4+
This module assembles the csv-validator deliverable in a zip format.
5+
6+
---
7+
### Structure of the generated ZIP file
8+
The zip, which includes bundled JRE, has following structure.
9+
10+
```
11+
csv-validator-application-<version_number>
12+
|
13+
+--- csv-validator-gui.bat
14+
|
15+
+--- csv-validator-cmd.bat
16+
|
17+
+--- csv-validator-cmd-<Version Number>.jar
18+
|
19+
+--- csv-validator-ui-<Version Number>.jar
20+
|
21+
+--- LICENSE
22+
|
23+
+-- [lib]
24+
| |
25+
| +--- <various application jars and dependencies>
26+
|
27+
+-- [jre]
28+
|
29+
+--- <bundled jre>
30+
31+
```
32+
33+
The zip file without JRE has a similar structure as above, except the `[JRE]` folder and the scripts are made as
34+
shell scripts rather than Windows batch files
35+
36+
```
37+
csv-validator-application-<version_number>
38+
|
39+
+--- csv-validator-gui
40+
|
41+
+--- csv-validator-cmd
42+
|
43+
+--- csv-validator-cmd-<Version Number>.jar
44+
|
45+
+--- csv-validator-ui-<Version Number>.jar
46+
|
47+
+--- LICENSE
48+
|
49+
+-- [lib]
50+
|
51+
+--- <various application jars and dependencies>
52+
53+
```
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!--
2+
3+
Copyright (c) 2013, The National Archives <[email protected]>
4+
https://www.nationalarchives.gov.uk
5+
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
10+
-->
11+
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
12+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
14+
<id>bin-win32-with-jre</id>
15+
<formats>
16+
<format>zip</format>
17+
</formats>
18+
<includeBaseDirectory>false</includeBaseDirectory>
19+
<dependencySets>
20+
<dependencySet>
21+
<unpack>false</unpack>
22+
<scope>runtime</scope>
23+
<outputDirectory>lib</outputDirectory>
24+
<excludes>
25+
<exclude>uk.gov.nationalarchives:csv-validator-cmd</exclude>
26+
<exclude>uk.gov.nationalarchives:csv-validator-core</exclude>
27+
<exclude>uk.gov.nationalarchives:csv-validator-ui</exclude>
28+
</excludes>
29+
<fileMode>644</fileMode>
30+
</dependencySet>
31+
<dependencySet>
32+
<unpack>false</unpack>
33+
<scope>runtime</scope>
34+
<outputDirectory>lib</outputDirectory>
35+
<includes>
36+
<include>uk.gov.nationalarchives:csv-validator-cmd</include>
37+
<include>uk.gov.nationalarchives:csv-validator-core</include>
38+
</includes>
39+
<fileMode>644</fileMode>
40+
</dependencySet>
41+
<dependencySet>
42+
<unpack>false</unpack>
43+
<scope>runtime</scope>
44+
<outputDirectory></outputDirectory>
45+
<includes>
46+
<include>uk.gov.nationalarchives:csv-validator-cmd</include>
47+
<include>uk.gov.nationalarchives:csv-validator-ui</include>
48+
</includes>
49+
<fileMode>644</fileMode>
50+
</dependencySet>
51+
</dependencySets>
52+
53+
<fileSets>
54+
<fileSet>
55+
<directory>${project.build.outputDirectory}</directory>
56+
</fileSet>
57+
<fileSet>
58+
<directory>bin</directory>
59+
<outputDirectory>/</outputDirectory>
60+
<excludes>
61+
<exclude>csv-validator-gui</exclude>
62+
<exclude>csv-validator-cmd</exclude>
63+
</excludes>
64+
<fileMode>644</fileMode>
65+
</fileSet>
66+
<fileSet>
67+
<directory>target/jre-windows</directory>
68+
<outputDirectory>jre</outputDirectory>
69+
</fileSet>
70+
</fileSets>
71+
72+
<files>
73+
<file>
74+
<source>bin/csv-validator-gui.bat</source>
75+
<outputDirectory>/</outputDirectory>
76+
<filtered>true</filtered>
77+
<fileMode>644</fileMode>
78+
</file>
79+
<file>
80+
<source>bin/csv-validator-cmd.bat</source>
81+
<outputDirectory>/</outputDirectory>
82+
<filtered>true</filtered>
83+
<fileMode>755</fileMode>
84+
</file>
85+
<file>
86+
<source>bin/running-csv-validator.txt</source>
87+
<outputDirectory>/</outputDirectory>
88+
<filtered>true</filtered>
89+
<fileMode>644</fileMode>
90+
</file>
91+
<file>
92+
<source>../LICENSE</source>
93+
<outputDirectory>/</outputDirectory>
94+
<filtered>true</filtered>
95+
<fileMode>644</fileMode>
96+
</file>
97+
</files>
98+
99+
</assembly>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!--
2+
3+
Copyright (c) 2013, The National Archives <[email protected]>
4+
https://www.nationalarchives.gov.uk
5+
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
10+
-->
11+
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
12+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
14+
<id>bin</id>
15+
<formats>
16+
<format>zip</format>
17+
</formats>
18+
<includeBaseDirectory>false</includeBaseDirectory>
19+
<dependencySets>
20+
<dependencySet>
21+
<unpack>false</unpack>
22+
<scope>runtime</scope>
23+
<outputDirectory>lib</outputDirectory>
24+
<excludes>
25+
<exclude>uk.gov.nationalarchives:csv-validator-cmd</exclude>
26+
<exclude>uk.gov.nationalarchives:csv-validator-core</exclude>
27+
<exclude>uk.gov.nationalarchives:csv-validator-ui</exclude>
28+
</excludes>
29+
<fileMode>644</fileMode>
30+
</dependencySet>
31+
<dependencySet>
32+
<unpack>false</unpack>
33+
<scope>runtime</scope>
34+
<outputDirectory>lib</outputDirectory>
35+
<includes>
36+
<include>uk.gov.nationalarchives:csv-validator-cmd</include>
37+
<include>uk.gov.nationalarchives:csv-validator-core</include>
38+
</includes>
39+
<fileMode>644</fileMode>
40+
</dependencySet>
41+
<dependencySet>
42+
<unpack>false</unpack>
43+
<scope>runtime</scope>
44+
<outputDirectory></outputDirectory>
45+
<includes>
46+
<include>uk.gov.nationalarchives:csv-validator-cmd</include>
47+
<include>uk.gov.nationalarchives:csv-validator-ui</include>
48+
</includes>
49+
<fileMode>644</fileMode>
50+
</dependencySet>
51+
</dependencySets>
52+
53+
<fileSets>
54+
<fileSet>
55+
<directory>${project.build.outputDirectory}</directory>
56+
</fileSet>
57+
</fileSets>
58+
59+
<files>
60+
<file>
61+
<source>bin/csv-validator-gui.bat</source>
62+
<outputDirectory>/</outputDirectory>
63+
<filtered>true</filtered>
64+
<fileMode>755</fileMode>
65+
</file>
66+
<file>
67+
<source>bin/csv-validator-cmd.bat</source>
68+
<outputDirectory>/</outputDirectory>
69+
<filtered>true</filtered>
70+
<fileMode>755</fileMode>
71+
</file>
72+
<file>
73+
<source>bin/csv-validator-gui</source>
74+
<outputDirectory>/</outputDirectory>
75+
<filtered>true</filtered>
76+
<fileMode>755</fileMode>
77+
</file>
78+
<file>
79+
<source>bin/csv-validator-cmd</source>
80+
<outputDirectory>/</outputDirectory>
81+
<filtered>true</filtered>
82+
<fileMode>755</fileMode>
83+
</file>
84+
<file>
85+
<source>bin/running-csv-validator.txt</source>
86+
<outputDirectory>/</outputDirectory>
87+
<filtered>true</filtered>
88+
<fileMode>644</fileMode>
89+
</file> <file>
90+
<source>../LICENSE</source>
91+
<outputDirectory>/</outputDirectory>
92+
<filtered>true</filtered>
93+
<fileMode>644</fileMode>
94+
</file>
95+
</files>
96+
</assembly>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2013, The National Archives <[email protected]>
4+
# https://www.nationalarchives.gov.uk
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
#
10+
11+
# Location of this script at runtime
12+
SCRIPT=$0
13+
14+
# Resolve absolute and relative symlinks
15+
while [ -h "$SCRIPT" ]; do
16+
LS=$( ls -ld "$SCRIPT" )
17+
LINK=$( expr "$LS" : '.*-> \(.*\)$' )
18+
if expr "$LINK" : '/.*' > /dev/null; then
19+
SCRIPT="$LINK"
20+
else
21+
SCRIPT="$( dirname "$SCRIPT" )/$LINK"
22+
fi
23+
done
24+
25+
# Store absolute location
26+
CWD=$( pwd )
27+
APP_HOME="$( cd "$(dirname "$SCRIPT" )" && pwd )"
28+
cd "$CWD"
29+
30+
# Max memory to use for the JVM. Uncomment the following line and set the desired value for max memory. Alternatively,
31+
# you can set the max memory in terminal before launching the script by setting the environment variable for that shell
32+
# e.g. to set it to 1024m, use `export csvValidatorMemory=1024`
33+
# csvValidatorMemory=1024
34+
35+
# Create param for runtime options.
36+
RUNTIME_OPTIONS="-Xmx1024m"
37+
38+
if [ -n "$csvValidatorMemory" ]
39+
then
40+
RUNTIME_OPTIONS="-Xmx"$csvValidatorMemory"m"
41+
fi
42+
43+
# Detect if we are running on a Mac:
44+
OS=$( uname )
45+
if [ "Darwin" = "$OS" ]; then
46+
RUNTIME_OPTIONS=$RUNTIME_OPTIONS" -Xdock:name=CSV-Validator"
47+
RUNTIME_OPTIONS=$RUNTIME_OPTIONS" -Dcom.apple.mrj.application.growbox.intrudes=false"
48+
RUNTIME_OPTIONS=$RUNTIME_OPTIONS" -Dcom.apple.mrj.application.live-resize=true"
49+
fi
50+
51+
# Launch the CLI application
52+
java $RUNTIME_OPTIONS -jar "$APP_HOME/csv-validator-cmd-${project.version}.jar" "$@"

0 commit comments

Comments
 (0)