Maven-webstart-plugin to enable runtime dependencies

When creating jnlp with the maven-webstart plugin, I found that runtime dependencies are not included in jnlp.

I use 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 to enable 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 do not want to forget to change this every time I add runtime dependency to my project.

Is there a way to instruct the plugin to include all dependencies at runtime?

+6
source share
2 answers

So, it turns out that by default all compilation and execution dependencies should be included.

What's happening?

Well, I also use ant to deploy jnlp on the server, and in ant, the $dependencies file is installed using mvn:dependencies if the scope is not specified as a runtime. Thus, adding a scope changes the set of $dependencies files that is included in the jnlp file.

+1
source

I am using the pom parent configuration, where one of the modules is a web launch project. I like to keep it as small as possible. I can only compile dependencies with the logging library, the main application module (another module in the same parent pom structure) and jar files, including my own binaries. In addition to these compilation dependencies, I have some test dependencies and a system dependency on the local javaws.jar file.

It seems that the maven webstart plugin includes any runtime dependencies on the modules that are included in the web launch project as a compilation dependency. You may have decided to split your project in a similar way.

Regarding internal binaries. I had to modify the speed pattern a bit to get these dependencies as nativelib instead of jar resources.

0
source

Source: https://habr.com/ru/post/896291/


All Articles