summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BKUWebStart/pom.xml7
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java15
-rw-r--r--JettyTempCleaner/pom.xml173
-rw-r--r--JettyTempCleaner/src/main/java/JettyTempCleaner.java (renamed from BKUWebStart/src/main/java/JettyTempCleaner.java)0
-rw-r--r--pom.xml1
5 files changed, 188 insertions, 8 deletions
diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml
index d4ff8cb6..0889071b 100644
--- a/BKUWebStart/pom.xml
+++ b/BKUWebStart/pom.xml
@@ -29,7 +29,7 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
- <includeArtifactIds>BKULocal</includeArtifactIds>
+ <includeArtifactIds>BKULocal,JettyTempCleaner</includeArtifactIds>
<includeGroupIds>at.gv.egiz</includeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<stripVersion>true</stripVersion>
@@ -344,6 +344,11 @@
<artifactId>BKUCertificates</artifactId>
</dependency>
<dependency>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>JettyTempCleaner</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>iaik</groupId>
<artifactId>iaik_jce_full_signed</artifactId>
<scope>compile</scope>
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
index 9eaa13b2..19adf571 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
@@ -57,7 +57,7 @@ public class Container {
public static final String HTTP_PORT_PROPERTY = "mocca.http.port";
public static final String HTTPS_PORT_PROPERTY = "mocca.https.port";
- private static final String JETTY_TEMP_CLEANER_CLASSNAME = "JettyTempCleaner";
+ private static final String JETTY_TEMP_CLEANER_JAR = "JettyTempCleaner.jar";
private static Logger log = LoggerFactory.getLogger(Container.class);
@@ -176,11 +176,11 @@ public class Container {
}
private void copyCleaner(File dir) throws IOException {
- File cleanerClass = new File(dir, JETTY_TEMP_CLEANER_CLASSNAME + ".class");
- log.debug("copying JettyTempCleaner to " + cleanerClass);
- InputStream is = getClass().getClassLoader().getResourceAsStream(JETTY_TEMP_CLEANER_CLASSNAME + ".class");
+ File cleanerJar = new File(dir, JETTY_TEMP_CLEANER_JAR);
+ log.debug("copying JettyTempCleaner to " + cleanerJar);
+ InputStream is = getClass().getClassLoader().getResourceAsStream(JETTY_TEMP_CLEANER_JAR);
OutputStream os;
- os = new BufferedOutputStream(new FileOutputStream(cleanerClass));
+ os = new BufferedOutputStream(new FileOutputStream(cleanerJar));
new StreamCopier(is, os).copyStream();
os.close();
}
@@ -198,11 +198,12 @@ public class Container {
copyCleaner(userDir);
List<String> args = new ArrayList<String>();
args.add("java");
- args.add(JETTY_TEMP_CLEANER_CLASSNAME);
+ args.add("-jar");
+ args.add(JETTY_TEMP_CLEANER_JAR);
args.add(tempDir.getAbsolutePath());
ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(userDir);
- log.debug("Starting " + JETTY_TEMP_CLEANER_CLASSNAME + " to remove " + tempDir.getAbsolutePath());
+ log.debug("Starting " + JETTY_TEMP_CLEANER_JAR + " to remove " + tempDir.getAbsolutePath());
pb.start();
} catch (IOException e) {
log.error("Failed to copy jetty temp cleaner", e);
diff --git a/JettyTempCleaner/pom.xml b/JettyTempCleaner/pom.xml
new file mode 100644
index 00000000..8924fb0d
--- /dev/null
+++ b/JettyTempCleaner/pom.xml
@@ -0,0 +1,173 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>mocca</artifactId>
+ <version>1.3.21-SNAPSHOT</version>
+ </parent>
+ <artifactId>JettyTempCleaner</artifactId>
+ <name>Jetty Temp Cleaner</name>
+ <url>http://joinup.ec.europa.eu/site/mocca/</url>
+ <description>Clean Jetty temp dir under windows after MOCCA webstart finishes</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ <revisionOnScmFailure>SvnRevMissing</revisionOnScmFailure>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ <!--configuration>
+ <jarPath>${project.build.directory}/${project.build.finalName}-single.${project.packaging}</jarPath>
+ </configuration-->
+ </execution>
+ </executions>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ <index>false</index>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <mainClass>JettyTempCleaner</mainClass>
+ </manifest>
+ <manifestEntries>
+ <Application-Name>JettyTempCleaner</Application-Name>
+ <Implementation-Build>${project.version}-r${buildNumber}</Implementation-Build>
+ <Permissions>all-permissions</Permissions>
+ <Codebase>*</Codebase>
+ <Caller-Allowable-Codebase>*</Caller-Allowable-Codebase>
+ <Trusted-Library>true</Trusted-Library>
+ </manifestEntries>
+ </archive>
+ <alias>test-applet signer</alias>
+ <keystore>../BKUApplet/keystore.ks</keystore>
+ <storepass>storepass</storepass>
+ <keypass>keypass</keypass>
+ <verify>true</verify>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>pkcs11-sign</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>2.2-mocca</version>
+ <configuration>
+ <keystore>NONE</keystore>
+ <type>PKCS11</type>
+ <providerClass>iaik.pkcs.pkcs11.provider.IAIKPkcs11</providerClass>
+ <alias>a-sit-2</alias>
+ <storepass>${pkcs11-pass}</storepass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ks-sign</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>2.2-mocca</version>
+ <configuration>
+ <keystore>${ks-file}</keystore>
+ <alias>a-sit-3</alias>
+ <storepass>${ks-pass}</storepass>
+ <keypass>${ks-pass}</keypass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!--
+ This profile is here for triggering when another scm than svn is
+ used (for example git). Get the git commit hash.
+ -->
+ <id>buildnumber-git</id>
+ <activation>
+ <file>
+ <missing>.svn</missing>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ def shell = "sh"
+ def param = "-c"
+ if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")) {
+ shell = "cmd"
+ param = "/c"
+ }
+ def gitSvnProc = [shell, param, "git rev-parse --short HEAD"].execute()
+ gitSvnProc.waitFor()
+ def svnref = gitSvnProc.in.text.trim()
+ project.properties['gitSvnRev'] = svnref
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ <format>{0}</format>
+ <items>
+ <item>${gitSvnRev}</item>
+ </items>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/BKUWebStart/src/main/java/JettyTempCleaner.java b/JettyTempCleaner/src/main/java/JettyTempCleaner.java
index 67854ecb..67854ecb 100644
--- a/BKUWebStart/src/main/java/JettyTempCleaner.java
+++ b/JettyTempCleaner/src/main/java/JettyTempCleaner.java
diff --git a/pom.xml b/pom.xml
index 2974df41..543858ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
<module>BKUGuiExt</module>
<module>smccSTALExt</module>
<module>BKUFonts</module>
+ <module>JettyTempCleaner</module>
</modules>
<inceptionYear>2007</inceptionYear>
<developers>