有没有办法告诉maven deploy:file目标,根据项目版本是快照还是发布版,将其部署到两个独立的存储库中?
我希望可能会有一个属性,指示版本是否有-SNAPSHOT前缀,或者默认的要部署到的存储库(已根据版本号计算出来)。
我考虑使用两个不同的配置文件,并通过解析pom.xml文件来确定是否为快照,但如果可能的话,我更喜欢一种更简洁的解决方案。
目前,我的部署插件如下所示,但这只会将它部署到发布存储库,而不管版本如何;
<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>
感谢您的咨询非常感谢