mvn_clean_deploy出错

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

报错如下:

1
2
3
4
5
6
7
[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元素:

1
2
3
4
5
6
7
<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的元素不匹配导致如上错误。

评论