I am looking for source code for a complete application that uses the Webstart Maven Plugin.
Any ideas?
I am looking for source code for a complete application that uses the Webstart Maven Plugin.
Any ideas?
A few notes on this plugin (it's documentation is horrible):
It won't use the template.vm file unless you specify it, like
<templateFilename>roll-gen-template.vm</templateFilename>
For creating a war:
If you want to use the JnlpDownloadServlet (the standard one java provides) to serve up the files instead of the above code (and have the plugin generate a working version.xml file for it to use, etc.), basically you need to create a new project of type war and target the jnlp-download-servlet goal
(it doesn't seem to support creating a war with classes from the current pom project) then, instead of a single <jnlp>
section, you'll have the <jnlpFiles>
section instead, which can list multiple jar dependencies. You may need to modify your web.xml file as well.
http://www.mojohaus.org/webstart/webstart-maven-plugin/jnlp-mojos-overview.html has an example pom for
If you have additional comments feel free to edit this, it is a community wiki.
I tried the webstart plugin in a prrof of concept involving an embedded tomcat server. The plugin is bound to the package phase and takes a longtime to execute, I would recommend to invoke it manually from the command line. It generates a zip file in the target directory containing the jnlp file and all dependencies. This file can then be extraced and put on a webserver. The url in the pom should point to this path on the server. When started, the app runs a tomcat server on localhost port 8080 with a simple servlet that just returns the requested path as a string.
Let me know if this works for you.
Here is the pom of the project, the plugin configuration was mostly copied from the documentation here
Here is a custom template for the jnlp file placed at
src/main/jnlp/template.vm
, I can't remember why I needed that exactly:This is the main class at
src/main/java/net/jhorstmann/embeddedtomcat7/App.java
And finally a servlet at
src/main/java/net/jhorstmann/embeddedtomcat7/TestServlet.java