gpt4 book ai didi

deployment - 使用 maven-release-plugin 部署程序集包

转载 作者:行者123 更新时间:2023-12-03 11:20:00 26 4
gpt4 key购买 nike

我们使用 Hudson 和 maven-release-plugin进行发布构建。现在我有一个项目,其中包含 assembly它将所有需要的组件放在一起,然后将它们打包到具有所需目录结构的 .tar.gz 包中。

现在我正在尝试让 release-plugin 在 release:perform 目标期间将此包部署到我们的 Maven 存储库,但只部署了标准的东西(源代码、javadoc、POM)。

我已经将组装目标绑定(bind)到 maven 包阶段,并且 .tar.gz 在发布期间得到构建,但没有上传到存储库。任何提示我在这里做错了什么?

这是程序集插件配置:

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-4</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
<finalName>${pom.artifactId}-${pom.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<tarLongFileMode>warn</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>dist-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>

我运行构建版本的命令是
mvn release:prepare release:perform release:clean

最佳答案

同时,我找到了两种做我想做的事的方法。

maven-build-helper-plugin 允许将其他条目添加到应部署的工件列表中:

    <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-distribution</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${pom.artifactId}-${pom.version}.tar.gz</file>
<type>tar.gz</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>

另一个非常简单,maven-user 邮件列表中的某个人指出了这一点。简单地使用组装:单一目标而不是组装:组装。这样,在部署阶段生成的工件就会上传到存储库。
    <execution>
<id>dist-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal> <!-- that's all :) -->
</goals>
</execution>

关于deployment - 使用 maven-release-plugin 部署程序集包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2244344/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com