I'm currently working in an environment where I define the rules for a lot of people. We currently use Hudson and Artifactory, and I want to evaluate if the switch to Jenkins and Nexus are worth the migration cost (but this is not the question).
To eval it, I have setup Maven, Jenkins, and Nexus locally, and I try to find a setup to use as much of the previous setup, so that I can compare the solutions. The problem here is:
- When I use an existing POM and build and deploy it through Jenkins, it is automatically deployed to our old environment.
I have then tried to define the
deploymentManagement
section in my.settings
file in Maven, but this is not allowed (see Configuring Maven, thereNote: the installation and user configuration cannot be used to add shared project information - for example, setting or company-wide.
- I could of course copy the whole, and change the distributionManagement inside each POM, but I would like to use the same (not a copied) example in different installations.
Our current root POM contains the following section:
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>company-central</id>
<name>Company central maven respository</name>
<url>https://company.com/artifactory/libs-releases</url>
</repository>
<snapshotRepository>
<id>company-snaps</id>
<name>company-snapshots</name>
<url>https://company.com/artifactory/libs-snapshots</url>
</snapshotRepository>
<downloadUrl>https://company.com/artifactory/libs-releases</downloadUrl>
</distributionManagement>
What is the easiest way to use the same POM, but to deploy it to different repository managers?
PS: I have read set up maven pom file for different deployment scenarios and don't like it (in my context), Deploying Maven artifact to multiple repositories with different settings is really a different question. Multiple deployments in maven is an interesting approach, but I would have to modify a lot of POMs only for this purpose.