You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca> on 2009/12/08 19:45:08 UTC

Putting nexus setting.xml info in pom

Hi all,

I have installed nexus on our internal server as a repo manager. The nexus documentation tells me to put the following in settings.xml in my .m2 directory so that maven knows where to look for the nexus repo

I don't want to distribute this settings.xml to all of my developers so what should I do? Can I put all of this in pom.xml of our project archetype (which all developers use to create projects) so I don't have to distribute this settings.xml files or is there another way around it?

<settings>
   <mirrors>
      <mirror>
        <!--This sends everything else to /public -->
        <id>nexus</id>
        <mirrorOf>*</mirrorOf>
        <url>http://server_address:8081/nexus/content/groups/public</url>
      </mirror>
   </mirrors>
   <profiles>
      <profile>
         <id>nexus</id>
         <repositories>
            <repository>
	   <id>central</id>
	   <url>http://central</url>
	   <releases><enabled>true</enabled></releases>
	   <snapshots><enabled>true</enabled></snapshots>
	</repository>
         </repositories>
         <pluginRepositories>
	<pluginRepository>
	   <id>central</id>
	   <url>http://central</url>
	   <releases><enabled>true</enabled></releases>
	   <snapshots><enabled>true</enabled></snapshots>
	</pluginRepository>
         </pluginRepositories>
      </profile>
   </profiles>
   <activeProfiles>
        <!--make the profile active all the time -->
       <activeProfile>nexus</activeProfile>
   </activeProfiles>
</settings>

--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate | La direction générale des applications
Chief Information Officer Branch | Direction générale du dirigeant principal de l'information
Environment Canada | Environnement Canada
shahzad.qureshi@ec.gc.ca
Telephone | Téléphone 416-739-4702
Government of Canada | Gouvernement du Canada
Website | Site Web www.ec.gc.ca


RE: Putting nexus setting.xml info in pom

Posted by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca>.
Yup, I your right and while looking for this, I realized the benefits of this


Thanks for your help Wayne 


--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate | La direction générale des applications
Chief Information 
Environment Canada
416-739-4702
shahzad.qureshi@ec.gc.ca

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, December 08, 2009 2:44 PM
To: Maven Users List
Subject: Re: Putting nexus setting.xml info in pom

> I don't want to distribute this settings.xml to all of my developers

Why not? Some people make a company-specific Maven package with things like custom settings.xml files etc and requires their developers download and install it.

> so what should I do?

You should follow the directions.

> Can I put all of this in pom.xml of our project archetype (which all 
> developers use to create projects) so I don't have to distribute this 
> settings.xml files or is there another way around it?

No. Each developer needs their own copy of this settings.xml file.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Putting nexus setting.xml info in pom

Posted by Todd Thiessen <th...@nortel.com>.
This is sound advice. It may at first sound unnecessary but it is very
useful.

Say down the road your Nexus server changes and you have hard coded your
Nexus server in your POM. You can no longer build your old tags.

Brian wrote an excellent blog about it here:

http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-
poms-is-a-bad-idea/

It is also worth while noting that there is a global and local
settings.xml file. We put repository information in the global
settings.xml file. The local one, in my view at least, is meant to
contain information that is specific to that developer. Like user ID and
password. Maven takes the union of the global and local settings.xml
files.

If you are working in a Linux environment, you may be able to provide
your team with an environment where everyone shares the same
installation of Maven. That way, you would only need to change the
global settings.xml file in one place.  I am not all that Linux savey,
so I don't know the details of setting it up, but I have used it and it
works pretty slick.

---
Todd Thiessen
 

> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com] 
> Sent: Tuesday, December 08, 2009 2:44 PM
> To: Maven Users List
> Subject: Re: Putting nexus setting.xml info in pom
> 
> > I don't want to distribute this settings.xml to all of my developers
> 
> Why not? Some people make a company-specific Maven package 
> with things like custom settings.xml files etc and requires 
> their developers download and install it.
> 
> > so what should I do?
> 
> You should follow the directions.
> 
> > Can I put all of this in pom.xml of our project archetype 
> (which all 
> > developers use to create projects) so I don't have to 
> distribute this 
> > settings.xml files or is there another way around it?
> 
> No. Each developer needs their own copy of this settings.xml file.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Putting nexus setting.xml info in pom

Posted by Wayne Fay <wa...@gmail.com>.
> I don't want to distribute this settings.xml to all of my developers

Why not? Some people make a company-specific Maven package with things
like custom settings.xml files etc and requires their developers
download and install it.

> so what should I do?

You should follow the directions.

> Can I put all of this in pom.xml of our project archetype (which all
> developers use to create projects) so I don't have to distribute this
> settings.xml files or is there another way around it?

No. Each developer needs their own copy of this settings.xml file.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org