You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2011/07/07 04:02:10 UTC

A problem with mirrors

In our corporate global settings file, we have:

 <mirror>
      <id>Nexus</id>
      <name>Nexus Mirror</name>
      <url>http://maven.basistech.net/nexus/content/groups/public</url>
      <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
    </mirror>

That * turns out to be a very bad idea, and I'd like some advice in
fixing maven to make it a less bad idea.

Using m3, there are absolutely no logging messages about mirrors. So,
the following happens:

1) I create a new repo on my local repo manager.
2) I forget to add it to this list with ,!whatever
3) I try to use it.

What i get is error messages telling me that the item can't be found
in the mirror URL, but no log messages of the form: 'mapping repo X to
mirror Y'.  So I spent quite some time spinning my wheels before
realizing what was going on. And, once I have this mistake in place, I
can't override it in the local pom, since mirrors can't be in there.

A little logging would go a long way here. Can anyone point me at
which piece of the universe actually implements this so I can open a
JIRA and add a few log messages?

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


Re: A problem with mirrors

Posted by Mark Struberg <st...@yahoo.de>.
You are right, that's the contra argument:
Historical versions rely on information on a given nexus.
But this can be a CNAME or whatever, so it's easy to move it inside a company. 

At the end, you still have to add the <repository> sections in your own poms somewhere for your _own_ company intern artifacts. At least in any non-trivial project where you have company internally shared utility projects and stuff.

The pro argument:
You don't need any mirrorOf sections in any settings.xml. This is important if you have external developers or any other scenario where you work on multiple projects. Someone will work without the mirror and you will not get all the artifacts being used / trash maven.central. 


There is no free lunch indeed ;)

LieGrue,
strub

--- On Fri, 7/8/11, Benson Margulies <bi...@gmail.com> wrote:

> From: Benson Margulies <bi...@gmail.com>
> Subject: Re: A problem with mirrors
> To: "Maven Developers List" <de...@maven.apache.org>
> Date: Friday, July 8, 2011, 10:14 PM
> I see. What I've been doing is
> pushing out a maven install tree with
> my <mirrors/> in the GLOBAL settings.xml and telling
> everyone to use
> that.
> 
> Here's the problem with your scheme: it leads to broken
> historical
> builds Tagged version 'N' of some project references
> corporate parent
> version 'P', which has some <repository> url in it.
> if we move nexus,
> it's dead. If the location of nexus is established by
> settings.xml, we
> don't have that problem.
> 
> 
> On Fri, Jul 8, 2011 at 6:09 PM, Mark Struberg <st...@yahoo.de>
> wrote:
> >> So you don't declare the local nexus
> >> as a mirror at all? Just as a repo?
> >
> > yup, works fine in a lot projects already.
> >
> > Plus, I don't have the problem that all employees need
> to tweak their maven installation (which inherently goes
> wrong from time to time).
> >
> > The local Archiva/Nexus has maven.central proxied
> anyway, so all my artifacts will be resolved by it.
> >
> > LieGrue,
> > strub
> >
> > --- On Fri, 7/8/11, Benson Margulies <bi...@gmail.com>
> wrote:
> >
> >> From: Benson Margulies <bi...@gmail.com>
> >> Subject: Re: A problem with mirrors
> >> To: "Maven Developers List" <de...@maven.apache.org>
> >> Date: Friday, July 8, 2011, 9:57 PM
> >> So you don't declare the local nexus
> >> as a mirror at all? Just as a repo?
> >>
> >> On Fri, Jul 8, 2011 at 5:20 PM, Mark Struberg
> <st...@yahoo.de>
> >> wrote:
> >> > Hi folks!
> >> >
> >> > In general I prefer to 'disable the
> maven.central in
> >> the pom itself be just turning it off:
> >> >
> >> >    <pluginRepositories>
> >> >        <pluginRepository>
> >> >            <!-- we force maven to
> use our
> >> company repo this way! -->
> >> >          
>  <id>central</id>
> >> >            <name>apache
> maven.central
> >> repository</name>
> >> >            <url>http://invalid.com</url>
> >> >            <!-- disable the
> maven.central
> >> repo -->
> >> >            <releases>
> >> >
> >>  <enabled>false</enabled>
> >> >            </releases>
> >> >            <snapshots>
> >> >
> >>  <enabled>false</enabled>
> >> >            </snapshots>
> >> >        </pluginRepository>
> >> >  ....
> >> >
> >> >    <repositories>
> >> >        <repository>
> >> >            <!-- we force maven to
> use our
> >> company repo this way! -->
> >> >          
>  <id>central</id>
> >> >            <name>apache
> maven.central
> >> repository</name>
> >> >            <url>http://invalid.com</url>
> >> >            <!-- disable the
> maven.central
> >> repo -->
> >> >            <releases>
> >> >
> >>  <enabled>false</enabled>
> >> >            </releases>
> >> >            <snapshots>
> >> >
> >>  <enabled>false</enabled>
> >> >            </snapshots>
> >> >        </repository>
> >> > ...
> >> >
> >> >
> >> > The trick is that 'central' is the fixed ID
> of the
> >> maven central repository [1]. By overwriting it in
> your own
> >> parent pom, you will not use the central
> repository anymore
> >> and all request will get routed via your company
> repo
> >> manager.
> >> >
> >> > Any all you need is a bit of code in your pom
> - no
> >> ugly touching the global settings.xml anymore.
> >> >
> >> > LieGrue,
> >> > strub
> >> >
> >> >
> >> > [1] http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
> >> > --- On Fri, 7/8/11, Brian Fox <br...@infinity.nu>
> >> wrote:
> >> >
> >> >> From: Brian Fox <br...@infinity.nu>
> >> >> Subject: Re: A problem with mirrors
> >> >> To: "Maven Developers List" <de...@maven.apache.org>
> >> >> Date: Friday, July 8, 2011, 8:25 PM
> >> >> What about the * bit you? Does the
> >> >> external:* fix it for you?
> >> >>
> >> >> On Wed, Jul 6, 2011 at 10:21 PM, Benson
> Margulies
> >> <bi...@gmail.com>
> >> >> wrote:
> >> >> > This doc works:
> >> >> >
> >> >> > http://maven.apache.org/guides/mini/guide-mirror-settings.html
> >> >> >
> >> >> > FWIW.
> >> >> >
> >> >> > On Wed, Jul 6, 2011 at 10:18 PM,
> Barrie
> >> Treloar <ba...@gmail.com>
> >> >> wrote:
> >> >> >> On Thu, Jul 7, 2011 at 11:32 AM,
> Benson
> >> Margulies
> >> >> <bi...@gmail.com>
> >> >> wrote:
> >> >> >>> In our corporate global
> settings
> >> file, we
> >> >> have:
> >> >> >>>
> >> >> >>>  <mirror>
> >> >> >>>    
>  <id>Nexus</id>
> >> >> >>>      <name>Nexus
> >> Mirror</name>
> >> >> >>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
> >> >> >>>
> >> >>
> >>
>  <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
> >> >> >>>    </mirror>
> >> >> >>>
> >> >> >>> That * turns out to be a
> very bad
> >> idea, and
> >> >> I'd like some advice in
> >> >> >>> fixing maven to make it a
> less bad
> >> idea.
> >> >> >>>
> >> >> >>
> >> >> >> I hear ya, +1 and thanks for
> looking at
> >> it, I get
> >> >> bitten often too.
> >> >> >> I can't help with where to look
> though.
> >> >> >>
> >> >> >> While you are looking at it can
> you see
> >> about
> >> >> updating the documentation?
> >> >> >> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
> >> >> >>
> >> >> >> It current says
> >> >> >>  mirrorOf       String
> >>  The
> >> >> server ID of the repository being
> >> >> >> mirrored, eg "central". This
> MUST NOT
> >> match the
> >> >> mirror id.
> >> >> >> which says nothing about * or !
> being
> >> special
> >> >> syntax.
> >> >> >>
> >> >> >>

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


Re: A problem with mirrors

Posted by Benson Margulies <bi...@gmail.com>.
I see. What I've been doing is pushing out a maven install tree with
my <mirrors/> in the GLOBAL settings.xml and telling everyone to use
that.

Here's the problem with your scheme: it leads to broken historical
builds Tagged version 'N' of some project references corporate parent
version 'P', which has some <repository> url in it. if we move nexus,
it's dead. If the location of nexus is established by settings.xml, we
don't have that problem.


On Fri, Jul 8, 2011 at 6:09 PM, Mark Struberg <st...@yahoo.de> wrote:
>> So you don't declare the local nexus
>> as a mirror at all? Just as a repo?
>
> yup, works fine in a lot projects already.
>
> Plus, I don't have the problem that all employees need to tweak their maven installation (which inherently goes wrong from time to time).
>
> The local Archiva/Nexus has maven.central proxied anyway, so all my artifacts will be resolved by it.
>
> LieGrue,
> strub
>
> --- On Fri, 7/8/11, Benson Margulies <bi...@gmail.com> wrote:
>
>> From: Benson Margulies <bi...@gmail.com>
>> Subject: Re: A problem with mirrors
>> To: "Maven Developers List" <de...@maven.apache.org>
>> Date: Friday, July 8, 2011, 9:57 PM
>> So you don't declare the local nexus
>> as a mirror at all? Just as a repo?
>>
>> On Fri, Jul 8, 2011 at 5:20 PM, Mark Struberg <st...@yahoo.de>
>> wrote:
>> > Hi folks!
>> >
>> > In general I prefer to 'disable the maven.central in
>> the pom itself be just turning it off:
>> >
>> >    <pluginRepositories>
>> >        <pluginRepository>
>> >            <!-- we force maven to use our
>> company repo this way! -->
>> >            <id>central</id>
>> >            <name>apache maven.central
>> repository</name>
>> >            <url>http://invalid.com</url>
>> >            <!-- disable the maven.central
>> repo -->
>> >            <releases>
>> >
>>  <enabled>false</enabled>
>> >            </releases>
>> >            <snapshots>
>> >
>>  <enabled>false</enabled>
>> >            </snapshots>
>> >        </pluginRepository>
>> >  ....
>> >
>> >    <repositories>
>> >        <repository>
>> >            <!-- we force maven to use our
>> company repo this way! -->
>> >            <id>central</id>
>> >            <name>apache maven.central
>> repository</name>
>> >            <url>http://invalid.com</url>
>> >            <!-- disable the maven.central
>> repo -->
>> >            <releases>
>> >
>>  <enabled>false</enabled>
>> >            </releases>
>> >            <snapshots>
>> >
>>  <enabled>false</enabled>
>> >            </snapshots>
>> >        </repository>
>> > ...
>> >
>> >
>> > The trick is that 'central' is the fixed ID of the
>> maven central repository [1]. By overwriting it in your own
>> parent pom, you will not use the central repository anymore
>> and all request will get routed via your company repo
>> manager.
>> >
>> > Any all you need is a bit of code in your pom - no
>> ugly touching the global settings.xml anymore.
>> >
>> > LieGrue,
>> > strub
>> >
>> >
>> > [1] http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
>> > --- On Fri, 7/8/11, Brian Fox <br...@infinity.nu>
>> wrote:
>> >
>> >> From: Brian Fox <br...@infinity.nu>
>> >> Subject: Re: A problem with mirrors
>> >> To: "Maven Developers List" <de...@maven.apache.org>
>> >> Date: Friday, July 8, 2011, 8:25 PM
>> >> What about the * bit you? Does the
>> >> external:* fix it for you?
>> >>
>> >> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies
>> <bi...@gmail.com>
>> >> wrote:
>> >> > This doc works:
>> >> >
>> >> > http://maven.apache.org/guides/mini/guide-mirror-settings.html
>> >> >
>> >> > FWIW.
>> >> >
>> >> > On Wed, Jul 6, 2011 at 10:18 PM, Barrie
>> Treloar <ba...@gmail.com>
>> >> wrote:
>> >> >> On Thu, Jul 7, 2011 at 11:32 AM, Benson
>> Margulies
>> >> <bi...@gmail.com>
>> >> wrote:
>> >> >>> In our corporate global settings
>> file, we
>> >> have:
>> >> >>>
>> >> >>>  <mirror>
>> >> >>>      <id>Nexus</id>
>> >> >>>      <name>Nexus
>> Mirror</name>
>> >> >>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>> >> >>>
>> >>
>>  <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>> >> >>>    </mirror>
>> >> >>>
>> >> >>> That * turns out to be a very bad
>> idea, and
>> >> I'd like some advice in
>> >> >>> fixing maven to make it a less bad
>> idea.
>> >> >>>
>> >> >>
>> >> >> I hear ya, +1 and thanks for looking at
>> it, I get
>> >> bitten often too.
>> >> >> I can't help with where to look though.
>> >> >>
>> >> >> While you are looking at it can you see
>> about
>> >> updating the documentation?
>> >> >> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
>> >> >>
>> >> >> It current says
>> >> >>  mirrorOf       String
>>  The
>> >> server ID of the repository being
>> >> >> mirrored, eg "central". This MUST NOT
>> match the
>> >> mirror id.
>> >> >> which says nothing about * or ! being
>> special
>> >> syntax.
>> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> > For additional commands, e-mail: dev-help@maven.apache.org
>> >> >
>> >> >
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: A problem with mirrors

Posted by Mark Struberg <st...@yahoo.de>.
> So you don't declare the local nexus
> as a mirror at all? Just as a repo?

yup, works fine in a lot projects already.

Plus, I don't have the problem that all employees need to tweak their maven installation (which inherently goes wrong from time to time).

The local Archiva/Nexus has maven.central proxied anyway, so all my artifacts will be resolved by it.

LieGrue,
strub

--- On Fri, 7/8/11, Benson Margulies <bi...@gmail.com> wrote:

> From: Benson Margulies <bi...@gmail.com>
> Subject: Re: A problem with mirrors
> To: "Maven Developers List" <de...@maven.apache.org>
> Date: Friday, July 8, 2011, 9:57 PM
> So you don't declare the local nexus
> as a mirror at all? Just as a repo?
> 
> On Fri, Jul 8, 2011 at 5:20 PM, Mark Struberg <st...@yahoo.de>
> wrote:
> > Hi folks!
> >
> > In general I prefer to 'disable the maven.central in
> the pom itself be just turning it off:
> >
> >    <pluginRepositories>
> >        <pluginRepository>
> >            <!-- we force maven to use our
> company repo this way! -->
> >            <id>central</id>
> >            <name>apache maven.central
> repository</name>
> >            <url>http://invalid.com</url>
> >            <!-- disable the maven.central
> repo -->
> >            <releases>
> >              
>  <enabled>false</enabled>
> >            </releases>
> >            <snapshots>
> >              
>  <enabled>false</enabled>
> >            </snapshots>
> >        </pluginRepository>
> >  ....
> >
> >    <repositories>
> >        <repository>
> >            <!-- we force maven to use our
> company repo this way! -->
> >            <id>central</id>
> >            <name>apache maven.central
> repository</name>
> >            <url>http://invalid.com</url>
> >            <!-- disable the maven.central
> repo -->
> >            <releases>
> >              
>  <enabled>false</enabled>
> >            </releases>
> >            <snapshots>
> >              
>  <enabled>false</enabled>
> >            </snapshots>
> >        </repository>
> > ...
> >
> >
> > The trick is that 'central' is the fixed ID of the
> maven central repository [1]. By overwriting it in your own
> parent pom, you will not use the central repository anymore
> and all request will get routed via your company repo
> manager.
> >
> > Any all you need is a bit of code in your pom - no
> ugly touching the global settings.xml anymore.
> >
> > LieGrue,
> > strub
> >
> >
> > [1] http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
> > --- On Fri, 7/8/11, Brian Fox <br...@infinity.nu>
> wrote:
> >
> >> From: Brian Fox <br...@infinity.nu>
> >> Subject: Re: A problem with mirrors
> >> To: "Maven Developers List" <de...@maven.apache.org>
> >> Date: Friday, July 8, 2011, 8:25 PM
> >> What about the * bit you? Does the
> >> external:* fix it for you?
> >>
> >> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies
> <bi...@gmail.com>
> >> wrote:
> >> > This doc works:
> >> >
> >> > http://maven.apache.org/guides/mini/guide-mirror-settings.html
> >> >
> >> > FWIW.
> >> >
> >> > On Wed, Jul 6, 2011 at 10:18 PM, Barrie
> Treloar <ba...@gmail.com>
> >> wrote:
> >> >> On Thu, Jul 7, 2011 at 11:32 AM, Benson
> Margulies
> >> <bi...@gmail.com>
> >> wrote:
> >> >>> In our corporate global settings
> file, we
> >> have:
> >> >>>
> >> >>>  <mirror>
> >> >>>      <id>Nexus</id>
> >> >>>      <name>Nexus
> Mirror</name>
> >> >>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
> >> >>>
> >>
>  <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
> >> >>>    </mirror>
> >> >>>
> >> >>> That * turns out to be a very bad
> idea, and
> >> I'd like some advice in
> >> >>> fixing maven to make it a less bad
> idea.
> >> >>>
> >> >>
> >> >> I hear ya, +1 and thanks for looking at
> it, I get
> >> bitten often too.
> >> >> I can't help with where to look though.
> >> >>
> >> >> While you are looking at it can you see
> about
> >> updating the documentation?
> >> >> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
> >> >>
> >> >> It current says
> >> >>  mirrorOf       String        
>  The
> >> server ID of the repository being
> >> >> mirrored, eg "central". This MUST NOT
> match the
> >> mirror id.
> >> >> which says nothing about * or ! being
> special
> >> syntax.
> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: dev-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> > For additional commands, e-mail: dev-help@maven.apache.org
> >> >
> >> >
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

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


Re: A problem with mirrors

Posted by Benson Margulies <bi...@gmail.com>.
So you don't declare the local nexus as a mirror at all? Just as a repo?

On Fri, Jul 8, 2011 at 5:20 PM, Mark Struberg <st...@yahoo.de> wrote:
> Hi folks!
>
> In general I prefer to 'disable the maven.central in the pom itself be just turning it off:
>
>    <pluginRepositories>
>        <pluginRepository>
>            <!-- we force maven to use our company repo this way! -->
>            <id>central</id>
>            <name>apache maven.central repository</name>
>            <url>http://invalid.com</url>
>            <!-- disable the maven.central repo -->
>            <releases>
>                <enabled>false</enabled>
>            </releases>
>            <snapshots>
>                <enabled>false</enabled>
>            </snapshots>
>        </pluginRepository>
>  ....
>
>    <repositories>
>        <repository>
>            <!-- we force maven to use our company repo this way! -->
>            <id>central</id>
>            <name>apache maven.central repository</name>
>            <url>http://invalid.com</url>
>            <!-- disable the maven.central repo -->
>            <releases>
>                <enabled>false</enabled>
>            </releases>
>            <snapshots>
>                <enabled>false</enabled>
>            </snapshots>
>        </repository>
> ...
>
>
> The trick is that 'central' is the fixed ID of the maven central repository [1]. By overwriting it in your own parent pom, you will not use the central repository anymore and all request will get routed via your company repo manager.
>
> Any all you need is a bit of code in your pom - no ugly touching the global settings.xml anymore.
>
> LieGrue,
> strub
>
>
> [1] http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
> --- On Fri, 7/8/11, Brian Fox <br...@infinity.nu> wrote:
>
>> From: Brian Fox <br...@infinity.nu>
>> Subject: Re: A problem with mirrors
>> To: "Maven Developers List" <de...@maven.apache.org>
>> Date: Friday, July 8, 2011, 8:25 PM
>> What about the * bit you? Does the
>> external:* fix it for you?
>>
>> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com>
>> wrote:
>> > This doc works:
>> >
>> > http://maven.apache.org/guides/mini/guide-mirror-settings.html
>> >
>> > FWIW.
>> >
>> > On Wed, Jul 6, 2011 at 10:18 PM, Barrie Treloar <ba...@gmail.com>
>> wrote:
>> >> On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies
>> <bi...@gmail.com>
>> wrote:
>> >>> In our corporate global settings file, we
>> have:
>> >>>
>> >>>  <mirror>
>> >>>      <id>Nexus</id>
>> >>>      <name>Nexus Mirror</name>
>> >>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>> >>>
>>  <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>> >>>    </mirror>
>> >>>
>> >>> That * turns out to be a very bad idea, and
>> I'd like some advice in
>> >>> fixing maven to make it a less bad idea.
>> >>>
>> >>
>> >> I hear ya, +1 and thanks for looking at it, I get
>> bitten often too.
>> >> I can't help with where to look though.
>> >>
>> >> While you are looking at it can you see about
>> updating the documentation?
>> >> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
>> >>
>> >> It current says
>> >>  mirrorOf       String          The
>> server ID of the repository being
>> >> mirrored, eg "central". This MUST NOT match the
>> mirror id.
>> >> which says nothing about * or ! being special
>> syntax.
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: A problem with mirrors

Posted by Benson Margulies <bi...@gmail.com>.
I think I wrote it up reasonably well in
https://issues.sonatype.org/browse/AETHER-110.

When I first deployed nexus, I set things up with * and !'s to exempt
the local nexus repos. Then I added one more repo to nexus, and
confusion set in, because it wasn't listed in the ! list. Using
external: doesn't help, since nexus is just as 'external' as anything
else. Isn't it? Something like "basis*" would have helped.

Mostly, better logging would be a big help in discovering the screwup.
Though more complex *'s wouldn't hurt any either.



On Fri, Jul 8, 2011 at 4:25 PM, Brian Fox <br...@infinity.nu> wrote:
> What about the * bit you? Does the external:* fix it for you?
>
> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
>> This doc works:
>>
>> http://maven.apache.org/guides/mini/guide-mirror-settings.html
>>
>> FWIW.
>>
>> On Wed, Jul 6, 2011 at 10:18 PM, Barrie Treloar <ba...@gmail.com> wrote:
>>> On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies <bi...@gmail.com> wrote:
>>>> In our corporate global settings file, we have:
>>>>
>>>>  <mirror>
>>>>      <id>Nexus</id>
>>>>      <name>Nexus Mirror</name>
>>>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>>>>      <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>>>>    </mirror>
>>>>
>>>> That * turns out to be a very bad idea, and I'd like some advice in
>>>> fixing maven to make it a less bad idea.
>>>>
>>>
>>> I hear ya, +1 and thanks for looking at it, I get bitten often too.
>>> I can't help with where to look though.
>>>
>>> While you are looking at it can you see about updating the documentation?
>>> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
>>>
>>> It current says
>>>  mirrorOf       String          The server ID of the repository being
>>> mirrored, eg "central". This MUST NOT match the mirror id.
>>> which says nothing about * or ! being special syntax.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: A problem with mirrors

Posted by Mark Struberg <st...@yahoo.de>.
Hi folks!

In general I prefer to 'disable the maven.central in the pom itself be just turning it off:

    <pluginRepositories>
        <pluginRepository>
            <!-- we force maven to use our company repo this way! -->
            <id>central</id>
            <name>apache maven.central repository</name>
            <url>http://invalid.com</url>
            <!-- disable the maven.central repo -->
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
 ....

    <repositories>
        <repository>
            <!-- we force maven to use our company repo this way! -->
            <id>central</id>
            <name>apache maven.central repository</name>
            <url>http://invalid.com</url>
            <!-- disable the maven.central repo -->
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
...


The trick is that 'central' is the fixed ID of the maven central repository [1]. By overwriting it in your own parent pom, you will not use the central repository anymore and all request will get routed via your company repo manager.

Any all you need is a bit of code in your pom - no ugly touching the global settings.xml anymore.

LieGrue,
strub


[1] http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
--- On Fri, 7/8/11, Brian Fox <br...@infinity.nu> wrote:

> From: Brian Fox <br...@infinity.nu>
> Subject: Re: A problem with mirrors
> To: "Maven Developers List" <de...@maven.apache.org>
> Date: Friday, July 8, 2011, 8:25 PM
> What about the * bit you? Does the
> external:* fix it for you?
> 
> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com>
> wrote:
> > This doc works:
> >
> > http://maven.apache.org/guides/mini/guide-mirror-settings.html
> >
> > FWIW.
> >
> > On Wed, Jul 6, 2011 at 10:18 PM, Barrie Treloar <ba...@gmail.com>
> wrote:
> >> On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies
> <bi...@gmail.com>
> wrote:
> >>> In our corporate global settings file, we
> have:
> >>>
> >>>  <mirror>
> >>>      <id>Nexus</id>
> >>>      <name>Nexus Mirror</name>
> >>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
> >>>    
>  <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
> >>>    </mirror>
> >>>
> >>> That * turns out to be a very bad idea, and
> I'd like some advice in
> >>> fixing maven to make it a less bad idea.
> >>>
> >>
> >> I hear ya, +1 and thanks for looking at it, I get
> bitten often too.
> >> I can't help with where to look though.
> >>
> >> While you are looking at it can you see about
> updating the documentation?
> >> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
> >>
> >> It current says
> >>  mirrorOf       String          The
> server ID of the repository being
> >> mirrored, eg "central". This MUST NOT match the
> mirror id.
> >> which says nothing about * or ! being special
> syntax.
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

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


Re: A problem with mirrors

Posted by Brian Fox <br...@infinity.nu>.
What about the * bit you? Does the external:* fix it for you?

On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
> This doc works:
>
> http://maven.apache.org/guides/mini/guide-mirror-settings.html
>
> FWIW.
>
> On Wed, Jul 6, 2011 at 10:18 PM, Barrie Treloar <ba...@gmail.com> wrote:
>> On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies <bi...@gmail.com> wrote:
>>> In our corporate global settings file, we have:
>>>
>>>  <mirror>
>>>      <id>Nexus</id>
>>>      <name>Nexus Mirror</name>
>>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>>>      <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>>>    </mirror>
>>>
>>> That * turns out to be a very bad idea, and I'd like some advice in
>>> fixing maven to make it a less bad idea.
>>>
>>
>> I hear ya, +1 and thanks for looking at it, I get bitten often too.
>> I can't help with where to look though.
>>
>> While you are looking at it can you see about updating the documentation?
>> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
>>
>> It current says
>>  mirrorOf       String          The server ID of the repository being
>> mirrored, eg "central". This MUST NOT match the mirror id.
>> which says nothing about * or ! being special syntax.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: A problem with mirrors

Posted by Benson Margulies <bi...@gmail.com>.
This doc works:

http://maven.apache.org/guides/mini/guide-mirror-settings.html

FWIW.

On Wed, Jul 6, 2011 at 10:18 PM, Barrie Treloar <ba...@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies <bi...@gmail.com> wrote:
>> In our corporate global settings file, we have:
>>
>>  <mirror>
>>      <id>Nexus</id>
>>      <name>Nexus Mirror</name>
>>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>>      <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>>    </mirror>
>>
>> That * turns out to be a very bad idea, and I'd like some advice in
>> fixing maven to make it a less bad idea.
>>
>
> I hear ya, +1 and thanks for looking at it, I get bitten often too.
> I can't help with where to look though.
>
> While you are looking at it can you see about updating the documentation?
> http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror
>
> It current says
>  mirrorOf       String          The server ID of the repository being
> mirrored, eg "central". This MUST NOT match the mirror id.
> which says nothing about * or ! being special syntax.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: A problem with mirrors

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Jul 7, 2011 at 11:32 AM, Benson Margulies <bi...@gmail.com> wrote:
> In our corporate global settings file, we have:
>
>  <mirror>
>      <id>Nexus</id>
>      <name>Nexus Mirror</name>
>      <url>http://maven.basistech.net/nexus/content/groups/public</url>
>      <mirrorOf>*,!apache.org,!sonar,!apache.snapshots</mirrorOf>
>    </mirror>
>
> That * turns out to be a very bad idea, and I'd like some advice in
> fixing maven to make it a less bad idea.
>

I hear ya, +1 and thanks for looking at it, I get bitten often too.
I can't help with where to look though.

While you are looking at it can you see about updating the documentation?
http://maven.apache.org/ref/3.0.3/maven-settings/settings.html#class_mirror

It current says
  mirrorOf   	 String   	 The server ID of the repository being
mirrored, eg "central". This MUST NOT match the mirror id.
which says nothing about * or ! being special syntax.

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