You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Vincent Beretti <vb...@gmail.com> on 2009/03/02 17:36:37 UTC

Use mirror in parent snapshot inheritance

Hi all,
let's consider the following project :
A
|----  B
|----  C

A is the parent pom of B. In A, I define the repository location of our
entreprise repository.
A is a currently in a snapshot version so in B's pom.xml I have :
<parent>
  <groupId>com.xxx</groupId>
  <artifactId>A</artifactId>
  <version>1.0-SNAPSHOT</version>
<parent>

So when I checkout A and build it from A or B, the build is successfull.
But let's consider I only want to checkout B, because I don't want to
checkout all C project sources.
When I run an install on B project (A is not available through filesystem in
the upper directory or in my local repository as a 1.0-SNAPSHOT version),
the build fails saying that it can not find the artifact A with version
1.0-SNAPSHOT. This should be normal because it can not find the location of
our entreprise repository because it is defined in project A.
So I defined a mirror, that for all requests (<mirror-of>*<mirror-of>)
forward to our entreprise repository for all artifacts (releases and
snapshots).
It is still not working.

I saw this issue :
http://jira.codehaus.org/browse/MNG-943
It seems to be the reason why I can't retrieve the snapshots version of my
artifact A. It is really blocking for big projects.
How can I bypass this limitation ?
Can we correct this limitation and allow retrieval of snapshots artifacts ?

Thanks,
Vincent Beretti.

Re: Use mirror in parent snapshot inheritance

Posted by Vincent Beretti <vb...@gmail.com>.
Thanks it's working perfectly now

On Tue, Mar 3, 2009 at 5:21 PM, Brian E. Fox <br...@reply.infinity.nu>wrote:

> Sounds like you have no snapshot repositories enabled in the settings.
> In our sample settings, we show overloading central to enabled
> snapshots. The mirror then directs this to nexus which will find it. If
> maven sees no snapshot repo enabled, it doesn't even try to find it
> externally.
>
> See here:
> http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-gro
> up.html<http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-gro%0Aup.html>
>
> -----Original Message-----
> From: Vincent Beretti [mailto:vberetti@gmail.com]
> Sent: Tuesday, March 03, 2009 3:19 AM
> To: Maven Users List
> Subject: Re: Use mirror in parent snapshot inheritance
>
> Thanks for the answer.
> I look at the blog article. In fact, we use mirror definition in
> settings.xml. This is the only way for B to grab A from our Nexus
> repository.
> The problem is that when A is not in our local repository, B is not able
> to
> grab A in nexus if A is a snapshot version.
> The mirror is defined for everything (<mirrorOf>*</mirrorOf>) but it
> seems
> that it only search for release version and not for snapshots.
> Is it a wanted restriction or a bug ?
> I don't really understand Brett Porter's answer in
> http://jira.codehaus.org/browse/MNG-943, because if the "a single POM
> for
> the company that is the "root" that all projects inherit from" is a
> snapshot
> version, sub modules won't be able to find it.
>
> Thanks,
> Vincent.
>
> On Mon, Mar 2, 2009 at 7:57 PM, Brian E. Fox
> <br...@reply.infinity.nu>wrote:
>
> > You might want to take a look at this:
> >
> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-
> >
> poms-is-a-bad-idea/<http://www.sonatype.com/people/2009/02/why-putting-r
> epositories-in-your-%0Apoms-is-a-bad-idea/<http://www.sonatype.com/people/2009/02/why-putting-r%0Aepositories-in-your-%0Apoms-is-a-bad-idea/>
> >
> >
> > -----Original Message-----
> > From: Vincent Beretti [mailto:vberetti@gmail.com]
> > Sent: Monday, March 02, 2009 11:37 AM
> > To: users@maven.apache.org
> > Subject: Use mirror in parent snapshot inheritance
> >
> > Hi all,
> > let's consider the following project :
> > A
> > |----  B
> > |----  C
> >
> > A is the parent pom of B. In A, I define the repository location of
> our
> > entreprise repository.
> > A is a currently in a snapshot version so in B's pom.xml I have :
> > <parent>
> >  <groupId>com.xxx</groupId>
> >  <artifactId>A</artifactId>
> >  <version>1.0-SNAPSHOT</version>
> > <parent>
> >
> > So when I checkout A and build it from A or B, the build is
> successfull.
> > But let's consider I only want to checkout B, because I don't want to
> > checkout all C project sources.
> > When I run an install on B project (A is not available through
> > filesystem in
> > the upper directory or in my local repository as a 1.0-SNAPSHOT
> > version),
> > the build fails saying that it can not find the artifact A with
> version
> > 1.0-SNAPSHOT. This should be normal because it can not find the
> location
> > of
> > our entreprise repository because it is defined in project A.
> > So I defined a mirror, that for all requests (<mirror-of>*<mirror-of>)
> > forward to our entreprise repository for all artifacts (releases and
> > snapshots).
> > It is still not working.
> >
> > I saw this issue :
> > http://jira.codehaus.org/browse/MNG-943
> > It seems to be the reason why I can't retrieve the snapshots version
> of
> > my
> > artifact A. It is really blocking for big projects.
> > How can I bypass this limitation ?
> > Can we correct this limitation and allow retrieval of snapshots
> > artifacts ?
> >
> > Thanks,
> > Vincent Beretti.
> >
> > ---------------------------------------------------------------------
> > 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: Use mirror in parent snapshot inheritance

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Sounds like you have no snapshot repositories enabled in the settings.
In our sample settings, we show overloading central to enabled
snapshots. The mirror then directs this to nexus which will find it. If
maven sees no snapshot repo enabled, it doesn't even try to find it
externally.

See here:
http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-gro
up.html

-----Original Message-----
From: Vincent Beretti [mailto:vberetti@gmail.com] 
Sent: Tuesday, March 03, 2009 3:19 AM
To: Maven Users List
Subject: Re: Use mirror in parent snapshot inheritance

Thanks for the answer.
I look at the blog article. In fact, we use mirror definition in
settings.xml. This is the only way for B to grab A from our Nexus
repository.
The problem is that when A is not in our local repository, B is not able
to
grab A in nexus if A is a snapshot version.
The mirror is defined for everything (<mirrorOf>*</mirrorOf>) but it
seems
that it only search for release version and not for snapshots.
Is it a wanted restriction or a bug ?
I don't really understand Brett Porter's answer in
http://jira.codehaus.org/browse/MNG-943, because if the "a single POM
for
the company that is the "root" that all projects inherit from" is a
snapshot
version, sub modules won't be able to find it.

Thanks,
Vincent.

On Mon, Mar 2, 2009 at 7:57 PM, Brian E. Fox
<br...@reply.infinity.nu>wrote:

> You might want to take a look at this:
>
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-
>
poms-is-a-bad-idea/<http://www.sonatype.com/people/2009/02/why-putting-r
epositories-in-your-%0Apoms-is-a-bad-idea/>
>
> -----Original Message-----
> From: Vincent Beretti [mailto:vberetti@gmail.com]
> Sent: Monday, March 02, 2009 11:37 AM
> To: users@maven.apache.org
> Subject: Use mirror in parent snapshot inheritance
>
> Hi all,
> let's consider the following project :
> A
> |----  B
> |----  C
>
> A is the parent pom of B. In A, I define the repository location of
our
> entreprise repository.
> A is a currently in a snapshot version so in B's pom.xml I have :
> <parent>
>  <groupId>com.xxx</groupId>
>  <artifactId>A</artifactId>
>  <version>1.0-SNAPSHOT</version>
> <parent>
>
> So when I checkout A and build it from A or B, the build is
successfull.
> But let's consider I only want to checkout B, because I don't want to
> checkout all C project sources.
> When I run an install on B project (A is not available through
> filesystem in
> the upper directory or in my local repository as a 1.0-SNAPSHOT
> version),
> the build fails saying that it can not find the artifact A with
version
> 1.0-SNAPSHOT. This should be normal because it can not find the
location
> of
> our entreprise repository because it is defined in project A.
> So I defined a mirror, that for all requests (<mirror-of>*<mirror-of>)
> forward to our entreprise repository for all artifacts (releases and
> snapshots).
> It is still not working.
>
> I saw this issue :
> http://jira.codehaus.org/browse/MNG-943
> It seems to be the reason why I can't retrieve the snapshots version
of
> my
> artifact A. It is really blocking for big projects.
> How can I bypass this limitation ?
> Can we correct this limitation and allow retrieval of snapshots
> artifacts ?
>
> Thanks,
> Vincent Beretti.
>
> ---------------------------------------------------------------------
> 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: Use mirror in parent snapshot inheritance

Posted by Vincent Beretti <vb...@gmail.com>.
Thanks for the answer.
I look at the blog article. In fact, we use mirror definition in
settings.xml. This is the only way for B to grab A from our Nexus
repository.
The problem is that when A is not in our local repository, B is not able to
grab A in nexus if A is a snapshot version.
The mirror is defined for everything (<mirrorOf>*</mirrorOf>) but it seems
that it only search for release version and not for snapshots.
Is it a wanted restriction or a bug ?
I don't really understand Brett Porter's answer in
http://jira.codehaus.org/browse/MNG-943, because if the "a single POM for
the company that is the "root" that all projects inherit from" is a snapshot
version, sub modules won't be able to find it.

Thanks,
Vincent.

On Mon, Mar 2, 2009 at 7:57 PM, Brian E. Fox <br...@reply.infinity.nu>wrote:

> You might want to take a look at this:
> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-
> poms-is-a-bad-idea/<http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-%0Apoms-is-a-bad-idea/>
>
> -----Original Message-----
> From: Vincent Beretti [mailto:vberetti@gmail.com]
> Sent: Monday, March 02, 2009 11:37 AM
> To: users@maven.apache.org
> Subject: Use mirror in parent snapshot inheritance
>
> Hi all,
> let's consider the following project :
> A
> |----  B
> |----  C
>
> A is the parent pom of B. In A, I define the repository location of our
> entreprise repository.
> A is a currently in a snapshot version so in B's pom.xml I have :
> <parent>
>  <groupId>com.xxx</groupId>
>  <artifactId>A</artifactId>
>  <version>1.0-SNAPSHOT</version>
> <parent>
>
> So when I checkout A and build it from A or B, the build is successfull.
> But let's consider I only want to checkout B, because I don't want to
> checkout all C project sources.
> When I run an install on B project (A is not available through
> filesystem in
> the upper directory or in my local repository as a 1.0-SNAPSHOT
> version),
> the build fails saying that it can not find the artifact A with version
> 1.0-SNAPSHOT. This should be normal because it can not find the location
> of
> our entreprise repository because it is defined in project A.
> So I defined a mirror, that for all requests (<mirror-of>*<mirror-of>)
> forward to our entreprise repository for all artifacts (releases and
> snapshots).
> It is still not working.
>
> I saw this issue :
> http://jira.codehaus.org/browse/MNG-943
> It seems to be the reason why I can't retrieve the snapshots version of
> my
> artifact A. It is really blocking for big projects.
> How can I bypass this limitation ?
> Can we correct this limitation and allow retrieval of snapshots
> artifacts ?
>
> Thanks,
> Vincent Beretti.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Use mirror in parent snapshot inheritance

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You might want to take a look at this:
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-
poms-is-a-bad-idea/

-----Original Message-----
From: Vincent Beretti [mailto:vberetti@gmail.com] 
Sent: Monday, March 02, 2009 11:37 AM
To: users@maven.apache.org
Subject: Use mirror in parent snapshot inheritance

Hi all,
let's consider the following project :
A
|----  B
|----  C

A is the parent pom of B. In A, I define the repository location of our
entreprise repository.
A is a currently in a snapshot version so in B's pom.xml I have :
<parent>
  <groupId>com.xxx</groupId>
  <artifactId>A</artifactId>
  <version>1.0-SNAPSHOT</version>
<parent>

So when I checkout A and build it from A or B, the build is successfull.
But let's consider I only want to checkout B, because I don't want to
checkout all C project sources.
When I run an install on B project (A is not available through
filesystem in
the upper directory or in my local repository as a 1.0-SNAPSHOT
version),
the build fails saying that it can not find the artifact A with version
1.0-SNAPSHOT. This should be normal because it can not find the location
of
our entreprise repository because it is defined in project A.
So I defined a mirror, that for all requests (<mirror-of>*<mirror-of>)
forward to our entreprise repository for all artifacts (releases and
snapshots).
It is still not working.

I saw this issue :
http://jira.codehaus.org/browse/MNG-943
It seems to be the reason why I can't retrieve the snapshots version of
my
artifact A. It is really blocking for big projects.
How can I bypass this limitation ?
Can we correct this limitation and allow retrieval of snapshots
artifacts ?

Thanks,
Vincent Beretti.

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