我认为我发现了maven目标“部署”到maven-release-plugin执行中的一个奇怪问题。
当我使用“-s”或“-gs”选项构建包含自定义设置(maven settings.xml)的版本时,内部目标“deploy”不使用自定义设置(似乎使用$M2_HOME/conf/settings.xml
) 。这是一个错误还是我做错了什么?
我试过了:
mvn release:prepare release:perform -s /opt/maven-3.0.4/conf/settings.xml
mvn release:prepare release:perform -Darguments="-s /opt/maven-3.0.4/conf/settings.xml"
mvn -DmavenHome=/opt/maven-3.0.4/ release:prepare release:perform
什么都行不通......
调试:
[DEBUG] Using ${maven.home} of: '/opt/maven-3.0.4'.
[DEBUG] Executing: /bin/sh -c cd /opt/jenkins/jobs/.../workspace && /opt/maven-3.0.4/bin/mvn -B -X -D maven.repo.local=/home/jenkins/.m2/repository -s /tmp/release-settings1555783726504175186.xml -D maven.test.skip=true clean install
[INFO] Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
[INFO] Maven home: /opt/maven-3.0.4-old
...
[INFO] [DEBUG] Reading global settings from /opt/maven-3.0.4-old/conf/settings.xml
[INFO] [DEBUG] Reading user settings from /tmp/release-settings1555783726504175186.xml