记录一次问题
一位开发遇到了一个问题:如果此处<distributionManagement><repository><id>
不存在于settings.xml
将会发生错误。
<!-- 用于上传远程maven私服的配置 -->
<distributionManagement>
<repository>
<id>releases</id>
<url>http://url/repository/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://url/repository/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- settings.xml -->
<server>
<id>releases</id>
<username>user</username>
<password>pwd</password>
</server>
<server>
<id>snapshots</id>
<username>user</username>
<password>pwd</password>
</server>
解决方法有两种:
<distributionManagement><repository><id>
<distributionManagement>
配置
-DaltSnapshotDeploymentRepository
和-DaltReleaseDeploymentRepository
)当我走第二种方案时,但是未解决问题并出现一下提示。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project demo-project: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
原因:maven-deploy-plugin.version = 2.7不支持该参数。使用2.8+即可。
-am
参数使用mvn deploy -am