maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <>
Subject Re: Parent SNAPSHOT not resolved Maven 2.2.1 - 3.0.4 - (Nexus repo)
Date Thu, 03 Oct 2013 12:46:36 GMT
The scenario described below fails for me with or without a mirror setting - as I would expect
it to.

Given a child project with a missing parent pom Maven will attempt to resolve the parent given
the available context, namely:

	current pom.xml
	Maven's super-pom

If neither the settings.xml nor the current pom.xml define a snapshot repository then the
only repository definition is from Maven's default super-pom:

      <name>Central Repository</name>

which clearly disables snapshots.

Defining a mirror in your settings.xml does not change repository definitions, as Tamas mentioned
before all it does is re-route requests via the mirror. Therefore since there are no repositories
defined with snapshots enabled, Maven will not request to fetch the parent pom snapshot. But
if you add a snapshot repository definition somewhere (settings.xml or current pom.xml) then
Maven will respect that and request the parent pom snapshot from that repository. If you have
a mirror in your settings.xml then that request will be routed via the server defined in the

Note that Maven will also attempt to use the parent relativePath definition from the current
pom to attempt to find the parent pom on disk - so assuming the default relativePath, Maven
would also be able to find the parent pom if it was located in the parent directory relative
to the child (../pom.xml).

The same thing is true of snapshot dependencies - if none of your settings.xml, pom.xml, or
any pom in the hierarchy define a snapshot repository then Maven will not have anywhere it
could request the snapshot from, regardless of the mirror definition (as mirror != repository).
Only if the snapshot dependency was available somewhere in the reactor (the effective plan
of the build on disk) would Maven be able to resolve the snapshot.


On 3 Oct 2013, at 13:22, NRO wrote:

> Ok, lets talk with a concrete simple example:
> <project xmlns=""
> xmlns:xsi=""
> xsi:schemaLocation="
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>a.b.c</groupId>
>  <artifactId>parente</artifactId>
>  <version>0.0.1-SNAPSHOT</version>
>  <packaging>pom</packaging>
>  <name>parente</name>
>  <description>ddd</description>
> 	<distributionManagement>
> 		<repository>
> 			<id>internal.project.release</id>
> 			<name>internal.project.release</name>
> 			<url>${maven2Repository_projet}/project_release</url>
> 		</repository>
> 		<snapshotRepository>
> 			<id>internal.project.snapshot</id>
> 			<name>internal.project.snapshot</name>
> 			<url>${maven2Repository_projet}/project_snapshot</url>
> 		</snapshotRepository>
> 		<site>
> 			<id>projects_Website</id>
> <url>${projects_Website}/cti/melusine/${project.artifactId}/${project.version}</url>
> 		</site>
> 	</distributionManagement>
> </project>
> ---------------------------------------------------
> <project xmlns=""
> xmlns:xsi=""
> xsi:schemaLocation="
>  <modelVersion>4.0.0</modelVersion>
>  <parent>
>    <groupId>a.b.c</groupId>
>    <artifactId>parente</artifactId>
>    <version>0.0.1-SNAPSHOT</version>
>  </parent>
>  <groupId>a.c</groupId>
>  <artifactId>deleteme</artifactId>
>  <version>0.0.1-SNAPSHOT</version>
>  <name>aaa</name>
>  <description>bbb</description>
> </project>
> -----------------------------------------------------
> These very simple Poms demonstrate the problem.
> You need to deply parent first and then delete parent from local repo and
> then try building child.
> As you notice there are no SNAPSHOT repository declaration nowhere.
> Distibution managment is a separate thing in the parent itself.
> --
> View this message in context:
> Sent from the Maven - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message