Puc*_*uce 12 java maven maven-release-plugin jenkins
我正在尝试使用Maven发布一个库并执行一个站点部署到sourceforge(我先创建了一个交互式shell).该版本由Jenkins工作完成(使用Jenkins的Maven Release Plugin).
我试过了:
-X -e -Dresume=false -Dusername=puce release:prepare release:perform -Darguments="-Dusername=puce"
Run Code Online (Sandbox Code Playgroud)
和
-X -e -Dresume=false -Dusername=puce -Darguments=-Dusername=puce release:prepare release:perform
Run Code Online (Sandbox Code Playgroud)
但两次工作都挂在现场:部署第一个模块:
[INFO] --- maven-site-plugin:3.2:deploy (default-deploy) @ myproject-parent ---
[INFO] Parent project loaded from repository: myGroupId:myOtherproject-parent:pom:1.0
[INFO] Parent project loaded from repository: myGroupId:myOtherproject-parent:pom:1.0
Using private key: /opt/jenkins/.ssh/id_dsa
Run Code Online (Sandbox Code Playgroud)
当我停止工作时,最后会打印以下内容:
Password for ${username}@shell.sourceforge.net: channel stopped
Run Code Online (Sandbox Code Playgroud)
这可能意味着$ {username}未得到解决.
如何解析$ {username}?
编辑:
请注意,以下运行正常:
site-deploy -Psonatype-oss-release -Dusername=puce
Run Code Online (Sandbox Code Playgroud)
编辑2: 作为发布的一部分:执行maven执行以下命令:
/usr/share/maven/bin/mvn -s /tmp/release-settings7797889802430474959.xml deploy site-deploy --no-plugin-updates --batch-mode -Psonatype-oss-release -P nexus -f pom.xml
Run Code Online (Sandbox Code Playgroud)
-Dusername=puce 似乎没有传递给这个maven命令......
另请注意help:effective-pom显示以下maven-release-plugin配置:
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>-Psonatype-oss-release</arguments>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
所以'arguments'被定义了,它的值似乎达到了嵌入式maven命令而不是命令行传递的值...
San*_*gen 18
我过去成功完成的工作如下:
在POM文件中定义属性,例如:
<properties>
<release.arguments></release.arguments>
</properties>
Run Code Online (Sandbox Code Playgroud)将POM属性添加到POM文件中的插件配置,例如;
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<arguments>${release.arguments}</arguments>
...
Run Code Online (Sandbox Code Playgroud)通过命令行上的属性传递参数,例如:
mvn release:prepare -Drelease.arguments="-N -Prelease"
Run Code Online (Sandbox Code Playgroud)希望这可以帮助.
重写
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>-Psonatype-oss-release</arguments>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
同
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>-Psonatype-oss-release -Dusername=${username}</arguments>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
在其中一个父母做了伎俩.
似乎是一个错误,命令行上的值不会覆盖POM中的值.
| 归档时间: |
|
| 查看次数: |
28476 次 |
| 最近记录: |