小编hYk*_*hYk的帖子

使用maven 3.0.5将快照发布到nexus

我无法发布使用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]
Run Code Online (Sandbox Code Playgroud)

根据我能够发现的是,maven3在我想要部署的工件上添加了时间戳而不是SNAPSHOT后缀.<uniqueVersion>maven3不支持maven 的标记.使用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>
Run Code Online (Sandbox Code Playgroud)

的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>
Run Code Online (Sandbox Code Playgroud)

nexus maven-3 maven

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

maven ×1

maven-3 ×1

nexus ×1