美文网首页
一、mvn clean deploy出错

一、mvn clean deploy出错

作者: 此间有道 | 来源:发表于2020-06-02 13:43 被阅读0次

一、执行命令:mvn clean deploy -Dmaven.test.skip=true

报错如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myproject: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

二、原因:

pom里已有distributionManagement元素:

<distributionManagement>
        <snapshotRepository>
            <id>snapshots</id>
            <name>JD maven2 repository-snapshots</name>
            <url>http://artifactory.jd.com/libs-snapshots-local</url>
        </snapshotRepository>
</distributionManagement>

但当前的pom的version为0.0.6,是release而非snapshot,所以其与distributionManagement的元素不匹配导致如上错误。

相关文章

网友评论

      本文标题:一、mvn clean deploy出错

      本文链接:https://www.haomeiwen.com/subject/atjuzhtx.html