views:

87

answers:

2

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).

+1  A: 

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&lt;/distBase--&gt;
                <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.

Pascal Thivent
Bonjour Pascal,NetBeans has its own way to handle updates so that module programmers have the possibility to update programmatically and silently. That's how my NetBeans platform application is working, so I don't want to use Webstart, I want to use the auto-update way.I saw the documentation of the nbm plugin already, 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.
Vincent
@Vincent Bonjour :) I wanted to get confirmation before to suggest using the maven assembly plugin. I've updated my answer accordingly.
Pascal Thivent
Thank you for the suggestion.
Vincent
A: 

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.

mkleint