settings.xml

View: New views
2 Messages — Rating Filter:   Alert me  

settings.xml

by Nord, James-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
 
I'm wondering if the nexus settings[1] in the nexus book is not quite correct. (be carefull if you google nexus book!)
 
Let me explain, by default this enables snapshot plugins, so you can get arbitrary quality plugin if you run a plug-in from the command line where there is no pom to lock down the plugin (e.g. mvn archetype:generate), or you are using an obscure plugin that you wouldn't think to lock down in your corporate pom.
 
Our corporate pom defeines most of the plugin versions however you can't cover all cases - and even if you could you have the issue where you don't have a pom.
 
I first tried setting snapshots enabled to false on the plugin repo however as nexus returns the merged metadata with the latest version being the snapshot maven then tries to download x.x.x-SNAPSHOT and fails (as there is no repostiroy for plugins that can hold snapshots!)
 
I found a solution and I'm attaching it.  I was wondering though if
1) anyone can see any potential pitfalls with this (apart from not getting snapshot plugins which IMHO is a good thing and what maven does out of the box)
2) if this is ok should it replace the example in the nexus book so it more closely mimics the standard out of the box maven behaviour?
 
Regards,
 
    /James
 
 
 

**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@... and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
       
        <mirrors>
                <mirror>
                        <id>nexus-all</id>
                        <name>Nexus</name>
                        <url>http://localhost:8081/nexus/content/groups/all</url>
                        <mirrorOf>*,!central</mirrorOf>
                </mirror>
                <mirror>
                        <id>nexus-no-snapshots</id>
                        <name>plugins</name>
                        <url>http://localhost:8081/nexus/content/groups/public</url>
                        <mirrorOf>central</mirrorOf>
                </mirror>
        </mirrors>

        <profiles>
                <profile>
                        <id>nexus</id>
                        <!-- Enable snapshots for the built in central repo -->
                        <repositories>
                                <repository>
                                        <id>all</id>
                                        <url>http://bogus</url>
                                        <releases>
                                                <enabled>true</enabled>
                                        </releases>
                                        <snapshots>
                                                <enabled>true</enabled>
                                        </snapshots>
                                </repository>
                        </repositories>
                        <pluginRepositories>
                                <pluginRepository>
                                        <id>central</id>
                                        <url>http://bogus</url>
                                        <releases>
                                                <enabled>true</enabled>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                        </snapshots>
                                </pluginRepository>
                        </pluginRepositories>
                </profile>
        </profiles>
        <activeProfiles>
                <!-- make the nexus profile active all the time -->
                <activeProfile>nexus</activeProfile>
        </activeProfiles>

</settings>

---------------------------------------------------------------------
To unsubscribe, e-mail: nexus-user-unsubscribe@...
For additional commands, e-mail: nexus-user-help@...

Re: settings.xml

by Tamás Cservenák :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"be carefull if you google nexus book!"

LOL

2009/6/16 Nord, James <JNord@...>:

> Hi all,
>
> I'm wondering if the nexus settings[1] in the nexus book is not quite
> correct. (be carefull if you google nexus book!)
>
> Let me explain, by default this enables snapshot plugins, so you can get
> arbitrary quality plugin if you run a plug-in from the command line where
> there is no pom to lock down the plugin (e.g. mvn archetype:generate), or
> you are using an obscure plugin that you wouldn't think to lock down in your
> corporate pom.
>
> Our corporate pom defeines most of the plugin versions however you can't
> cover all cases - and even if you could you have the issue where you don't
> have a pom.
>
> I first tried setting snapshots enabled to false on the plugin repo however
> as nexus returns the merged metadata with the latest version being the
> snapshot maven then tries to download x.x.x-SNAPSHOT and fails (as there is
> no repostiroy for plugins that can hold snapshots!)
>
> I found a solution and I'm attaching it.  I was wondering though if
> 1) anyone can see any potential pitfalls with this (apart from not getting
> snapshot plugins which IMHO is a good thing and what maven does out of the
> box)
> 2) if this is ok should it replace the example in the nexus book so it more
> closely mimics the standard out of the box maven behaviour?
>
> Regards,
>
>     /James
>
> [1]
> http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html
>
>
> **************************************************************************************
> This message is confidential and intended only for the addressee. If you
> have received this message in error, please immediately notify the
> postmaster@... and delete it from your system as well as any copies. The
> content of e-mails as well as traffic data may be monitored by NDS for
> employment and security purposes. To protect the environment please do not
> print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
> 4EX, United Kingdom. A company registered in England and Wales. Registered
> no. 3080780. VAT no. GB 603 8808 40-00
> **************************************************************************************
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: nexus-user-unsubscribe@...
> For additional commands, e-mail: nexus-user-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: nexus-user-unsubscribe@...
For additional commands, e-mail: nexus-user-help@...