Setting up Maven to allow deployment to different repositories easily -
i'm working in environment define rules lot of people. use hudson , artifactory, , want evaluate if switch jenkins , nexus worth migration cost (but not question).
to eval it, have setup maven, jenkins, , nexus locally, , try find setup use of previous setup, can compare solutions. problem here is:
- when use existing pom , build , deploy through jenkins, automatically deployed our old environment.
i have tried define
deploymentmanagement
section in.settings
file in maven, not allowed (see configuring maven, therenote: installation , user configuration cannot used add shared project information - example, setting or company-wide.
- i of course copy whole, , change distributionmanagement inside each pom, use same (not copied) example in different installations.
our current root pom contains 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 easiest way use same pom, deploy different repository managers?
ps: have read set maven pom file different deployment scenarios , don't (in context), deploying maven artifact multiple repositories different settings different question. multiple deployments in maven interesting approach, have modify lot of poms purpose.
i'm on similar team, providing tools others. have our parent pom set below. prod version active unless 1 of team members adds -dusetestrepo=true
mvn command line. experiment changing activation particular file exists on jenkins server (for example). i've wondered if maven interpolates properties in repo urls. if does, <url>${my.remote.repo}/releases</url>
, define my.remote.repo
in settings.xml. haven't tried one.
<profiles> <profile> <id>test-repository</id> <activation> <property> <name>usetestrepo</name> <value>true</value> </property> </activation> <properties> </properties> <distributionmanagement> <repository> <!-- ... --> </repository> <snapshotrepository> <!-- ... --> </snapshotrepository> </distributionmanagement> </profile> <profile> <id>prod-repository</id> <activation> <property> <name>!usetestrepo</name> </property> </activation> <properties> </properties> <distributionmanagement> <repository> <!-- ... --> </repository> <snapshotrepository> <!-- ... --> </snapshotrepository> </distributionmanagement> </profile>
as delivering (deploying) experimental parent pom - deploying test nexus repo, right? , none of developers accessing that, you. artifactory contain real com.company:corporate-parent:1.0
pom, , nexus com.company:corporate-parent:1.0
contains changes require testing.
i consider changing local repo in settings.xml don't mix artifacts 2 remote repos.
Comments
Post a Comment