How to use the Maven's Netbeans Module plugin to create an autoupdate site as an artifact ?
I can see the files of the auto-update site been generated 开发者_高级运维in the target/ directory, but I have no idea how to turn it into an artifact.
My final purpose is to have it embedded into a war for an easier installation (I will use the dependency plugin to unpack the artifact there).
I'm not an expert but isn't generating a webstart app the "classic" way to handle this? From the documentation:
The nbm-aplication project/packaging defines a build lifecycle that creates a final application from the nbm files in local/remote repotories and bundles them in a zip file (also uploadable to the repository) In addition to that you can configure the project to generate an autoupdate site and/or a webstartable binaries of the applications.
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>nbm-maven-plugin</artifactId> <executions> <execution> <id>extra</id> <phase>package</phase> <goals> <goal>autoupdate</goal> <goal>webstart-app</goal> </goals> <configuration> <!--distBase>central::default::http://repo1.maven.org/maven2</distBase--> <codebase>${project.build.directory}/webstart/milos</codebase> </configuration> </execution> </executions> </plugin>
See the autoupdate and webstart-app goals for more details.
but this plugin doesn't create an artifact out of the files it generates, and that's my problem... because I need it to be unpacked in a different place during the build of my "war" project.
In that case, I'd use the Maven Assembly Plugin to create a distribution of the generated files (zip, tar.gz, whatever) and get it installed in your local repository during the build. You could then unpack the archive from the war project using dependency:unpack
.
the update site goal in nbm plugin works on "pom" packaged projects and then creates the update site from the projects from reactor. It doesn't generate an artifact as pom projects can't have attached artifacts.
then it also works on nbm-application projects where it takes the project's dependencies and creates update site from it. Then the update site gzip is attached to the main artifact (which is the application zip file but it's creation can be suppressed by a parameter I think). if you combine this usecase with nbm distribution url parameter pointing to your release repository, you basically the the release repository equals your deployment update site and your update sites versioned. Obviously in the running application you need a stable url, so you will need to somehow (manually, after testing) symlink the current update site with that one public url.
精彩评论