If you plan to deploy your maven application via webstart you are a lucky man, because this is easy if you know how to do it 😉
I tried it without success, but then Geoffrey with his networktools came to my rescue. Now TimeFinder is jnlp-enabled. The following steps were necessary:
- create a new folder ‘jnlp’ under src/ (where main and test live)
- put the file template.vm there with:
<?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://timefinder.sourceforge.net/jnlp2" href="$outputFile"> <information> <title>TimeFinder</title> <vendor>TimeFinder Team</vendor> <homepage href="http://timefinder.sourceforge.net/"/> <description kind="one-line">TimeFinder</description> <description kind="short">TimeFinder - the automatic timetabling generator for universities and schools</description> <description kind="tooltip">TimeFinder - the automatic timetabling generator for universities and schools</description> <icon href="http://timefinder.sourceforge.net/jnlp/shamrockwhite.jpg" kind="default"/> <shortcut online="false"><desktop/><menu submenu="TimeFiner"/></shortcut> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+" initial-heap-size="32m" max-heap-size="128m" /> <property name="jnlp.versionEnabled" value="true"/> $dependencies </resources> <application-desc main-class="$mainClass"> </application-desc> </jnlp>
- create a keystore:
keytool -genkey -alias timefinder -keystore timefinder.jks
be sure that you use keytool from the same JDK-PATH as you use for maven! - add the following to your pom.xml:
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>webstart-maven-plugin</artifactId> <version>1.0-alpha-1</version> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>webstart-maven-plugin</artifactId> <!-- do not bind to install phase <executions> <execution> <goals> <goal>report</goal> </goals> </execution> </executions> --> <configuration> <jnlp> <mainClass>de.timefinder.core.Startup</mainClass> </jnlp> <sign> <keystore>/home/peterk/Dokumente/quell/timefinder/trunk/timefinder-core/timefinder.jks</keystore> <keypass>unsecpwd</keypass> <storepass>unsecpwd</storepass> <storetype>jks</storetype> <alias>timefinder</alias> <verify>true</verify> </sign> <verbose>true</verbose> </configuration> </plugin> </plugins> </pluginManagement> </build> </project>
- Now you should be able to execute:
mvn install webstart:jnlp
which will create a zip file with all the signed jars - See my next post for versioning and pack200!
mvn install webstart:jnlp — gave me a horrible error, simply running it again made it work!
Oh my god! When migratin to alpha-2, BE WARE OF THIS: http://jira.codehaus.org/browse/MWEBSTART-109
And no: It’s not mentioned anywhere. Had cost me 2 hours.
Keywords: maven webstart wrong plugin version
Pingback: Further with Maven and WebStart (jnlp) « Java and more …
@max: Thanks for sharing this!
Is there some reason you used the older 1.0-alpha-1 version rather than the newer 1.0-alpha-2 version of the plugin?
Because 1.0-alpha-1 worked 🙂
What are the reasons for 1.0-alpha-2?
Bug fixes.
And from which repository I can get this version? I cannot find it … although the website indicates that 1.0-alpha-2 should be available since 2007 !?
http://repository.codehaus.org/org/codehaus/mojo/webstart/webstart-maven-plugin/1.0-alpha-2/