1

如何使用 Maven 的 Netbeans 模块插件将自动更新站点创建为工件?

我可以看到自动更新站点的文件是在 target/ 目录中生成的,但我不知道如何将它变成一个工件。

我的最终目的是将它嵌入到一个战争中以便于安装(我将使用依赖插件来解压那里的工件)。

4

2 回答 2

2

我不是专家,但生成 webstart 应用程序不是处理此问题的“经典”方式吗?从文档中:

nbm-aplication 项目/打包定义了一个构建生命周期,该生命周期从本地/远程存储库中的 nbm 文件创建最终应用程序,并将它们捆绑在一个 zip 文件中(也可上传到存储库)除此之外,您可以配置项目以生成应用程序的自动更新站点和/或 webstartable 二进制文件。

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

有关更多详细信息,请参阅autoupdatewebstart-app 目标。


但是这个插件不会从它生成的文件中创建一个工件,这是我的问题......因为我需要在我的“战争”项目的构建过程中将它解压缩到不同的地方。

在这种情况下,我会使用Maven 程序集插件来创建生成的文件(zip、tar.gz 等)的分发,并在构建期间将其安装到本地存储库中。然后,您可以使用dependency:unpack.

于 2010-06-30T16:00:27.610 回答
0

nbm 插件中的更新站点目标适用于“pom”打包项目,然后从反应堆的项目创建更新站点。它不会生成工件,因为 pom 项目不能附加工件。

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.

于 2010-07-05T13:09:49.517 回答