On 3 Oct 2013, at 14:31, NRO wrote:

> Thanks for the clear explanation.
> 
> All our artifacts are served by our Nexus Repository Manager (external and
> internal).
> All our repositories (hosted and proxy) are managed by Nexus, this is why
> our settings.xml and parent poms does not need to refer to other
> repositories because we want to control all from Nexus.
> 
> So declaring a fake snapshot repository will help Maven re-route resolution
> to a parent pom...
> 
> BTW if you replace the snapshot parent by a release version, the same
> problem appear despite the maven central in super pom...

This isn't what I see locally using the same poms as below, with the parent 
version set to a release it will attempt to fetch it:

        ...snip...
        Downloading: 
http://repo.maven.apache.org/maven2/a/b/c/parente/0.0.1/parente-0.0.1.pom

Repeating the same test using a mirror (and clearing the local repository of 
any cached records about the pom, see below):

        ...snip...
        Downloading: 
https://some.repo.manager/content/groups/some.group/a/b/c/parente/0.0.1/parente-0.0.1.pom

Note that Maven will record failed attempts to fetch releases in your local 
repository:

        [ERROR] Non-resolvable parent POM: Failure to find 
a.b.c:parente:pom:0.0.1 in http://repo.maven.apache.org/maven2 was cached in 
the local repository,
                resolution will not be reattempted until the update interval of 
central has elapsed or updates are forced and 'parent.relativePath' points at 
wrong local POM @ line 7, column 10 -> [Help 2]

and will not attempt to fetch the release again until the update interval 
elapses (default is daily) or you use -U to force it to re-check.

> Again adding the fake repository helps solving the case.
> 
> I am still not convinced it is a feature ;-)

Since there is no snapshot repository defined in the current pom.xml, 
settings.xml, or Maven super-pom - and the relativePath doesn't lead to the 
parent pom - how should Maven know where to fetch it?

I guess you could say that defining a mirror in your settings.xml should add an 
implicit snapshot repository definition, but how would you remove such a 
repository definition if you didn't want it? Because each snapshot repository 
is queried separately, if you then defined additional snapshot repositories 
then you could end up with multiple queries going through the mirror. In a way 
this all comes back to the fact that mirror != repository and I'm not sure that 
mixing these concepts by adding implicit repositories based on mirror 
definitions is a good thing - especially when there's a simple solution 
(declare the repository in settings.xml) that captures the intent and would 
also work when not mirroring.

(just my 2 sen)

> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Parent-SNAPSHOT-not-resolved-Maven-2-2-1-3-0-4-Nexus-repo-tp5772374p5772386.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 


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

Reply via email to