How to override Nexus Repository location to upload artifacts into other location for maven release or snapshot?

I have a question with how to override Nexus Repository location to upload artifacts into specified location. We specified nexus location details in parent pom.xml. Here My problem is I can't edit these details because we have 2 jenkins setup. In that one is client specific and other one is what we are using for us. So without changing parent pom and I want override these location details using maven setting.xml.

Whatever we have local setup everything is locally configured nothing but maven installation , Java and Jenkins. Only we are using same CVS setup for both jenkins.

So I can able to change the values in maven settings.xml, not in parent pom which is there in CVS.
Please tell me how to ovverride repository location details for Maven release or snapshot

.




 

As you specified already, you would have specified release and snapshot location in parent pom.xml assuming like below

<distributionManagement>
   <repository>
      <id>releases</id>
      <name>Internal releases</name>
      <url>http://javavillage.in/nexus-webapp-1.9.2/content/repositories/releases</url>
   </repository>
   <snapshotRepository>
      <id>snapshots</id>
      <name>Internal Snapshots</name>
      <url>http://javavillage.in/nexus-webapp-1.9.2/content/repositories/snapshots</url>
   </snapshotRepository>
</distributionManagement>



To override these locations have 2 solutions:

1) using maven settings.xml, use same id and provide new locations:

   <repository>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
      <id>snapshots</id>
      <name>Internal Snapshots</name>
      <url>http://xyz.in/nexus-webapp-1.9.2/content/repositories/snapshots</url>
   </repository>
   <repository>
      <releases>
         <enabled>true</enabled>
      </releases>
      <id>releases</id>
      <name>Internal releases</name>
      <url>http://javavillage.in/nexus-webapp-1.9.2/content/repositories/releases</url>
   </repository>

(or)

2) Try to point out ur server ip address with javavillage.in

 
Post a Reply
Captcha Image