diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2013-01-28 13:57:03 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2013-01-28 13:57:03 +0000 |
commit | 5c5010f818b32b43f2c0c799ef062ef12bff66ca (patch) | |
tree | 298ff1a94f0740e446b2b1f3df1b1c5b562f4fa0 | |
parent | f9850d02d8559b7e7f3555d0e2c7cfe746257958 (diff) | |
download | pdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.tar.gz pdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.tar.bz2 pdf-as-3-5c5010f818b32b43f2c0c799ef062ef12bff66ca.zip |
Maven build scripts enhanced.
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/pdf-as/trunk@928 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
-rw-r--r-- | pdf-as-cli/src/main/assembly/cli.xml | 10 | ||||
-rw-r--r-- | pdf-as-cli/src/main/resources/pdf-as.bat | 4 | ||||
-rw-r--r-- | pdf-as-cli/src/main/resources/pdf-as.sh | 4 | ||||
-rw-r--r-- | pdf-as-lib/pom.xml | 32 | ||||
-rw-r--r-- | pdf-as-lib/src/main/assembly/lib.xml | 97 | ||||
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java | 51 | ||||
-rw-r--r-- | pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java | 7 | ||||
-rw-r--r-- | pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java | 5 | ||||
-rw-r--r-- | pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java | 5 | ||||
-rw-r--r-- | pdf-as-lib/src/test/java/at/gv/egiz/pdfas/algorithmSuite/AlgorithmSuiteTest.java | 27 | ||||
-rw-r--r-- | pdf-as-release/src/main/assembly/release.xml | 14 | ||||
-rw-r--r-- | pdf-as-web/pom.xml | 7 | ||||
-rw-r--r-- | pom.xml | 2 |
13 files changed, 163 insertions, 102 deletions
diff --git a/pdf-as-cli/src/main/assembly/cli.xml b/pdf-as-cli/src/main/assembly/cli.xml index 31abd3d..c4f7189 100644 --- a/pdf-as-cli/src/main/assembly/cli.xml +++ b/pdf-as-cli/src/main/assembly/cli.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?>
<!-- http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html -->
<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>cli</id>
@@ -23,9 +23,8 @@ <include>at.gv.egiz:pdf-as-lib:jar</include>
</includes>
<binaries>
- <outputDirectory/>
<unpack>false</unpack>
- <outputFileNameMapping>${module.build.finalName}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>pdf-as-lib-${project.version}.jar</outputFileNameMapping>
</binaries>
</moduleSet>
@@ -38,6 +37,7 @@ <unpack>false</unpack>
<scope>runtime</scope>
<outputDirectory>lib</outputDirectory>
+ <useProjectArtifact>false</useProjectArtifact>
<excludes>
<exclude>at.gv.egiz:pdf-as-lib:jar</exclude>
</excludes>
@@ -69,7 +69,7 @@ </includes>
</fileSet>
- <!-- Add exampled. -->
+ <!-- Add examples. -->
<fileSet>
<directory>../dok/Anwendungsbeschreibung/Platzhalter-Beispiele</directory>
<outputDirectory>doc/Platzhalter-Beispiele</outputDirectory>
diff --git a/pdf-as-cli/src/main/resources/pdf-as.bat b/pdf-as-cli/src/main/resources/pdf-as.bat index 0cadb9a..5629c7c 100644 --- a/pdf-as-cli/src/main/resources/pdf-as.bat +++ b/pdf-as-cli/src/main/resources/pdf-as.bat @@ -2,7 +2,7 @@ rem Deploys embedded default configuration to USER_HOME/PDF-AS.
rem Note: Configuration is not deployed if it already exists.
-java -jar ${project.build.finalName}.jar -ddc
+java -jar pdf-as-lib-${project.version}.jar -ddc
rem Start commandline
-java -Xms128m -Xmx786m -XX:MaxPermSize=256m -jar ${project.build.finalName}.jar %*
+java -Xms128m -Xmx786m -XX:MaxPermSize=256m -jar pdf-as-lib-${project.version}.jar %*
diff --git a/pdf-as-cli/src/main/resources/pdf-as.sh b/pdf-as-cli/src/main/resources/pdf-as.sh index f47bc5f..3bd7742 100644 --- a/pdf-as-cli/src/main/resources/pdf-as.sh +++ b/pdf-as-cli/src/main/resources/pdf-as.sh @@ -2,7 +2,7 @@ # Deploys embedded default configuration to USER_HOME/PDF-AS. # Note: Configuration is not deployed if it already exists. -java -jar ${project.build.finalName}.jar -ddc +java -jar pdf-as-lib-${project.version}.jar -ddc # Start commandline -java -Xms128m -Xmx786m -XX:MaxPermSize=256m -jar ${project.build.finalName}.jar $@ +java -Xms128m -Xmx786m -XX:MaxPermSize=256m -jar pdf-as-lib-${project.version}.jar $@ diff --git a/pdf-as-lib/pom.xml b/pdf-as-lib/pom.xml index 01b2279..93e585b 100644 --- a/pdf-as-lib/pom.xml +++ b/pdf-as-lib/pom.xml @@ -19,21 +19,9 @@ <build>
- <finalName>pdf-as-${project.version}</finalName>
-
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>at/gv/egiz/pdfas/test/*/</exclude>
- <exclude>demo/*/</exclude>
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
@@ -53,6 +41,26 @@ </configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/lib.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
diff --git a/pdf-as-lib/src/main/assembly/lib.xml b/pdf-as-lib/src/main/assembly/lib.xml new file mode 100644 index 0000000..f9efd00 --- /dev/null +++ b/pdf-as-lib/src/main/assembly/lib.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!-- http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+ <id>lib</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <baseDirectory>pdf-as-lib</baseDirectory>
+ <includeBaseDirectory>true</includeBaseDirectory>
+
+ <moduleSets>
+
+ <!-- Add pdf-as library. -->
+ <moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>at.gv.egiz:pdf-as-lib:jar</include>
+ </includes>
+ <binaries>
+ <unpack>false</unpack>
+ <outputFileNameMapping>pdf-as-lib-${project.version}.jar</outputFileNameMapping>
+ </binaries>
+ </moduleSet>
+
+ </moduleSets>
+
+ <dependencySets>
+
+ <!-- Add project dependencies. -->
+ <dependencySet>
+ <unpack>false</unpack>
+ <scope>runtime</scope>
+ <outputDirectory>lib</outputDirectory>
+ <useProjectArtifact>false</useProjectArtifact>
+ <excludes>
+ <exclude>at.gv.egiz:pdf-as-lib:jar</exclude>
+ </excludes>
+ </dependencySet>
+
+ </dependencySets>
+
+ <files>
+ <!-- Add default configuration. -->
+ <file>
+ <source>src/main/resources/DefaultConfiguration.zip</source>
+ <destName>configuration.zip</destName>
+ </file>
+ </files>
+
+ <fileSets>
+
+ <!-- Add user manual. -->
+ <fileSet>
+ <directory>../dok/Anwendungsbeschreibung</directory>
+ <outputDirectory>doc</outputDirectory>
+ <includes>
+ <include>PDF-AS-${project.version}-Anwendungsbeschreibung.pdf</include>
+ <!-- Fallback, if latest version not yet available. -->
+ <include>PDF-AS-3.2-Anwendungsbeschreibung.pdf</include>
+ </includes>
+ </fileSet>
+
+ <!-- Add examples. -->
+ <fileSet>
+ <directory>../dok/Anwendungsbeschreibung/Platzhalter-Beispiele</directory>
+ <outputDirectory>doc/Platzhalter-Beispiele</outputDirectory>
+ <includes>
+ <include>*.jpg</include>
+ </includes>
+ </fileSet>
+
+ <!-- Add configuration documentation. -->
+ <fileSet>
+ <directory>../dok/Konfiguration</directory>
+ <outputDirectory>doc</outputDirectory>
+ <includes>
+ <include>*.pdf</include>
+ </includes>
+ </fileSet>
+
+ <!-- Add specification. -->
+ <fileSet>
+ <directory>../dok/Spezifikation/Spezifikation-Layout-Amtssignatur-las-v1.4.0</directory>
+ <outputDirectory>doc</outputDirectory>
+ <includes>
+ <include>Spezifikation-Layout-Amtssignatur-las-v1.4.0.pdf</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java deleted file mode 100644 index d804b64..0000000 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/test/JarExtractTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.test;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.utils.ConfigUtils;
-
-public final class JarExtractTest {
-
- private JarExtractTest() {
- }
-
- public static void main(String[] args) {
- try {
-
- String sysProp = System.getProperty(Constants.CONFIG_DIR_SYSTEM_PROPERTY);
- System.out.println("System property \"" + Constants.CONFIG_DIR_SYSTEM_PROPERTY + "\" = " + (sysProp != null ? ("\"" + sysProp + "\"") : null));
-
- String deployedTo = ConfigUtils.deployDefaultConfiguration();
- if (deployedTo != null) {
- System.out.println("Configuration successfully deployed to \"" + deployedTo + "\".");
- } else {
- System.out.println("Configuration was NOT deployed. Maybe a configuration already exists.");
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java b/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java index 06e454e..04d6402 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureCreationDemo.java @@ -61,6 +61,11 @@ public class SignatureCreationDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File unsignedFile = new File(args[0]);
File signedFile = new File(args[0] + "_signed.pdf");
@@ -79,7 +84,7 @@ public class SignatureCreationDemo { SignParameters signParameters = new SignParameters();
signParameters.setDocument(dataSource);
signParameters.setOutput(dataSink);
- signParameters.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOA); // Constants.SIGNATURE_DEVICE_BKU
+ signParameters.setSignatureDevice(Constants.SIGNATURE_DEVICE_BKU); // Constants.SIGNATURE_DEVICE_BKU
signParameters.setSignaturePositioning(new SignaturePositioning("x:100;y:200;w:500;p:1;f:80"));
signParameters.setCheckForPlaceholder(true);
// standard signature
diff --git a/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java b/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java index a065854..5816946 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureCreationWithDynamicProfilesDemo.java @@ -63,6 +63,11 @@ public class SignatureCreationWithDynamicProfilesDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File unsignedFile = new File(args[0]);
File signedFile = new File(args[0] + "_signed.pdf");
diff --git a/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java b/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java index 878ff08..0ba95ff 100644 --- a/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java +++ b/pdf-as-lib/src/main/java/demo/SignatureVerificationDemo.java @@ -69,6 +69,11 @@ public class SignatureVerificationDemo { }
File configdir = new File("./work");
+ // look for work folder in current directory
+ if (!configdir.exists()) {
+ // otherwise look in parent directory
+ configdir = new File("../work");
+ }
File signedFile = new File(args[0]);
AnalyzeResult analyzeResult = null;
diff --git a/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/algorithmSuite/AlgorithmSuiteTest.java b/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/algorithmSuite/AlgorithmSuiteTest.java index 8e66874..e8f8c55 100644 --- a/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/algorithmSuite/AlgorithmSuiteTest.java +++ b/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/algorithmSuite/AlgorithmSuiteTest.java @@ -25,13 +25,12 @@ package at.gv.egiz.pdfas.algorithmSuite; import junit.framework.TestCase;
-
-
public class AlgorithmSuiteTest extends TestCase {
-
+
public void testAlgorithmMapper() throws Exception {
assertEquals("dsa-sha1", AlgorithmMapper.getAbbreviation("http://www.w3.org/2000/09/xmldsig#dsa-sha1"));
- assertEquals("ecdsa-sha512", AlgorithmMapper.getAbbreviation("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"));
+ assertEquals("ecdsa-sha512",
+ AlgorithmMapper.getAbbreviation("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"));
assertEquals("sha256", AlgorithmMapper.getAbbreviation("http://www.w3.org/2001/04/xmlenc#sha256"));
assertEquals("http://www.w3.org/2001/04/xmldsig-more#md5", AlgorithmMapper.getUri("md5"));
@@ -44,7 +43,6 @@ public class AlgorithmSuiteTest extends TestCase { } catch (Exception e) {
// expected
}
-
}
public void testAlgObject() {
@@ -62,13 +60,13 @@ public class AlgorithmSuiteTest extends TestCase { assertEquals("ripemd160", as.getCertDigestMethod());
assertEquals("ripemd160", as.getDataDigestMethod());
assertEquals("ripemd160", as.getPropertiesDigestMethod());
-
- as = new AlgorithmSuiteObject("ecdsa-sha1:ripemd160@207c44ff", false);
- assertTrue(as.isSpecified());
- assertEquals("ecdsa-sha1", as.getSignatureMethod());
- assertEquals("ripemd160", as.getCertDigestMethod());
- assertEquals("ripemd160", as.getDataDigestMethod());
- assertEquals("ripemd160", as.getPropertiesDigestMethod());
+
+ as = new AlgorithmSuiteObject("ecdsa-sha1:ripemd160@207c44ff", false);
+ assertTrue(as.isSpecified());
+ assertEquals("ecdsa-sha1", as.getSignatureMethod());
+ assertEquals("ripemd160", as.getCertDigestMethod());
+ assertEquals("ripemd160", as.getDataDigestMethod());
+ assertEquals("ripemd160", as.getPropertiesDigestMethod());
as = new AlgorithmSuiteObject("etsi-bka-1.0@1254754266-364221555@10884-28158-0-19188-22825");
assertFalse(as.isSpecified());
@@ -80,11 +78,6 @@ public class AlgorithmSuiteTest extends TestCase { assertEquals("sha1", as.getDataDigestMethod());
assertEquals("sha1", as.getPropertiesDigestMethod());
-
-
-
}
-
-
}
diff --git a/pdf-as-release/src/main/assembly/release.xml b/pdf-as-release/src/main/assembly/release.xml index cc63cca..afb2f82 100644 --- a/pdf-as-release/src/main/assembly/release.xml +++ b/pdf-as-release/src/main/assembly/release.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?>
<!-- http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html -->
<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>release</id>
@@ -17,12 +17,10 @@ <moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
- <include>at.gv.egiz:pdf-as-lib</include>
<include>at.gv.egiz:pdf-as-web</include>
</includes>
<binaries>
<includeDependencies>false</includeDependencies>
- <outputDirectory />
<unpack>false</unpack>
</binaries>
</moduleSet>
@@ -38,6 +36,14 @@ <outputDirectory />
</fileSet>
+ <fileSet>
+ <directory>../pdf-as-lib/target</directory>
+ <includes>
+ <include>*.zip</include>
+ </includes>
+ <outputDirectory />
+ </fileSet>
+
</fileSets>
</assembly>
diff --git a/pdf-as-web/pom.xml b/pdf-as-web/pom.xml index ba21311..aa4fe57 100644 --- a/pdf-as-web/pom.xml +++ b/pdf-as-web/pom.xml @@ -17,12 +17,6 @@ <name>PDF-AS Web</name>
<description>Webapplikation zur Amtssignatur fuer elektronische Aktenfuehrung</description>
- <build>
-
- <finalName>pdf-as-${project.version}</finalName>
-
- </build>
-
<dependencies>
<dependency>
@@ -62,7 +56,6 @@ <dependency>
<groupId>net.htmlparser.jericho</groupId>
<artifactId>jericho-html</artifactId>
- <version>3.2</version>
</dependency>
</dependencies>
@@ -156,7 +156,7 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.3</version> + <version>1.6</version> </dependency> <dependency> |