解决:Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy)

2020-01-02 11:03:34 浏览数 (1)

1. 执行 mvn clean deploy ... 想把 jar 包更新到私服仓库,报错:

代码语言:javascript复制
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project xxx-xxx-xxx: Deployment failed: repository element 
was not specified in the POM inside distributionManagement element or in -
DaltDeploymentRepos

2. 原因:在pom 中忘记了配置 私服信息,加上就可以了:

代码语言:javascript复制
  <distributionManagement>
        <repository>
            <id>maven-release</id>
            <name>Nexus Release Repository</name>
            <url>http://xx.xx.xx.xx:8081/repository/maven-releases/</url>
        </repository>

        <snapshotRepository>
            <id>maven-snapshots</id>
            <name>Nexus Release Repository</name>
            <url>http://xx.xx.xx.xx:8081/repository/maven-snapshots/</url>
        </snapshotRepository>
  </distributionManagement>

配置的值来自私服此页面,左边是 id , 右边点击 copy 可得 url 。

0 人点赞