问题描述
在我的Jenkins仪表板中,我正在使用 maven-release-plugin(v0.16.2)对Nexus存储库执行maven发行。使用此插件时遇到一些问题。
问题1:
如图所示,它使用<project_name>-<release_version>
作为SCM默认标记。但我想将其更改为v<release_version>
值。因此,我在项目pom.xml文件的插件部分中添加了以下更改。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>
但是,它仍然使用上述默认标签。在Jenkins或pom.xml文件中我还需要做其他配置吗?
问题2:
我已经用distributionManagement
部分配置了pom.xml文件,以将构建的构件推送到Nexus存储库,如下所示。
<distributionManagement>
<repository>
<id>releases</id>
<name>Release distribution Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
</distributionManagement>
使用此配置,Jenkins将所有项目构建的工件(在M2中打包JAR工件+依赖XML工件)成功推送到给定的Nexus存储库。但就我而言,我只想将JAR文件部署到Nexus存储库(不包括其他依赖项XML文件)。这个Jenkins Maven版本插件可以解决吗?仅部署特定的文件或目录?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)