从jenkins/maven build发布SNAPSHOT到nexus

osc*_*020 7 maven-2 nexus maven jenkins

我正在尝试将构建jenkins/maven的结果发布到Nexus存储库.

构建是战争SNAPSHOT,这是POM的开始:

<http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.elis</groupIenter code hered>
<artifactId>accueil_ce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>accueil_ce</name>
Run Code Online (Sandbox Code Playgroud)

我使用干净安装 maven目标进行构建.

我已经为jenkins 安装并配置了Nexus Repository Manager Publisher插件,因此它可以在后期构建步骤中发布到我的nexus Repo.

问题是 :

  • 如果我在Nexus中将repo配置为'snapshot'和'allow redeploy',那么当配置作业的After build步骤'Nexus Repository Manager Publisher'时,它不会出现在Jenkins中可用的repos列表中.

  • 如果我在Nexus中将repos配置为'release'和'allow redeploy',那么在运行jenkins作业时出现以下错误:

    java.io.IOException:com.sonatype.nexus.api.exception.RepositoryManagerException:无法上传组件:错误请求版本0.0.1-SNAPSHOT与存储库策略不匹配!

我不明白,有没有办法用这个插件从jenkins build发布SNAPSHOT到nexus?