是否有可能以某种方式告诉maven部署:文件目标是根据项目的版本是快照/发布来部署到两个独立的工件?
我希望可能有一个属性表明该版本具有-SNAPSHOT前置的事实,或者可能是要部署到的默认工件(已经根据版本号计算出来).
我想过使用两个不同的配置文件,并通过解析pom.xml文件来解决它在ant中的快照,但如果可能的话,我宁愿使用更干净的解决方案.
目前,我的部署插件如下所示,但这只是部署到发布工件,无论版本如何;
<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>
Run Code Online (Sandbox Code Playgroud)
非常感谢