diff options
23 files changed, 1138 insertions, 587 deletions
| diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml index 9ac1dac7..bd46041f 100644 --- a/BKUOnline/pom.xml +++ b/BKUOnline/pom.xml @@ -56,7 +56,7 @@              <version>1.1.2-SNAPSHOT</version>              <scope>compile</scope>          </dependency> -		<dependency> +        <dependency>              <groupId>at.gv.egiz</groupId>              <artifactId>STALService</artifactId>              <version>1.1.2-SNAPSHOT</version> @@ -146,7 +146,7 @@                      </execution>                  </executions>              </plugin> -             +              <plugin>                  <artifactId>maven-war-plugin</artifactId>                  <version>2.0.2</version> @@ -164,7 +164,6 @@              <plugin>                  <groupId>org.codehaus.mojo</groupId>                  <artifactId>maven-buildnumber-plugin</artifactId> -                <version>0.9.6</version>                  <executions>                      <execution>                          <phase>validate</phase> @@ -215,6 +214,49 @@                  </plugins>              </build>          </profile> +        <profile> +          <id>include-webstart</id> +          <build> +            <plugins> +              <plugin> +                <artifactId>maven-dependency-plugin</artifactId> +                <executions> +                  <execution> +                      <!-- +                          Copy the webstart bundle in as a resource +                          before packaging starts. +                      --> +                      <phase>process-resources</phase> +                      <goals> +                          <goal>unpack</goal> +                      </goals> +                      <configuration> +                          <artifactItems> +                              <artifactItem> +                                  <groupId>at.gv.egiz</groupId> +                                  <artifactId>BKUWebStart</artifactId> +                                  <version>1.0.3-SNAPSHOT</version> +                                  <type>zip</type> +                              </artifactItem> +                          </artifactItems> +                          <outputDirectory>${project.build.directory}/${project.build.finalName}/webstart</outputDirectory> +                      </configuration> +                  </execution> +                </executions> +              </plugin> +            </plugins> +          </build> + +          <dependencies> +            <!-- not yet available in IBIBLIO, install locally --> +            <dependency> +              <groupId>com.sun.java.jnlp</groupId> +              <artifactId>jnlp-servlet</artifactId> +              <version>1.6.0.10</version> +            </dependency> +          </dependencies> +           +        </profile>      </profiles>      <properties>          <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server> diff --git a/BKUWebStart/src/main/jnlp/resources/logo.png b/BKUOnline/src/main/jnlp/resources/logo.pngBinary files differ index 2c622d88..2c622d88 100644 --- a/BKUWebStart/src/main/jnlp/resources/logo.png +++ b/BKUOnline/src/main/jnlp/resources/logo.png diff --git a/BKUWebStart/src/main/jnlp/resources/logo_64x64.png b/BKUOnline/src/main/jnlp/resources/logo_64x64.pngBinary files differ index fa6d7f96..fa6d7f96 100644 --- a/BKUWebStart/src/main/jnlp/resources/logo_64x64.png +++ b/BKUOnline/src/main/jnlp/resources/logo_64x64.png diff --git a/BKUWebStart/src/main/jnlp/resources/logo_90x90.png b/BKUOnline/src/main/jnlp/resources/logo_90x90.pngBinary files differ index d7f8bbd0..d7f8bbd0 100644 --- a/BKUWebStart/src/main/jnlp/resources/logo_90x90.png +++ b/BKUOnline/src/main/jnlp/resources/logo_90x90.png diff --git a/BKUWebStart/src/main/jnlp/resources/splash.png b/BKUOnline/src/main/jnlp/resources/splash.pngBinary files differ index 72c1d868..72c1d868 100644 --- a/BKUWebStart/src/main/jnlp/resources/splash.png +++ b/BKUOnline/src/main/jnlp/resources/splash.png diff --git a/BKUOnline/src/main/jnlp/template.xml b/BKUOnline/src/main/jnlp/template.xml new file mode 100644 index 00000000..c8291f61 --- /dev/null +++ b/BKUOnline/src/main/jnlp/template.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="$jnlpspec" codebase="$$codebase" context="$$context" href="$$name"> +  <information> +    <title>$project.Name</title> +    <vendor>$project.Organization.Name</vendor> +    <homepage href="$project.Url"/> +    <description>$project.Description</description> +    <description kind="short">$project.Description</description> +    <icon href="lib/logo.png" kind="default"/> +    <icon href="lib/splash.png" kind="splash"/> +    <shortcut online="false"> +      <desktop/> +      <menu submenu="Bürgerkarte"/> +    </shortcut> + +#if($offlineAllowed) +    <offline-allowed/> +#end + +  </information> + + +#if($allPermissions) +  <security> +    <all-permissions/> +  </security> +#end + +  <resources> +    <!-- initial-heap-size="32m" max-heap-size="128m" --> +    <j2se version="$j2seVersion"/> +    <property name="jnlp.versionEnabled" value="true"/> + +     $dependencies + +  </resources> +  <application-desc main-class="$mainClass"/> +</jnlp>
\ No newline at end of file diff --git a/BKUOnline/src/main/webapp/WEB-INF/web.xml b/BKUOnline/src/main/webapp/WEB-INF/web.xml index 46e69c4a..eda18378 100644 --- a/BKUOnline/src/main/webapp/WEB-INF/web.xml +++ b/BKUOnline/src/main/webapp/WEB-INF/web.xml @@ -13,63 +13,63 @@  		License.  	-->  <web-app id="bkuonline" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> -	<display-name>http-security-layer-request</display-name> +  <display-name>http-security-layer-request</display-name>  	<!--  Begin Spring Config --> -	<context-param> -		<param-name>contextConfigLocation</param-name> -		<param-value>/WEB-INF/applicationContext.xml</param-value> -	</context-param> -	<listener> -		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> -	</listener> +  <context-param> +    <param-name>contextConfigLocation</param-name> +    <param-value>/WEB-INF/applicationContext.xml</param-value> +  </context-param> +  <listener> +    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> +  </listener>  	<!--  End Spring Config -->  	<!--  Begin BKU Config --> -	<listener> -		<listener-class>at.gv.egiz.bku.online.webapp.SessionTimeout</listener-class> -	</listener> -	<servlet> -		<servlet-name>BKUServlet</servlet-name> -		<servlet-class>at.gv.egiz.bku.online.webapp.BKURequestHandler</servlet-class> -	</servlet> -	<servlet> -		<servlet-name>ResultServlet</servlet-name> -		<servlet-class>at.gv.egiz.bku.online.webapp.ResultServlet</servlet-class> -		<init-param> -			<param-name>responseEncoding</param-name> -			<param-value>UTF-8</param-value> -		</init-param> -		<init-param> -			<param-name>expiredPage</param-name> +  <listener> +    <listener-class>at.gv.egiz.bku.online.webapp.SessionTimeout</listener-class> +  </listener> +  <servlet> +    <servlet-name>BKUServlet</servlet-name> +    <servlet-class>at.gv.egiz.bku.online.webapp.BKURequestHandler</servlet-class> +  </servlet> +  <servlet> +    <servlet-name>ResultServlet</servlet-name> +    <servlet-class>at.gv.egiz.bku.online.webapp.ResultServlet</servlet-class> +    <init-param> +      <param-name>responseEncoding</param-name> +      <param-value>UTF-8</param-value> +    </init-param> +    <init-param> +      <param-name>expiredPage</param-name>  			<!-- FIXME --> -			<param-value>expired.html</param-value> -		</init-param> -	</servlet> -    <servlet> -        <servlet-name>BKUApplet</servlet-name> -        <jsp-file>/applet.jsp</jsp-file> -    </servlet> -    <servlet> -      <servlet-name>help</servlet-name> -      <jsp-file>/help.jsp</jsp-file> -    </servlet> -    <servlet-mapping> -		<servlet-name>BKUServlet</servlet-name> -		<url-pattern>/http-security-layer-request</url-pattern> -	</servlet-mapping> -	<servlet-mapping> -		<servlet-name>BKUServlet</servlet-name> -		<url-pattern>/https-security-layer-request</url-pattern> -	</servlet-mapping> -	<servlet-mapping> -		<servlet-name>ResultServlet</servlet-name> -		<url-pattern>/bkuResult</url-pattern> -	</servlet-mapping> -    <servlet-mapping> -      <servlet-name>help</servlet-name> -      <url-pattern>/help/*</url-pattern> -    </servlet-mapping> +      <param-value>expired.html</param-value> +    </init-param> +  </servlet> +  <servlet> +    <servlet-name>BKUApplet</servlet-name> +    <jsp-file>/applet.jsp</jsp-file> +  </servlet> +  <servlet> +    <servlet-name>help</servlet-name> +    <jsp-file>/help.jsp</jsp-file> +  </servlet> +  <servlet-mapping> +    <servlet-name>BKUServlet</servlet-name> +    <url-pattern>/http-security-layer-request</url-pattern> +  </servlet-mapping> +  <servlet-mapping> +    <servlet-name>BKUServlet</servlet-name> +    <url-pattern>/https-security-layer-request</url-pattern> +  </servlet-mapping> +  <servlet-mapping> +    <servlet-name>ResultServlet</servlet-name> +    <url-pattern>/bkuResult</url-pattern> +  </servlet-mapping> +  <servlet-mapping> +    <servlet-name>help</servlet-name> +    <url-pattern>/help/*</url-pattern> +  </servlet-mapping>      <!--       |  Configure alternative applet pages that may be requested @@ -94,26 +94,48 @@  	<!--  End BKU Config -->  	<!--  Begin STAL Config --> -	<listener> -		<listener-class> -			com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class> -	</listener> -	<servlet> -		<servlet-name>STALPort</servlet-name> -		<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> -		<load-on-startup>1</load-on-startup> -	</servlet> -	<servlet-mapping> -		<servlet-name>STALPort</servlet-name> -		<url-pattern>/stal</url-pattern> -	</servlet-mapping> +  <listener> +    <listener-class> +			com.sun.xml.ws.transport.http.servlet.WSServletContextListener +    </listener-class> +  </listener> +  <servlet> +    <servlet-name>STALPort</servlet-name> +    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> +    <load-on-startup>1</load-on-startup> +  </servlet> +  <servlet-mapping> +    <servlet-name>STALPort</servlet-name> +    <url-pattern>/stal</url-pattern> +  </servlet-mapping>  	<!--  End STAL Config --> -	<welcome-file-list> -		<welcome-file>index.html</welcome-file> -		<welcome-file>index.jsp</welcome-file> -	</welcome-file-list> +  <!-- Begin BKU Web Start Config +   |   (activate 'include-webstart' profile) --> +  <!--servlet> +    <servlet-name>JnlpDownloadServlet</servlet-name> +    <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class> +    <init-param> +      <param-name>logLevel</param-name> +      <param-value>DEBUG</param-value> +    </init-param> +    <init-param> +      <param-name>logPath</param-name> +      <param-value>logs/jnlpdownloadservlet.log</param-value> +    </init-param> +  </servlet> + +  <servlet-mapping> +    <servlet-name>JnlpDownloadServlet</servlet-name> +    <url-pattern>/webstart/*</url-pattern> +  </servlet-mapping--> +  <!-- End BKU Web Start Config --> + +  <welcome-file-list> +    <welcome-file>index.html</welcome-file> +    <welcome-file>index.jsp</welcome-file> +  </welcome-file-list>    <session-config> -		<session-timeout>5</session-timeout> -	</session-config> +    <session-timeout>5</session-timeout> +  </session-config>  </web-app> diff --git a/BKUOnline/src/main/webapp/index.html b/BKUOnline/src/main/webapp/index.html index 653da5b1..b0e519a5 100644 --- a/BKUOnline/src/main/webapp/index.html +++ b/BKUOnline/src/main/webapp/index.html @@ -17,9 +17,10 @@  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  <html>      <head> -        <title>BKU Online</title> +        <title>MOCCA Online</title>          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">          <style type="text/css" media="all">@import "css/main.css";</style> +        <script src="http://java.com/js/deployJava.js"></script>      </head>      <body>          <div id="animDiv" class="box"> @@ -30,6 +31,14 @@                  <a href="PINManagement.jsp">PIN Management Applet</a>                  <h1>STAL Service</h1>                  <a href="stal">STAL Service Endpoint</a> +                <!-- MOCCA Web Start  +                 |   (activate 'include-webstart' profile) +                <h1>MOCCA Web Start</h1> +                <script> +                    var url="webstart/mocca.jnlp" +                    deployJava.createWebStartLaunchButton(url, "1.6") +                </script> +                 |-->              </p>          </div>      </body> diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index c61937bb..ec5fd976 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -10,35 +10,17 @@    <artifactId>BKUWebStart</artifactId>    <packaging>jar</packaging>    <name>BKU Web Start</name> -  <version>1.0-SNAPSHOT</version> -  <url>http://danu-lin.iaik.tugraz.at:8080/jnlp</url> -  <description>Web Start Bürgerkartenumgebung (BKU) MOCCA-lokal</description> +  <!--  +   | IMPORTANT: update jnlp/resources/version.xml if version changes +   |--> +  <version>1.0.3-SNAPSHOT</version> +  <url>http://mocca.egovlabs.gv.at/</url> +  <description>Web Start Bürgerkartenumgebung (MOCCA-lokal)</description>    <build> -    <finalName>BKUWebStart</finalName>      <plugins> -      <!-- target/jnlp does not yet exist.. -      <plugin> -        <groupId>org.codehaus.mojo.webstart</groupId> -        <artifactId>webstart-maven-plugin</artifactId> -        <executions> -           <execution> -              <goals> -                 <goal>unsign</goal> -              </goals> -              <phase>package</phase> -           </execution> -        </executions> -        <configuration> -          <jarPath>${project.build.directory}/jnlp/lib/iaik_jce_full_signed-3.16.jar</jarPath> -          <jarPath>${project.build.directory}/jnlp/lib/iaik_ecc_signed-2.15.jar</jarPath> -          <verbose>true</verbose> -        </configuration> -      </plugin> -      --> -        <!--plugin>          <groupId>org.apache.maven.plugins</groupId>          <artifactId>maven-war-plugin</artifactId> @@ -54,14 +36,15 @@          </configuration>        </plugin--> -       <plugin> +      <plugin>           <!-- unpack BKULocal prior to webstart jar generation to include -->          <groupId>org.apache.maven.plugins</groupId>          <artifactId>maven-dependency-plugin</artifactId>          <executions> +          <!-- unpack BKULocalWar to classpath            <execution> -            <id>unpack-dependencies</id> -            <phase>package</phase> +            <id>unpack BKULocal webapp</id> +            <phase>process-resources</phase>              <goals>                <goal>unpack-dependencies</goal>              </goals> @@ -69,14 +52,45 @@                <includeGroupIds>at.gv.egiz</includeGroupIds>                <includeArtifactIds>BKULocal</includeArtifactIds>                <includeTypes>war</includeTypes> -              <!-- -              <includes>**/*.class</includes> -              <excludes>**/*.properties</excludes> -              -->                <outputDirectory>${project.build.directory}/classes/BKULocalWar</outputDirectory>                <overWriteReleases>false</overWriteReleases>                <overWriteSnapshots>true</overWriteSnapshots>              </configuration> +          </execution--> + +          <!--execution> +            <id>copy</id> +            <phase>package</phase> +            <goals> +              <goal>copy</goal> +            </goals> +            <configuration> +              <artifactItems> +                <artifactItem> +                  <groupId>at.gv.egiz</groupId> +                  <artifactId>BKULocal</artifactId> +                  <version>[ version ]</version> +                  <type>[ packaging ]</type> +                  <classifier> [classifier - optional] </classifier> +                  <overWrite>[ true or false ]</overWrite> +                  <outputDirectory>[ output directory ]</outputDirectory> +                  <destFileName>[ filename ]</destFileName> +                </artifactItem> +              </artifactItems> +            </configuration> +          </execution--> +          <execution> +            <id>copy BKULocal webapp</id> +            <goals> +              <goal>copy-dependencies</goal> +            </goals> +            <configuration> +              <includeGroupIds>at.gv.egiz</includeGroupIds> +              <includeArtifactIds>BKULocal</includeArtifactIds> +              <includeTypes>war</includeTypes> +              <outputDirectory>${project.build.directory}/classes/</outputDirectory> +              <stripVersion>true</stripVersion> +            </configuration>            </execution>          </executions>        </plugin> @@ -85,113 +99,101 @@          <groupId>org.codehaus.mojo.webstart</groupId>          <artifactId>webstart-maven-plugin</artifactId>          <executions> -           <execution> -              <goals> -                 <goal>jnlp</goal> <!-- use jnlp, jnlp-inline or jnlp-single as appropriate --> -              </goals> -              <phase>package</phase> -           </execution> +          <execution> +          <!-- need lifecycle phase binding, otherwise +           |   LifecycleSpecificationException: No lifecycle phase binding can be found for goal: jnlp --> +            <phase>package</phase> +            <goals> +             <!-- IMPORTANT: USE jnlp-inline, otherwise no execution in install phase and +                  the .zip artifact is not installed +                  (parallel lifecycle build finished prior to install phase?) --> +              <goal>jnlp-inline</goal> +            </goals> +          </execution>          </executions>          <configuration> -           <!--outputDirectory></outputDirectory--> <!-- not required?? --> - -           <!-- -           Set to true to exclude all transitive dependencies. Default is false. -           --> -           <excludeTransitive>false</excludeTransitive> - -           <!-- The path where the libraries are stored within the jnlp structure. not required. by default the libraries are within the working directory --> -           <libPath>lib</libPath> - -           <!-- [optional] transitive dependencies filter - if omitted, all transitive dependencies are included --> -           <dependencies> -             <!-- Note that only groupId and artifactId must be specified here. because of a limitation of the Include/ExcludesArtifactFilter --> -             <includes> -                <include>commons-logging:commons-logging</include> -                <include>log4j:log4j</include> -                <include>at.gv.egiz:utils</include> -                <include>javax.activation:activation</include> -                <include>iaik:iaik_ecc</include> -                <include>iaik:iaik_jce</include> -                <include>iaik:iaik_xsect_unsigned</include> -                <include>org.mortbay.jetty:jetty</include> -                <include>org.mortbay.jetty:jetty-util</include> -                <include>org.mortbay.jetty:servlet-api</include> -             </includes> -             <!-- excludes> -                <exclude></exclude> -             <excludes--> -           </dependencies> - -           <!--resourcesDirectory>${project.basedir}/src/main/jnlp/resources</resourcesDirectory--> <!-- default value --> - -           <!-- JNLP generation --> -           <jnlp> -             <!-- default values --> -             <!--inputTemplateResourcePath>${project.basedir}</inputTemplateResourcePath--> -             <inputTemplate>src/main/jnlp/template.xml</inputTemplate> <!-- relative to inputTemplateResourcePath --> -             <outputFile>mocca.jnlp</outputFile> <!-- defaults to launch.jnlp --> - -             <!-- used to automatically identify the jar containing the main class. --> -             <!-- this is perhaps going to change --> -             <mainClass>at.gv.egiz.bku.webstart.BKULauncher</mainClass> - -             <j2seVersion>1.6+</j2seVersion> -             <!--offlineAllowed>true</offlineAllowed--> -             <!--allPermissions>true</allPermissions--> -           </jnlp> - -           <!-- SIGNING --> -           <!-- defining this will automatically sign the jar and its dependencies, if necessary --> -           <sign> -             <alias>test-applet signer</alias> -             <keystore>${project.basedir}/keystore.ks</keystore> -             <storepass>storepass</storepass>  <!-- ${storepass} --> -             <keypass>keypass</keypass> <!-- we need to override passwords easily from the command line. ${keypass} --> -             <!--storetype>fillme</storetype--> - -             <!--validity>fillme</validity--> - -             <!-- only required for generating the keystore --> -             <!--dnameCn>fillme</dnameCn> -             <dnameOu>fillme</dnameOu> -             <dnameO>fillme</dnameO> -             <dnameL>fillme</dnameL> -             <dnameSt>fillme</dnameSt> -             <dnameC>fillme</dnameC--> - -             <verify>true</verify> <!-- verify that the signing operation succeeded --> - -             <!-- KEYSTORE MANAGEMENT --> -             <keystoreConfig> -               <delete>false</delete> <!-- delete the keystore --> -               <gen>false</gen>       <!-- optional shortcut to generate the store. --> -             </keystoreConfig> -           </sign> - -           <!-- BUILDING PROCESS --> - -           <pack200>false</pack200> -           <gzip>false</gzip> <!-- default force when pack200 false, true when pack200 selected ?? --> - -           <!-- causes a version attribute to be output in each jar resource element, optional, default is false --> -           <outputJarVersions>true</outputJarVersions> - -            <!-- unsign IAIK-JCE (webstart error:  JAR-Ressourcen in JNLP-Datei sind nicht von demselben Zertifikat signiert) --> -            <unsignAlreadySignedJars>true</unsignAlreadySignedJars> - -           <!--install>false</install--> <!-- not yet supported --> -           <verbose>true</verbose> + +          <excludeTransitive>false</excludeTransitive> + +          <!-- causes unsignAlreadySignedJars to fail +               (cf. http://jira.codehaus.org/browse/MWEBSTART-107) +          <libPath>lib</libPath--> + +          <!--resourcesDirectory>${project.basedir}/src/main/jnlp/resources</resourcesDirectory--> + +          <jnlp> +            <inputTemplateResourcePath>${project.basedir}/src/main/jnlp</inputTemplateResourcePath> +            <inputTemplate>template.xml</inputTemplate> +            <outputFile>mocca.jnlp</outputFile> +            <mainClass>at.gv.egiz.bku.webstart.BKULauncher</mainClass> +            <j2seVersion>1.6+</j2seVersion> +            <offlineAllowed>true</offlineAllowed> +            <allPermissions>true</allPermissions> +          </jnlp> + +          <sign> +            <alias>test-applet signer</alias> +            <keystore>${project.basedir}/keystore.ks</keystore> +            <storepass>storepass</storepass> +            <keypass>keypass</keypass> <!-- we need to override passwords easily from the command line. ${keypass} --> +            <verify>true</verify> <!-- verify that the signing operation succeeded --> +            <keystoreConfig> +              <delete>false</delete> <!-- delete the keystore --> +              <gen>false</gen>       <!-- optional shortcut to generate the store. --> +            </keystoreConfig> +          </sign> + +          <!-- BUILDING PROCESS --> +          <pack200>true</pack200> +          <!--gzip>true</gzip--> <!-- default force when pack200 false, true when pack200 selected ?? --> + +          <!-- causes a version attribute to be output in each jar resource element, optional, default is false --> +          <outputJarVersions>true</outputJarVersions> + +          <!-- unsign IAIK-JCE (webstart error:  JAR-Ressourcen in JNLP-Datei sind nicht von demselben Zertifikat signiert) --> +          <unsignAlreadySignedJars>true</unsignAlreadySignedJars> + +          <!--install>false</install--> <!-- not yet supported --> +          <verbose>true</verbose>          </configuration>        </plugin> +      <plugin> +        <groupId>org.codehaus.mojo</groupId> +        <artifactId>maven-buildnumber-plugin</artifactId> +        <executions> +          <execution> +            <phase>validate</phase> +            <goals> +              <goal>create</goal> +            </goals> +          </execution> +        </executions> +        <configuration> +          <doCheck>false</doCheck> +          <doUpdate>false</doUpdate> +        </configuration> +      </plugin> -      - - +      <plugin> +        <groupId>org.apache.maven.plugins</groupId> +        <artifactId>maven-jar-plugin</artifactId> +        <configuration> +          <archive> +            <manifest> +              <addDefaultImplementationEntries>true</addDefaultImplementationEntries> +            </manifest> +            <manifestEntries> +              <Implementation-Build>${project.version}-r${buildNumber}</Implementation-Build> +            </manifestEntries> +          </archive> +          <verbose>true</verbose> +        </configuration> +      </plugin>      </plugins>    </build> +      <dependencies>      <dependency>        <groupId>at.gv.egiz</groupId> @@ -205,21 +207,6 @@        <version>1.1.2-SNAPSHOT</version>      </dependency>      <dependency> -      <artifactId>iaik_jce</artifactId> -      <groupId>iaik</groupId> -      <version>3.16</version> -    </dependency> -    <dependency> -      <artifactId>iaik_ecc</artifactId> -      <groupId>iaik</groupId> -      <version>2.15</version> -    </dependency> -    <dependency> -      <artifactId>iaik_xsect_unsigned</artifactId> -      <groupId>iaik</groupId> -      <version>1.14</version> -    </dependency> -    <dependency>        <groupId>commons-logging</groupId>        <artifactId>commons-logging</artifactId>        <version>1.0.4</version> @@ -231,9 +218,56 @@      </dependency>    </dependencies> - - - - +<!-- + +  <profiles> +    <profile> +      <id>webapp</id> +      <build> +        <plugins> +          <plugin> +            <groupId>org.codehaus.mojo.webstart</groupId> +            <artifactId>webstart-maven-plugin</artifactId> +            <executions> +              <execution> +                <phase>process-resources</phase> +                <goals> +                  <goal>jnlp-download-servlet</goal> +                </goals> +              </execution> +            </executions> +            <configuration> +              <templateDirectory>${project.basedir}/src/main/jnlp</templateDirectory> +              <jnlpFiles> +                <jnlpFile> +                  <templateFilename>template.xml</templateFilename> +                  <outputFilename>mocca.jnlp</outputFilename> +                  <jarResources> +                    <jarResource> +                      <groupId>at.gv.egiz</groupId> +                      <artifactId>BKUWebStart</artifactId> +                      <version>1.0-SNAPSHOT</version> +                      <mainClass>at.gv.egiz.bku.webstart.BKULauncher</mainClass> +                    </jarResource> +                  </jarResources> +                </jnlpFile> +              </jnlpFiles> +            </configuration> +          </plugin> +        </plugins> +      </build> +    </profile> +     +     +    <profile> +      <id>standalone</id> +      <build> +        <plugins> +    ... +        </plugins> +      </build> +    </profile> +  </profiles> +  -->  </project>
\ No newline at end of file diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 854e6535..3d09fb00 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -1,15 +1,23 @@  package at.gv.egiz.bku.webstart;
 +import iaik.asn1.CodingException;
  import java.io.File;
 +import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
 +import java.net.MalformedURLException;
  import java.security.KeyStore;
 +import java.security.KeyStoreException;
 +import java.security.NoSuchAlgorithmException;
 +import java.security.cert.CertificateException;
  import java.util.Enumeration;
  import java.util.Locale;
  import java.util.MissingResourceException;
  import java.util.ResourceBundle;
 +import java.util.logging.Level;
 +import java.util.logging.Logger;
  import java.util.zip.ZipEntry;
  import java.util.zip.ZipFile;
 @@ -25,16 +33,157 @@ import org.apache.commons.logging.LogFactory;  import at.gv.egiz.bku.webstart.ui.BKUControllerInterface;
  import at.gv.egiz.bku.webstart.ui.TrayIconDialog;
  import at.gv.egiz.bku.utils.StreamUtil;
 +import java.awt.Desktop;
 +import java.io.BufferedInputStream;
 +import java.io.BufferedOutputStream;
 +import java.io.BufferedReader;
 +import java.io.BufferedWriter;
 +import java.io.FileInputStream;
 +import java.io.FileReader;
 +import java.io.FileWriter;
 +import java.net.URI;
 +import java.net.URL;
 +import java.security.GeneralSecurityException;
 +import java.util.UUID;
 +import java.util.jar.Attributes;
 +import java.util.jar.Manifest;
 +import java.util.zip.ZipOutputStream;
  public class BKULauncher implements BKUControllerInterface {
 +  /** configurations with less than this (major) version will be backuped and updated */
 +  public static final String MIN_CONFIG_VERSION = "1.0.3";
 +  public static final String CONFIG_DIR = ".mocca/conf/";
 +  public static final String CONF_TEMPLATE_FILE = "template.zip";
 +  public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/template.zip";
 +  public static final String WEBAPP_RESOURCE = "BKULocal.war";
 +  public static final String WEBAPP_FILE = "BKULocal.war";
 +  public static final String KEYSTORE_FILE = "keystore.ks";
 +  public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/ui/UIMessages";
 +  public static final String PASSWD_FILE = ".secret";
 +  /** resource bundle messages */
 +  public static final String GREETING_CAPTION = "Greetings.Caption";
 +  public static final String GREETING_MESSAGE = "Greetings.Message";
 +  public static final String VERSION_FILE = ".version";
    private static Log log = LogFactory.getLog(BKULauncher.class);
 -
    private ResourceBundle resourceBundle = null;
    private Container server;
 -//  private SplashScreen splash = SplashScreen.getSplashScreen();
 +  private void createConfig(File configDir, File versionFile, String version) throws IOException, CertificateException, GeneralSecurityException, KeyStoreException, FileNotFoundException, NoSuchAlgorithmException {
 +    log.debug("creating config directory: " + configDir);
 +    configDir.mkdirs();
 +    InputStream is = getClass().getClassLoader().getResourceAsStream(CONF_TEMPLATE_RESOURCE);
 +    OutputStream os = new FileOutputStream(new File(configDir, CONF_TEMPLATE_FILE));
 +    StreamUtil.copyStream(is, os);
 +    os.close();
 +    File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE);
 +    unzip(confTemplateFile);
 +    confTemplateFile.delete();
 +    writeVersionFile(versionFile, version);
 +  }
 +
 +  private void createCertificates(File configDir) throws IOException, GeneralSecurityException, CodingException {
 +    char[] password = UUID.randomUUID().toString().toCharArray();
 +    File passwdFile = new File(configDir, PASSWD_FILE);
 +    FileWriter passwdWriter = new FileWriter(passwdFile);
 +    passwdWriter.write(password);
 +    passwdWriter.close();
 +    if (!passwdFile.setReadable(true, true)) {
 +      passwdFile.delete();
 +      throw new IOException("failed to make " + passwdFile + " owner readable only, deleting file");
 +    }
 +    TLSServerCA ca = new TLSServerCA();
 +    KeyStore ks = ca.generateKeyStore(password);
 +    FileOutputStream fos = new FileOutputStream(new File(configDir, KEYSTORE_FILE));
 +    ks.store(fos, password);
 +    fos.close();
 +  }
 +
 +  private String getFileVersion(File versionFile) throws FileNotFoundException, IOException {
 +    //TODO no file?
 +    if (versionFile.exists() && versionFile.canRead()) {
 +      BufferedReader versionReader = new BufferedReader(new FileReader(versionFile));
 +      String versionString = null;
 +      while ((versionString = versionReader.readLine().trim()) != null) {
 +        if (versionString.length() > 0 && !versionString.startsWith("#")) {
 +          log.debug("found existing configuration version " + versionString);
 +          break;
 +        }
 +      }
 +      return versionString;
 +    }
 +    return null;
 +  }
 +
 +  private String getManifestVersion() throws MalformedURLException, IOException {
 +    String bkuWebStartJar = BKULauncher.class.getProtectionDomain().getCodeSource().getLocation().toString();
 +    URL manifestURL = new URL("jar:" + bkuWebStartJar + "!/META-INF/MANIFEST.MF");
 +    String version = null;
 +    if (manifestURL != null) {
 +      Manifest manifest = new Manifest(manifestURL.openStream());
 +      if (log.isTraceEnabled()) {
 +        log.trace("read version information from " + manifestURL);
 +      }
 +      Attributes atts = manifest.getMainAttributes();
 +      if (atts != null) {
 +        version = atts.getValue("Implementation-Build");
 +      }
 +    }
 +    if (version == null) {
 +      version = "UNKNOWN";
 +    }
 +    log.debug("config version: " + version);
 +    return version;
 +  }
 +
 +  /**
 +   * change the
 +   * @param oldVersion
 +   * @param newVersion
 +   * @return
 +   */
 +  private boolean updateRequired(String oldVersion, String newVersion) {
 +    if (oldVersion != null) {
 +      int majorEnd = oldVersion.indexOf('-');
 +      if (majorEnd > 0) {
 +        oldVersion = oldVersion.substring(0, majorEnd);
 +      }
 +      return (oldVersion.compareTo(MIN_CONFIG_VERSION) < 0);
 +    }
 +    log.debug("no old version, update required");
 +    return true;
 +  }
 +
 +  private boolean updateRequiredStrict(String oldVersion, String newVersion) {
 +    String[] oldV = oldVersion.split("-");
 +    String[] newV = newVersion.split("-");
 +    log.debug("comparing " + oldV[0] + " to " + newV[0]);
 +    if (oldV[0].compareTo(newV[0]) < 0) {
 +      log.debug("update required");
 +      return true;
 +    } else {
 +      log.debug("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]);
 +      if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) {
 +        log.debug("update required");
 +        return true;
 +      } else {
 +        log.debug("no update required");
 +        return false;
 +      }
 +    }
 +  }
 +
 +  private void writeVersionFile(File versionFile, String version) throws IOException {
 +    BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile));
 +    versionWriter.write("# MOCCA Web Start configuration version\n");
 +    versionWriter.write("# DO NOT MODIFY THIS FILE\n\n");
 +    versionWriter.write(version);
 +    versionWriter.close();
 +  }
 +
 +//  private SplashScreen splash = SplashScreen.getSplashScreen();
    private void startUpServer() throws Exception {
 +    log.info("init servlet container and MOCCA webapp");
      server = new Container();
      // XmlConfiguration xcfg = new XmlConfiguration(getClass().getClassLoader()
      // .getResourceAsStream("at/gv/egiz/bku/local/app/jetty.xml"));
 @@ -44,25 +193,24 @@ public class BKULauncher implements BKUControllerInterface {    }
    private void initTrayIcon() {
 +    log.debug("init MOCCA tray icon");
      Locale loc = Locale.getDefault();
      try {
        resourceBundle = ResourceBundle.getBundle(
 -          "at/gv/egiz/bku/webstart/ui/UIMessages", loc);
 +              MESSAGES_RESOURCE, loc);
      } catch (MissingResourceException mx) {
        resourceBundle = ResourceBundle.getBundle(
 -          "at/gv/egiz/bku/webstart/ui/UIMessages", Locale.ENGLISH);
 +              MESSAGES_RESOURCE, Locale.ENGLISH);
      }
      TrayIconDialog.getInstance().init(resourceBundle);
      TrayIconDialog.getInstance().setShutdownHook(this);
 -    TrayIconDialog.getInstance().displayInfo("Greetings.Caption",
 -        "Greetings.Message");
 +    TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE);
    }
    private void initStart() {
 -
    }
 -  private void initFinished() {
 +  private void initFinished(boolean installCert) {
      try {
  //      if (splash != null) {
  //        try {
 @@ -71,34 +219,33 @@ public class BKULauncher implements BKUControllerInterface {  //          log.warn("Failed to close splash screen: " + ex.getMessage());
  //        }
  //      }
 +
 +      log.debug("trying install MOCCA certificate on system browser");
 +      if (installCert) {
 +        if (Desktop.isDesktopSupported()) {
 +          Desktop desktop = Desktop.getDesktop();
 +          if (desktop.isSupported(Desktop.Action.BROWSE)) {
 +            try {
 +              desktop.browse(new URI("https://localhost:" +
 +                      Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue()));
 +            } catch (Exception ex) {
 +              log.error("failed to open system browser, install MOCCA certificate manually", ex);
 +            }
 +          } else {
 +            log.error("failed to open system browser, install MOCCA certificate manually");
 +          }
 +        } else {
 +          log.error("failed to open system browser, install MOCCA certificate manually");
 +        }
 +      }
 +
 +      log.info("init completed, joining server");
        server.join();
      } catch (InterruptedException e) {
 -      log.info(e);
 +      log.warn("failed to join MOCCA server: " + e.getMessage(), e);
      }
    }
 -//  private void copyDirs(File srcDir, File dstDir) {
 -//    for (File cf : srcDir.listFiles()) {
 -//      File of = new File(dstDir, cf.getName());
 -//      if (cf.isDirectory()) {
 -//        log.debug("Creating directory: " + of);
 -//        of.mkdir();
 -//        copyDirs(cf, of);
 -//      } else {
 -//        log.debug("Writing file: " + of);
 -//        try {
 -//          FileInputStream fis = new FileInputStream(cf);
 -//          FileOutputStream fos = new FileOutputStream(of);
 -//          StreamUtil.copyStream(fis, fos);
 -//          fis.close();
 -//          fos.close();
 -//        } catch (IOException e) {
 -//          log.error("Cannot copy default configuration", e);
 -//        }
 -//      }
 -//    }
 -//  }
 -
    private void unzip(File zipfile) throws IOException {
      File dir = zipfile.getParentFile();
      ZipFile zipFile = new ZipFile(zipfile);
 @@ -113,73 +260,11 @@ public class BKULauncher implements BKUControllerInterface {        File f = new File(eF.getParent());
        f.mkdirs();
        StreamUtil.copyStream(zipFile.getInputStream(entry),
 -          new FileOutputStream(eF));
 +              new FileOutputStream(eF));
      }
      zipFile.close();
    }
 -  private void checkConfig(String[] args) {
 -//    CommandLineParser parser = new PosixParser();
 -//    Options options = new Options();
 -//    options.addOption("c", true, "the configuration's base directory");
 -//    options.addOption("h", false, "print this message");
 -//    try {
 -      File cfgDir = new File(System.getProperty("user.home") + "/.mocca/conf");
 -//      CommandLine cmd = parser.parse(options, args);
 -//      if (cmd.hasOption("h")) {
 -//        HelpFormatter formatter = new HelpFormatter();
 -//        formatter.printHelp("BKULauncher", options);
 -//        System.exit(0);
 -//      }
 -//
 -//      if (cmd.hasOption("c")) {
 -//        cfgDir = new File(cmd.getOptionValue("c"));
 -//      }
 -      log.debug("using config directory: " + cfgDir);
 -      if (cfgDir.exists() && cfgDir.isFile()) {
 -        log.error("Configuration directory must not be a file");
 -      }
 -      if (!cfgDir.exists()) {
 -        log.debug("Creating config directory: " + cfgDir);
 -        cfgDir.mkdirs();
 -        try {
 -          InputStream is = getClass().getClassLoader().getResourceAsStream(
 -              "at/gv/egiz/bku/webstart/defaultConf/template.zip");
 -          OutputStream os = new FileOutputStream(new File(cfgDir,
 -              "template.zip"));
 -          StreamUtil.copyStream(is, os);
 -          os.close();
 -          unzip(new File(cfgDir, "template.zip"));
 -        } catch (IOException iox) {
 -          log.error("Cannot create user directory", iox);
 -          return;
 -        }
 -        CA ca = new CA();
 -        char[] password = "changeMe".toCharArray();
 -        KeyStore ks = ca.generateKeyStore(password);
 -        if (ks != null) {
 -          File ksdir = new File(cfgDir, "keystore");
 -          ksdir.mkdirs();
 -          FileOutputStream fos;
 -          try {
 -            fos = new FileOutputStream(new File(ksdir, "keystore.ks"));
 -            ks.store(fos, password);
 -            fos.close();
 -          } catch (Exception e) {
 -            log.error("Cannot store keystore", e);
 -          }
 -        } else {
 -          log.error("Cannot create ssl certificate");
 -        }
 -      }
 -//    } catch (ParseException e1) {
 -//      log.error(e1);
 -//      HelpFormatter formatter = new HelpFormatter();
 -//      formatter.printHelp("BKULauncher", options);
 -//      System.exit(0);
 -//    }
 -  }
 -
    /**
     * @param args
     */
 @@ -189,15 +274,74 @@ public class BKULauncher implements BKUControllerInterface {        System.setSecurityManager(null);
        BKULauncher launcher = new BKULauncher();
        launcher.initStart();
 -      launcher.checkConfig(args);
 +
 +      File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR);
 +      boolean installCert = launcher.ensureConfig(configDir);
        launcher.startUpServer();
        launcher.initTrayIcon();
 -      launcher.initFinished();
 +      launcher.initFinished(installCert);
      } catch (Exception e) {
 -      log.fatal("Cannot launch BKU", e);
 +      log.fatal("Failed to launch BKU: " + e.getMessage(), e);
        System.exit(-1000);
      }
 +  }
 +
 +  private void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException {
 +    if (dir.isDirectory()) {
 +      File[] subDirs = dir.listFiles();
 +      for (File subDir : subDirs) {
 +        backupAndDelete(subDir, relativeTo, zip);
 +        subDir.delete();
 +      }
 +    } else {
 +      URI relativePath = relativeTo.relativize(dir.toURI());
 +      ZipEntry entry = new ZipEntry(relativePath.toString());
 +      zip.putNextEntry(entry);
 +      BufferedInputStream entryIS = new BufferedInputStream(new FileInputStream(dir));
 +      StreamUtil.copyStream(entryIS, zip);
 +      entryIS.close();
 +      zip.closeEntry();
 +      dir.delete();
 +    }
 +  }
 +  /**
 +   * Checks whether the config directory already exists and creates it otherwise.
 +   * @param configDir the config directory to be created
 +   * @return true if a new MOCCA cert was created (and needs to be installed in the browser)
 +   */
 +  private boolean ensureConfig(File configDir) throws IOException, GeneralSecurityException, CodingException {
 +    log.debug("config directory: " + configDir);
 +    String manifestVersion = getManifestVersion();
 +    File versionFile = new File(configDir, VERSION_FILE);
 +
 +    if (configDir.exists()) {
 +      if (configDir.isFile()) {
 +        log.error("invalid config directory: " + configDir);
 +        throw new IOException("invalid config directory: " + configDir);
 +      } else {
 +        String fileVersion = getFileVersion(versionFile);
 +        if (updateRequired(fileVersion, manifestVersion)) {
 +          if (fileVersion == null) {
 +            fileVersion = "unknown";
 +          }
 +          log.info("updating configuration from " + fileVersion + " to " + manifestVersion);
 +          File moccaDir = configDir.getParentFile();
 +          File zipFile = new File(moccaDir, "conf-" + fileVersion + ".zip");
 +          ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
 +          backupAndDelete(configDir, moccaDir.toURI(), zipOS);
 +          zipOS.close();
 +          createConfig(configDir, versionFile, manifestVersion);
 +          createCertificates(configDir);
 +          return true;
 +        }
 +      }
 +    } else {
 +      createConfig(configDir, versionFile, manifestVersion);
 +      createCertificates(configDir);
 +      return true;
 +    }
 +    return false;
    }
    public void shutDown() {
 @@ -217,5 +361,4 @@ public class BKULauncher implements BKUControllerInterface {      }
      System.exit(0);
    }
 -
  }
 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 ef12e4fd..0cd3e633 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 @@ -1,5 +1,15 @@  package at.gv.egiz.bku.webstart;
 +import at.gv.egiz.bku.utils.StreamUtil;
 +import java.io.BufferedOutputStream;
 +import java.io.BufferedReader;
 +import java.io.File;
 +import java.io.FileNotFoundException;
 +import java.io.FileOutputStream;
 +import java.io.FileReader;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.OutputStream;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.mortbay.jetty.Connector;
 @@ -14,8 +24,8 @@ import org.mortbay.thread.QueuedThreadPool;  public class Container {
 -  public static final String HTTP_PORT = "mocca.http.port";
 -  public static final String HTTPS_PORT = "mocca.http.port";
 +  public static final String HTTP_PORT_PROPERTY = "mocca.http.port";
 +  public static final String HTTPS_PORT_PROPERTY = "mocca.http.port";
    private static Log log = LogFactory.getLog(Container.class);
 @@ -24,7 +34,7 @@ public class Container {    public Container() {
    }
 -  public void init() {
 +  public void init() throws IOException {
      server = new Server();
      QueuedThreadPool qtp = new QueuedThreadPool();
      qtp.setMaxThreads(5);
 @@ -35,35 +45,51 @@ public class Container {      server.setGracefulShutdown(3000);
      SelectChannelConnector connector = new SelectChannelConnector();
 -    connector.setPort(Integer.getInteger(HTTP_PORT, 3495).intValue());
 +    connector.setPort(Integer.getInteger(HTTP_PORT_PROPERTY, 3495).intValue());
      connector.setAcceptors(1);
 -    connector.setConfidentialPort(Integer.getInteger(HTTPS_PORT, 3496).intValue());
 +    connector.setConfidentialPort(Integer.getInteger(HTTPS_PORT_PROPERTY, 3496).intValue());
 +    connector.setHost("127.0.0.1");
      SslSocketConnector sslConnector = new SslSocketConnector();
 -    sslConnector.setPort(Integer.getInteger(HTTPS_PORT, 3496).intValue());
 +    sslConnector.setPort(Integer.getInteger(HTTPS_PORT_PROPERTY, 3496).intValue());
      sslConnector.setAcceptors(1);
 -    sslConnector.setKeystore(System.getProperty("user.home")
 -        + "/.mocca/conf/keystore/keystore.ks");
 -    sslConnector.setPassword("changeMe");
 -    sslConnector.setKeyPassword("changeMe");
 +    sslConnector.setHost("127.0.0.1");
 +    File configDir = new File(System.getProperty("user.home") + "/" + BKULauncher.CONFIG_DIR);
 +    sslConnector.setKeystore(configDir.getPath() + "/" + BKULauncher.KEYSTORE_FILE);
 +    File passwdFile = new File(configDir, BKULauncher.PASSWD_FILE);
 +    BufferedReader reader = new BufferedReader(new FileReader(passwdFile));
 +    String pwd;
 +    while ((pwd = reader.readLine()) != null) {
 +      sslConnector.setPassword(pwd);
 +      sslConnector.setKeyPassword(pwd);
 +    }
 +    reader.close();
      server.setConnectors(new Connector[] { connector, sslConnector });
 -//    HandlerCollection handlers = new HandlerCollection();
      WebAppContext webapp = new WebAppContext();
 +    webapp.setLogUrlOnStart(true);
      webapp.setContextPath("/");
 -    webapp.setExtractWAR(true); //false
 -    webapp.setParentLoaderPriority(false); 
 +    webapp.setExtractWAR(true); 
 +    webapp.setParentLoaderPriority(false); //true);
 -//    webappcontext.setWar("BKULocal-1.0.4-SNAPSHOT.war");
 -    webapp.setWar(getClass().getClassLoader().getResource("BKULocalWar/").toString());
 -
 -//    handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
 +    webapp.setWar(copyWebapp(webapp.getTempDirectory())); //getClass().getClassLoader().getResource("BKULocalWar/").toString());
      server.setHandler(webapp);
      server.setGracefulShutdown(1000*3);
    }
 +
 +  private String copyWebapp(File webappDir) throws IOException {
 +    File webapp = new File(webappDir, "BKULocal.war");
 +    log.debug("copying BKULocal classpath resource to " + webapp);
 +    InputStream is = getClass().getClassLoader().getResourceAsStream("BKULocal.war");
 +    OutputStream os = new BufferedOutputStream(new FileOutputStream(webapp));
 +    StreamUtil.copyStream(is, os);
 +    os.close();
 +    return webapp.getPath();
 +  }
 +
    public void start() throws Exception {
      server.start();
    }
 diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java index f81d3d83..97ca716b 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java @@ -1,12 +1,20 @@  package at.gv.egiz.bku.webstart;
 +import iaik.asn1.CodingException;
  import iaik.asn1.ObjectID;
  import iaik.asn1.structures.AlgorithmID;
 +import iaik.asn1.structures.GeneralName;
 +import iaik.asn1.structures.GeneralNames;
  import iaik.asn1.structures.Name;
  import iaik.x509.X509Certificate;
 +import iaik.x509.extensions.AuthorityKeyIdentifier;
  import iaik.x509.extensions.BasicConstraints;
 +import iaik.x509.extensions.ExtendedKeyUsage;
  import iaik.x509.extensions.KeyUsage;
 +import iaik.x509.extensions.SubjectAltName;
 +import iaik.x509.extensions.SubjectKeyIdentifier;
 +import java.io.IOException;
  import java.math.BigInteger;
  import java.net.InetAddress;
  import java.net.UnknownHostException;
 @@ -22,8 +30,10 @@ import java.util.Random;  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
 -public class CA {
 -  private final static Log log = LogFactory.getLog(CA.class);
 +public class TLSServerCA {
 +  public static final int CA_VALIDITY_Y = 3;
 +  public static final int SERVER_VALIDITY_Y = 3;
 +  private final static Log log = LogFactory.getLog(TLSServerCA.class);
    private KeyPair caKeyPair;
    private X509Certificate caCert;
 @@ -31,21 +41,18 @@ public class CA {    private KeyPair serverKeyPair;
    private X509Certificate serverCert;
 -  public CA() {
 -  }
 -
    private KeyPair generateKeyPair() throws NoSuchAlgorithmException {
      KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
      gen.initialize(2048);
      return gen.generateKeyPair();
    }
 -  private void generateCA() throws GeneralSecurityException {
 -    log.debug("Generating CA certificate");
 +  private void generateCACert() throws GeneralSecurityException, CodingException {
 +    log.debug("generating MOCCA CA certificate");
      Name subject = new Name();
      subject.addRDN(ObjectID.country, "AT");
      subject.addRDN(ObjectID.organization, "MOCCA");
 -    subject.addRDN(ObjectID.organizationalUnit, "MOCCA-CA");
 +    subject.addRDN(ObjectID.organizationalUnit, "MOCCA TLS Server CA");
      caKeyPair = generateKeyPair();
      caCert = new X509Certificate();
 @@ -54,6 +61,8 @@ public class CA {      caCert.setPublicKey(caKeyPair.getPublic());
      caCert.setIssuerDN(subject);
 +    caCert.addExtension(new SubjectKeyIdentifier(caKeyPair.getPublic()));
 +
      caCert.addExtension(new BasicConstraints(true));
      caCert.addExtension(new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign
          | KeyUsage.digitalSignature));
 @@ -61,23 +70,22 @@ public class CA {      GregorianCalendar date = new GregorianCalendar();
      date.add(Calendar.HOUR_OF_DAY, -1);
      caCert.setValidNotBefore(date.getTime());
 -    date.add(Calendar.YEAR, 7);
 +    date.add(Calendar.YEAR, CA_VALIDITY_Y);
      caCert.setValidNotAfter(date.getTime());
      caCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate());
 -    log.debug("Successfully signed CA certificate");
 +    
 +    log.debug("successfully generated MOCCA TLS Server CA certificate " + caCert.getSubjectDN());
    }
 -  private void generateServerCert() throws GeneralSecurityException {
 -    log.debug("Generating SSL certificate");
 +  private void generateServerCert() throws GeneralSecurityException, CodingException {
 +    log.debug("generating MOCCA server certificate");
      Name subject = new Name();
      subject.addRDN(ObjectID.country, "AT");
      subject.addRDN(ObjectID.organization, "MOCCA");
 -    try {
 -      subject.addRDN(ObjectID.commonName, InetAddress.getLocalHost()
 -          .getHostName());
 -    } catch (UnknownHostException e) {
 -      subject.addRDN(ObjectID.commonName, "localhost");
 -    }
 +    subject.addRDN(ObjectID.organizationalUnit, "MOCCA TLS Server");
 +    subject.addRDN(ObjectID.commonName, "localhost");
 +    subject.addRDN(ObjectID.commonName, "127.0.0.1");
 +
      serverKeyPair = generateKeyPair();
      serverCert = new X509Certificate();
      serverCert.setSerialNumber(new BigInteger(20, new Random()));
 @@ -85,6 +93,18 @@ public class CA {      serverCert.setPublicKey(serverKeyPair.getPublic());
      serverCert.setIssuerDN(caCert.getSubjectDN());
 +    serverCert.addExtension(new SubjectKeyIdentifier(serverKeyPair.getPublic()));
 +    byte[] aki = new SubjectKeyIdentifier(caCert.getPublicKey()).get();
 +    serverCert.addExtension(new AuthorityKeyIdentifier(aki));
 +
 +    serverCert.addExtension(new ExtendedKeyUsage(ExtendedKeyUsage.serverAuth));
 +
 +    GeneralNames altNames = new GeneralNames();
 +    altNames.addName(new GeneralName(GeneralName.dNSName, "localhost"));
 +    altNames.addName(new GeneralName(GeneralName.dNSName, "127.0.0.1"));
 +    altNames.addName(new GeneralName(GeneralName.iPAddress, "127.0.0.1"));
 +    serverCert.addExtension(new SubjectAltName(altNames));
 +
      serverCert.addExtension(new BasicConstraints(false));
      serverCert.addExtension(new KeyUsage(KeyUsage.keyEncipherment
          | KeyUsage.digitalSignature));
 @@ -92,26 +112,27 @@ public class CA {      GregorianCalendar date = new GregorianCalendar();
      date.add(Calendar.HOUR_OF_DAY, -1);
      serverCert.setValidNotBefore(date.getTime());
 -    date.add(Calendar.YEAR, 7);
 +    date.add(Calendar.YEAR,SERVER_VALIDITY_Y);
      date.add(Calendar.HOUR_OF_DAY, -1);
      serverCert.setValidNotAfter(date.getTime());
      serverCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate());
 -    log.debug("Successfully signed server certificate");
 +
 +    log.debug("successfully generated MOCCA TLS Server certificate " + serverCert.getSubjectDN());
      caKeyPair = null;
    }
 -  public KeyStore generateKeyStore(char[] password) {
 -    try {
 -      generateCA();
 +  public KeyStore generateKeyStore(char[] password) throws GeneralSecurityException, IOException, CodingException {
 +//    try {
 +      generateCACert();
        generateServerCert();
        KeyStore ks = KeyStore.getInstance("JKS");
        ks.load(null, null);
        ks.setKeyEntry("server", serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert});
        return ks;
 -    } catch (Exception e) {
 -      log.error("Cannot generate certificate", e);
 -    }
 -    return null;
 +//    } catch (Exception e) {
 +//      log.error("Cannot generate certificate", e);
 +//    }
 +//    return null;
    }
  }
 diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java index 4679eac5..9990b2a0 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java @@ -36,6 +36,9 @@ import org.apache.commons.logging.Log;  import org.apache.commons.logging.LogFactory;  public class TrayIconDialog implements TrayIconDialogInterface { +  public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/ui/trayicon.png"; +  public static final String TRAYMENU_SHUTDOWN = "TrayMenu.Shutdown"; +  public static final String TRAYMENU_TOOLTIP = "TrayMenu.Tooltip";    private static Log log = LogFactory.getLog(TrayIconDialog.class);    private static TrayIconDialogInterface instance; @@ -107,10 +110,10 @@ public class TrayIconDialog implements TrayIconDialogInterface {        if (isSupported) {          SystemTray tray = SystemTray.getSystemTray();          Image image = ImageIO.read(getClass().getClassLoader() -            .getResourceAsStream("at/gv/egiz/bku/webstart/ui/logo.png")); +            .getResourceAsStream(TRAYICON_RESOURCE));          PopupMenu popup = new PopupMenu();          MenuItem exitItem = new MenuItem(resourceBundel -            .getString("TrayMenu.Shutdown")); +            .getString(TRAYMENU_SHUTDOWN));          popup.add(exitItem);          exitItem.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) { @@ -123,7 +126,7 @@ public class TrayIconDialog implements TrayIconDialogInterface {          trayIcon = new TrayIcon(image, "BKULogo", popup);          trayIcon.setImageAutoSize(true); -        trayIcon.setToolTip(resourceBundel.getString("TrayMenu.Tooltip")); +        trayIcon.setToolTip(resourceBundel.getString(TRAYMENU_TOOLTIP));          try {            tray.add(trayIcon);          } catch (AWTException e) { diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo.png b/BKUWebStart/src/main/jnlp/resources/img/logo.pngBinary files differ new file mode 100644 index 00000000..2c622d88 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/img/logo.png diff --git a/BKUWebStart/src/main/resources/logo.png b/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.pngBinary files differ index fa6d7f96..fa6d7f96 100644 --- a/BKUWebStart/src/main/resources/logo.png +++ b/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png b/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.pngBinary files differ new file mode 100644 index 00000000..d7f8bbd0 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png diff --git a/BKUWebStart/src/main/resources/splash.png b/BKUWebStart/src/main/jnlp/resources/img/splash.pngBinary files differ index 72c1d868..72c1d868 100644 --- a/BKUWebStart/src/main/resources/splash.png +++ b/BKUWebStart/src/main/jnlp/resources/img/splash.png diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml new file mode 100644 index 00000000..715b6722 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jnlp-versions> +  <resource> +    <pattern> +      <name>logo.png</name> +      <version-id>1.0-SNAPSHOT</version-id> +    </pattern> +    <file>logo.png</file> +  </resource> +  <resource> +    <pattern> +      <name>splash.png</name> +      <version-id>1.0-SNAPSHOT</version-id> +    </pattern> +    <file>splash.png</file> +  </resource> +</jnlp-versions> diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml new file mode 100644 index 00000000..a5b10b47 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jnlp-versions> +  <resource> +    <pattern> +      <name>BKUWebStart-1.0.3-SNAPSHOT.jar</name> +      <version-id>1.0.3-SNAPSHOT</version-id> +    </pattern> +    <file>BKUWebStart-1.0.3-SNAPSHOT.jar</file> +  </resource> + +  <resource> +    <pattern> +      <name>commons-logging-1.0.4.jar</name> +      <version-id>1.0.4</version-id> +    </pattern> +    <file>commons-logging-1.0.4.jar</file> +  </resource> +  <!--resource> +    <pattern> +      <name>commons-fileupload-1.2.1.jar</name> +      <version-id>1.2.1</version-id> +    </pattern> +    <file>commons-fileupload-1.2.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>commons-httpclient-3.1.jar</name> +      <version-id>3.1</version-id> +    </pattern> +    <file>commons-httpclient-3.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>commons-codec-1.2.jar</name> +      <version-id>1.2</version-id> +    </pattern> +    <file>commons-codec-1.2.jar</file> +  </resource--> + +  <resource> +    <pattern> +      <name>activation-1.1.jar</name> +      <version-id>1.1</version-id> +    </pattern> +    <file>activation-1.1.jar</file> +  </resource> + +  <resource> +    <pattern> +      <name>log4j-1.2.12.jar</name> +      <version-id>1.2.12</version-id> +    </pattern> +    <file>log4j-1.2.12.jar</file> +  </resource> + +  <resource> +    <pattern> +      <name>iaik_ecc_signed-2.15.jar</name> +      <version-id>2.15</version-id> +    </pattern> +    <file>iaik_ecc_signed-2.15.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>iaik_jce_full_signed-3.16.jar</name> +      <version-id>3.16</version-id> +    </pattern> +    <file>iaik_jce_full_signed-3.16.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>iaik_xsect-1.14.jar</name> +      <version-id>1.14</version-id> +    </pattern> +    <file>iaik_xsect-1.14.jar</file> +  </resource> +  <!--resource> +    <pattern> +      <name>iaik_pki-1.0-MOCCA.jar</name> +      <version-id>1.0-MOCCA</version-id> +    </pattern> +    <file>iaik_pki-1.0-MOCCA.jar</file> +  </resource--> + +  <resource> +    <pattern> +      <name>jetty-6.1.15.jar</name> +      <version-id>6.1.15</version-id> +    </pattern> +    <file>jetty-6.1.15.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>jetty-util-6.1.15.jar</name> +      <version-id>6.1.15</version-id> +    </pattern> +    <file>jetty-util-6.1.15.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>servlet-api-2.5-20081211.jar</name> +      <version-id>2.5-20081211</version-id> +    </pattern> +    <file>servlet-api-2.5-20081211.jar</file> +  </resource> + +  <resource> +    <pattern> +      <name>jaxb-api-2.1.jar</name> +      <version-id>2.1</version-id> +    </pattern> +    <file>jaxb-api-2.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>jaxb-impl-2.1.9.jar</name> +      <version-id>2.1.9</version-id> +    </pattern> +    <file>jaxb-impl-2.1.9.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>stax-api-1.0-2.jar</name> +      <version-id>1.0-2</version-id> +    </pattern> +    <file>stax-api-1.0-2.jar</file> +  </resource> +  <!--resource> +    <pattern> +      <name>xalan-2.7.1.jar</name> +      <version-id>2.7.1</version-id> +    </pattern> +    <file>xalan-2.7.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>serializer-2.7.1.jar</name> +      <version-id>2.7.1</version-id> +    </pattern> +    <file>serializer-2.7.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>xercesImpl-2.9.1.jar</name> +      <version-id>2.9.1</version-id> +    </pattern> +    <file>xercesImpl-2.9.1.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>xml-apis-1.3.04.jar</name> +      <version-id>1.3.04</version-id> +    </pattern> +    <file>xml-apis-1.3.04.jar</file> +  </resource--> + +  <resource> +    <pattern> +      <name>utils-1.1.2-SNAPSHOT.jar</name> +      <version-id>1.1.2-SNAPSHOT</version-id> +    </pattern> +    <file>utils-1.1.2-SNAPSHOT.jar</file> +  </resource> +  <!--resource> +    <pattern> +      <name>bkucommon-1.1.2-SNAPSHOT.jar</name> +      <version-id>1.1.2-SNAPSHOT</version-id> +    </pattern> +    <file>bkucommon-1.1.2-SNAPSHOT.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>STALExt-1.1.2-SNAPSHOT.jar</name> +      <version-id>1.1.2-SNAPSHOT</version-id> +    </pattern> +    <file>STALExt-1.1.2-SNAPSHOT.jar</file> +  </resource> +  <resource> +    <pattern> +      <name>STAL-1.1.2-SNAPSHOT.jar</name> +      <version-id>1.1.2-SNAPSHOT</version-id> +    </pattern> +    <file>STAL-1.1.2-SNAPSHOT.jar</file> +  </resource--> +   +</jnlp-versions> diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 0a89a036..a355da77 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -1,15 +1,20 @@  <?xml version="1.0" encoding="utf-8"?> -<jnlp spec="$jnlpspec" codebase="$project.Url" href="$outputFile"> +<!-- + jnlp spec="$jnlpspec" codebase="$project.Url" href="$outputFile"> +--> +<jnlp spec="$jnlpspec" codebase="$$codebase" context="$$context" href="$$name"> +    <information>      <title>$project.Name</title>      <vendor>$project.Organization.Name</vendor>      <homepage href="$project.Url"/>      <description>$project.Description</description> -    <icon href="lib/splash.png" kind="splash"/> -    <icon href="lib/logo.png" kind="default"/> +    <description kind="short">$project.Description</description> +    <icon href="img/logo.png" kind="default" version="1.0-SNAPSHOT"/> +    <icon href="img/splash.png" kind="splash" version="1.0-SNAPSHOT"/>      <shortcut online="false">        <desktop/> -      <menu submenu="MOCCA"/> +      <menu submenu="e-Government"/>      </shortcut>  #if($offlineAllowed) diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.pngBinary files differ deleted file mode 100644 index 598ab00b..00000000 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png +++ /dev/null diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.pngBinary files differ new file mode 100644 index 00000000..2c622d88 --- /dev/null +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png @@ -1,118 +1,123 @@  <?xml version="1.0" encoding="UTF-8"?>  <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/maven-v4_0_0.xsd"> -	<modelVersion>4.0.0</modelVersion> -	<groupId>at.gv.egiz</groupId> -	<artifactId>bku</artifactId> -	<packaging>pom</packaging> -	<version>1.1.2-SNAPSHOT</version> -	<name>BKU</name> -	<url>http://bku.egiz.gv.at</url> -	<modules> -		<module>utils</module> -		<module>bkucommon</module> -		<module>STAL</module> -		<module>BKUOnline</module> -		<module>smcc</module> -		<module>BKULocal</module> -		<module>BKUApplet</module> -		<module>smccSTAL</module> -		<module>STALService</module> -		<module>BKUCommonGUI</module> -		<module>BKUViewer</module> -		<module>STALExt</module> +  <modelVersion>4.0.0</modelVersion> +  <groupId>at.gv.egiz</groupId> +  <artifactId>bku</artifactId> +  <packaging>pom</packaging> +  <version>1.1.2-SNAPSHOT</version> +  <name>BKU</name> +  <url>http://bku.egiz.gv.at</url> +  <modules> +    <module>utils</module> +    <module>bkucommon</module> +    <module>STAL</module> +    <module>BKUOnline</module> +    <module>smcc</module> +    <module>BKULocal</module> +    <module>BKUApplet</module> +    <module>smccSTAL</module> +    <module>STALService</module> +    <module>BKUCommonGUI</module> +    <module>BKUViewer</module> +    <module>STALExt</module>      <module>STALXService</module>      <module>BKUAppletExt</module>      <module>BKUWebStart</module>    </modules> -	<developers> -		<developer> -			<id>mcentner</id> -			<name>Martin Centner</name> -			<email>mcentner@egiz.gv.at</email> -		</developer> -		<developer> -			<id>wbauer</id> -			<name>Wolfgang Bauer</name> -			<email>wbauer@egiz.gv.at</email> -		</developer> -		<developer> -			<id>corthacker</id> -			<name>Clemens Orthacker</name> -			<email>corthacker@egiz.gv.at</email> -		</developer> -	</developers> -	<scm> -		<connection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk</connection> -		<developerConnection>scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/trunk</developerConnection> -		<url>svn://svn.egovlabs.gv.at/svnroot/mocca/trunk</url> -	</scm> -	<organization> -		<name>E-Government Innovation Center (EGIZ)</name> -		<url>http://www.egiz.gv.at</url> -	</organization> -	<build> -		<pluginManagement> -			<plugins> -				<plugin> -					<artifactId>maven-compiler-plugin</artifactId> -					<groupId>org.apache.maven.plugins</groupId> -					<version>2.0.2</version> -					<configuration> +  <developers> +    <developer> +      <id>mcentner</id> +      <name>Martin Centner</name> +      <email>mcentner@egiz.gv.at</email> +    </developer> +    <developer> +      <id>wbauer</id> +      <name>Wolfgang Bauer</name> +      <email>wbauer@egiz.gv.at</email> +    </developer> +    <developer> +      <id>corthacker</id> +      <name>Clemens Orthacker</name> +      <email>corthacker@egiz.gv.at</email> +    </developer> +  </developers> +  <scm> +    <connection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk</connection> +    <developerConnection>scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/trunk</developerConnection> +    <url>svn://svn.egovlabs.gv.at/svnroot/mocca/trunk</url> +  </scm> +  <organization> +    <name>E-Government Innovation Center (EGIZ)</name> +    <url>http://www.egiz.gv.at</url> +  </organization> +  <build> +    <pluginManagement> +      <plugins> +        <plugin> +          <artifactId>maven-compiler-plugin</artifactId> +          <groupId>org.apache.maven.plugins</groupId> +          <version>2.0.2</version> +          <configuration>  						<!--  							fork>true</fork> <executable>${java_6_sun}/bin/javac</executable>  							<compilerVersion>1.6</compilerVersion --> -						<source>1.6</source> -						<target>1.6</target> -						<verbose>true</verbose> -						<showWarnings>true</showWarnings> -						<encoding>UTF-8</encoding> -					</configuration> -				</plugin> -				<plugin> -					<artifactId>maven-resources-plugin</artifactId> -					<configuration> -						<encoding>UTF-8</encoding> -					</configuration> -				</plugin> -				<plugin> -					<artifactId>maven-assembly-plugin</artifactId> -					<groupId>org.apache.maven.plugins</groupId> -					<version>2.2-beta-2</version> -				</plugin> -				<plugin> -					<artifactId>maven-dependency-plugin</artifactId> -					<groupId>org.apache.maven.plugins</groupId> -					<version>2.0</version> -				</plugin> +            <source>1.6</source> +            <target>1.6</target> +            <verbose>true</verbose> +            <showWarnings>true</showWarnings> +            <encoding>UTF-8</encoding> +          </configuration> +        </plugin> +        <plugin> +          <artifactId>maven-resources-plugin</artifactId> +          <configuration> +            <encoding>UTF-8</encoding> +          </configuration> +        </plugin> +        <plugin> +          <artifactId>maven-assembly-plugin</artifactId> +          <groupId>org.apache.maven.plugins</groupId> +          <version>2.2-beta-2</version> +        </plugin> +        <plugin> +          <artifactId>maven-dependency-plugin</artifactId> +          <groupId>org.apache.maven.plugins</groupId> +          <version>2.0</version> +        </plugin>  				<!--  					plugin> <artifactId>maven-jaxb2-plugin</artifactId>  					<groupId>org.jvnet.jaxb2.maven2</groupId> <version>0.6.0</version>  					</plugin --> -				<plugin> -					<artifactId>jaxws-maven-plugin</artifactId> -					<groupId>org.codehaus.mojo</groupId> -					<version>1.10</version> -				</plugin> -				<plugin> -					<groupId>org.apache.maven.plugins</groupId> -					<artifactId>maven-release-plugin</artifactId> -					<version>2.0-beta-7</version> -				</plugin> -			</plugins> -		</pluginManagement> -		<plugins> -			<plugin> -				<artifactId>maven-assembly-plugin</artifactId> -				<configuration> -					<descriptors> -						<descriptor>${basedir}/src/main/assemblies/assembly-test.xml</descriptor> +        <plugin> +          <artifactId>jaxws-maven-plugin</artifactId> +          <groupId>org.codehaus.mojo</groupId> +          <version>1.10</version> +        </plugin> +        <plugin> +          <groupId>org.apache.maven.plugins</groupId> +          <artifactId>maven-release-plugin</artifactId> +          <version>2.0-beta-7</version> +        </plugin> +        <plugin> +          <groupId>org.codehaus.mojo</groupId> +          <artifactId>maven-buildnumber-plugin</artifactId> +          <version>0.9.6</version> +        </plugin> +      </plugins> +    </pluginManagement> +    <plugins> +      <plugin> +        <artifactId>maven-assembly-plugin</artifactId> +        <configuration> +          <descriptors> +            <descriptor>${basedir}/src/main/assemblies/assembly-test.xml</descriptor>  						<!--  							descriptor>${basedir}/src/main/assemblies/assembly-online.xml</descriptor>  							<descriptor>${basedir}/src/main/assemblies/assembly-local.xml</descriptor>  							<descriptor>${basedir}/src/main/assemblies/assembly-server.xml</descriptor --> -					</descriptors> -				</configuration> +          </descriptors> +        </configuration>  				<!--  					don't include execution here, but explicitly in the execute command  					(see custom goals: mvn clean package assembly:assembly) | NOTE: @@ -122,123 +127,123 @@  					invocation, to ensure all modules have been built. <executions>  					<execution> <phase>package</phase> <goals> <goal>attached</goal>  					</goals> </execution> </executions --> -			</plugin> -		</plugins> -	</build> -	<repositories> -		<repository> -			<id>mocca-egovlabs</id> -			<name>MOCCA EGovLabs</name> -			<url>http://mocca.egovlabs.gv.at/m2/repository/</url> -		</repository> -		<repository> -			<id>maven2-repository.dev.java.net</id> -			<name>Java.net Repository for Maven 2</name> -			<url>http://download.java.net/maven/2/</url> -		</repository> -		<repository> -			<id>maven1-repository.dev.java.net</id> -			<name>Java.net Repository for Maven 1</name> -			<url>http://download.java.net/maven/1/</url> -			<layout>legacy</layout> -		</repository> -	</repositories> -	<dependencies> -		<dependency> -			<groupId>log4j</groupId> -			<artifactId>log4j</artifactId> -			<scope>runtime</scope> -		</dependency> -		<dependency> -			<groupId>junit</groupId> -			<artifactId>junit</artifactId> -			<scope>test</scope> -		</dependency> -	</dependencies> -	<dependencyManagement> -		<dependencies> -			<dependency> -				<groupId>log4j</groupId> -				<artifactId>log4j</artifactId> -				<version>1.2.12</version> -				<scope>runtime</scope> -			</dependency> -			<dependency> -				<groupId>commons-logging</groupId> -				<artifactId>commons-logging</artifactId> -				<version>1.1.1</version> -				<scope>compile</scope> -			</dependency> -			<dependency> -				<groupId>junit</groupId> -				<artifactId>junit</artifactId> -				<version>4.4</version> -				<scope>test</scope> -			</dependency> -			<dependency> -				<groupId>xerces</groupId> -				<artifactId>xercesImpl</artifactId> -				<version>2.9.1</version> -			</dependency> -			<dependency> -				<groupId>xalan</groupId> -				<artifactId>xalan</artifactId> -				<version>2.7.1</version> -			</dependency> -			<dependency> -				<groupId>iaik</groupId> -				<artifactId>iaik_jce_full_signed</artifactId> -				<version>3.16</version> -				<scope>compile</scope> -			</dependency> -			<dependency> -				<groupId>iaik</groupId> -				<artifactId>iaik_jce_me4se</artifactId> -				<version>3.04</version> -			</dependency> -			<dependency> -				<groupId>iaik</groupId> -				<artifactId>iaik_ecc_signed</artifactId> -				<version>2.15</version> -			</dependency> -			<dependency> -				<groupId>iaik</groupId> -				<artifactId>iaik_xsect</artifactId> -				<version>1.14</version> -			</dependency> -			<dependency> -				<groupId>iaik</groupId> -				<artifactId>iaik_pki</artifactId> -				<version>1.0-MOCCA</version> -				<scope>compile</scope> -			</dependency> -			<dependency> -				<groupId>commons-fileupload</groupId> -				<artifactId>commons-fileupload</artifactId> -				<version>1.2.1</version> -				<scope>compile</scope> -			</dependency> -			<dependency> -				<groupId>commons-httpclient</groupId> -				<artifactId>commons-httpclient</artifactId> -				<version>3.1</version> -				<scope>compile</scope> -			</dependency> -			<dependency> -				<groupId>org.springframework</groupId> -				<artifactId>spring-core</artifactId> -				<version>2.5.5</version> -			</dependency> -			<dependency> -				<groupId>org.springframework</groupId> -				<artifactId>spring-context</artifactId> -				<version>2.5.5</version> -			</dependency> -            <dependency> -                <groupId>com.sun.xml.bind</groupId> -                <artifactId>jaxb-impl</artifactId> -                <version>2.1.9</version> -            </dependency> -		</dependencies> -	</dependencyManagement> +      </plugin> +    </plugins> +  </build> +  <repositories> +    <repository> +      <id>mocca-egovlabs</id> +      <name>MOCCA EGovLabs</name> +      <url>http://mocca.egovlabs.gv.at/m2/repository/</url> +    </repository> +    <repository> +      <id>maven2-repository.dev.java.net</id> +      <name>Java.net Repository for Maven 2</name> +      <url>http://download.java.net/maven/2/</url> +    </repository> +    <repository> +      <id>maven1-repository.dev.java.net</id> +      <name>Java.net Repository for Maven 1</name> +      <url>http://download.java.net/maven/1/</url> +      <layout>legacy</layout> +    </repository> +  </repositories> +  <dependencies> +    <dependency> +      <groupId>log4j</groupId> +      <artifactId>log4j</artifactId> +      <scope>runtime</scope> +    </dependency> +    <dependency> +      <groupId>junit</groupId> +      <artifactId>junit</artifactId> +      <scope>test</scope> +    </dependency> +  </dependencies> +  <dependencyManagement> +    <dependencies> +      <dependency> +        <groupId>log4j</groupId> +        <artifactId>log4j</artifactId> +        <version>1.2.12</version> +        <scope>runtime</scope> +      </dependency> +      <dependency> +        <groupId>commons-logging</groupId> +        <artifactId>commons-logging</artifactId> +        <version>1.1.1</version> +        <scope>compile</scope> +      </dependency> +      <dependency> +        <groupId>junit</groupId> +        <artifactId>junit</artifactId> +        <version>4.4</version> +        <scope>test</scope> +      </dependency> +      <dependency> +        <groupId>xerces</groupId> +        <artifactId>xercesImpl</artifactId> +        <version>2.9.1</version> +      </dependency> +      <dependency> +        <groupId>xalan</groupId> +        <artifactId>xalan</artifactId> +        <version>2.7.1</version> +      </dependency> +      <dependency> +        <groupId>iaik</groupId> +        <artifactId>iaik_jce_full_signed</artifactId> +        <version>3.16</version> +        <scope>compile</scope> +      </dependency> +      <dependency> +        <groupId>iaik</groupId> +        <artifactId>iaik_jce_me4se</artifactId> +        <version>3.04</version> +      </dependency> +      <dependency> +        <groupId>iaik</groupId> +        <artifactId>iaik_ecc_signed</artifactId> +        <version>2.15</version> +      </dependency> +      <dependency> +        <groupId>iaik</groupId> +        <artifactId>iaik_xsect</artifactId> +        <version>1.14</version> +      </dependency> +      <dependency> +        <groupId>iaik</groupId> +        <artifactId>iaik_pki</artifactId> +        <version>1.0-MOCCA</version> +        <scope>compile</scope> +      </dependency> +      <dependency> +        <groupId>commons-fileupload</groupId> +        <artifactId>commons-fileupload</artifactId> +        <version>1.2.1</version> +        <scope>compile</scope> +      </dependency> +      <dependency> +        <groupId>commons-httpclient</groupId> +        <artifactId>commons-httpclient</artifactId> +        <version>3.1</version> +        <scope>compile</scope> +      </dependency> +      <dependency> +        <groupId>org.springframework</groupId> +        <artifactId>spring-core</artifactId> +        <version>2.5.5</version> +      </dependency> +      <dependency> +        <groupId>org.springframework</groupId> +        <artifactId>spring-context</artifactId> +        <version>2.5.5</version> +      </dependency> +      <dependency> +        <groupId>com.sun.xml.bind</groupId> +        <artifactId>jaxb-impl</artifactId> +        <version>2.1.9</version> +      </dependency> +    </dependencies> +  </dependencyManagement>  </project> | 
