When building a jnlp with the maven-webstart-plugin, I found that the runtime dependencies weren't being included in the jnlp.
I'm using a template like this:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="$jnlpspec" codebase="${url}/${appName}" href="${outputFile}">
<information>
<title>${appName}</title>
<vendor>$project.Organization.Name</vendor>
<homepage href="${url}/${appName}"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="$j2seVersion"/>
$dependencies
</resources>
<application-desc main-class="${main}" />
</jnlp>
How can I include the runtime dependencies? Well, I can include them all individually:
<plugin>
<groupId>org.codehaus.mojo.webstart</groupId>
<artifactId>webstart-maven-plugin</artifactId>
<configuration>
<dependencies>
<includes>
<include>groupId:artifactId</include>
...
</includes>
</dependencies>
...
</configuration>
</plugin>
...but ideally, I don't want to have to remember to change this every time I add a runtime dependency to my project.
Is there a way to instruct the plugin to include all runtime dependencies?
So it turns out that the default is to include all compile and runtime dependencies.
What was going on?
Well, I'm also using ant to deploy the jnlp onto a server, and in the ant file, $dependencies
was being set using mvn:dependencies
without the scope being specified as runtime. So adding the scope changes the $dependencies
fileset which is incorporated into the jnlp file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With