我无法发布使用maven到nexus构建的工件的快照版本。我的工件版本声明1.0.0-SNAPSHOT。
我可以毫无问题地执行mvn clean install
。但是当我尝试使用mvn deploy
进行部署时,出现以下错误:
Return code is: 400, ReasonPhrase: Repository version policy: RELEASE does not allow version: 1.0.0-20161019.214318-1. -> [Help 1]
根据我能够发现的是,maven3在我要部署的工件上添加了时间戳而不是SNAPSHOT后缀。 maven3不支持maven的<uniqueVersion>
标记。使用mvn deploy
命令部署这些工件需要采取什么方法。
更新: 的pom.xml
<distributionManagement>
<repository>
<id>my-nexus-snapshots</id>
<name>Internal Snapshot Releases</name>
<url>http://localhost:9999/repository/maven-snapshots/</url>
</repository>
<snapshotRepository>
<id>my-nexus-releases</id>
<name>Internal Releases</name>
<url>http://localhost:9999/repository/maven-releases/</url>
</snapshotRepository>
</distributionManagement>
的settings.xml
<server>
<id>my-nexus-snapshots</id>
<username>user</username>
<password>user123</password>
</server>
<server>
<id>my-nexus-releases</id>
<username>user</username>
<password>user123</password>
</server>
答案 0 :(得分:6)
通常,你的nexus有独立的存储库&#34;快照&#34;和&#34;发布&#34;。 SNAPSHOT版本部署到前者,非SNAPSHOT版本到后者。对于部署,必须由您指定这些存储库。您可以通过将distributionManagement部分添加到您的pom来完成此操作。在那里,您可以为两个目标定义特定目标。
<distributionManagement>
<repository>
<id>releases</id>
<name>releases</name>
<url>http://somerepo:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>snapshots</name>
<url>http://somerepo:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
答案 1 :(得分:0)
如果您使用的是 Gradle ,则可以在存储库设置中完成。
只需添加行家快照网址
例如:
val dec = DecimalFormat("#.###,00")