有没有可能以某种方式告诉maven deploy:file目标根据项目的版本是否是快照/发布来部署到两个独立的artifactories?
我希望可能会有一个属性来表明版本已经预先考虑了-SNAPSHOT,或者可能是要部署到的默认工件(它已经根据版本号制定出来了)。
我想过使用两个不同的配置文件,并通过解析pom.xml文件来确定它是否是ant中的快照,但如果可能的话,我更喜欢一个更干净的解决方案。
目前,我的deploy插件如下所示,但这只是部署到release artifactory,而不考虑版本;
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>deploy-zip-created-by-ant-to-artifactory</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>${project.distributionManagement.repository.id}</repositoryId>
<url>${project.distributionManagement.repository.url}</url>
<file>${project.basedir}/Build/deploy/MyArtifact.zip</file>
<pomFile>${project.basedir}/MyArtifact-pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
非常感谢
发布于 2011-07-29 18:27:58
如果您在settings.xml中定义了存储库,则可以使用
mvn deploy:deploy-file -DrepositoryId=releases -DartifactId=... -Durl=
发布于 2012-11-30 20:38:46
通过here,我使用GMaven插件从POM的distributionManagement
部分选择存储库,并将其存储在属性中。
然后,部署插件可以使用该属性。
发布于 2013-02-04 19:03:39
也许您想使用build-helper-maven-plugin来部署一个额外的工件
https://stackoverflow.com/questions/6871494
复制相似问题