Hi Florian,
since testing your problem I've some trouble with my workspace ;-)
I'm not understanding the behavior (of my ws) yet!
I'm using m3, there your problem seems to be fixed.
So it looks more like a bug than a feature!
Fredy
#####################################################################################
Maven 2.2.1:
#####################################################################################
C:\temp\pom-dep-problem>D:\IDE\apache-maven-2.2.1\bin\mvn.bat -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_21
Java home: C:\Program Files\Java\jdk1.6.0_21\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
C:\temp\pom-dep-problem>D:\IDE\apache-maven-2.2.1\bin\mvn.bat clean package
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Unnamed - mygroup:parent:pom:1.0-SNAPSHOT
[INFO] Unnamed - mygroup:A:pom:1.0-SNAPSHOT
[INFO] Unnamed - mygroup:B:jar:1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - mygroup:parent:pom:1.0-SNAPSHOT
[INFO] task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - mygroup:A:pom:1.0-SNAPSHOT
[INFO] task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - mygroup:B:jar:1.0-SNAPSHOT
[INFO] task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\temp\pom-dep-problem\B\src\main\resources
Downloading:
http://xxx:8180/px-webapp/repository/jboss.org.snapshot/mygroup/A/1.0-SNAPSHOT/A-1.0-SNAPSHOT.pom
[INFO] Unable to find resource 'mygroup:A:pom:1.0-SNAPSHOT' in repository
jboss.snapshots (http://xxx:8180/px-webapp/repository/jboss.org.snapshot)
Downloading:
http://xxx:8180/px-webapp/repository/xxx.snapshot/mygroup/A/1.0-SNAPSHOT/A-1.0-SNAPSHOT.pom
[INFO] Unable to find resource 'mygroup:A:pom:1.0-SNAPSHOT' in repository
xxx.snapshots (http://xxx:8180/px-webapp/repository/xxx.snapshot)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) mygroup:A:pom:1.0-SNAPSHOT
Path to dependency:
1) mygroup:B:jar:1.0-SNAPSHOT
2) mygroup:A:pom:1.0-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
mygroup:B:jar:1.0-SNAPSHOT
from the specified remote repositories:
xxx.snapshots (http://xxx:8180/px-webapp/repository/xxx.snapshot),
jboss.org (http://xxx:8180/px-webapp/repository/jboss.org),
jboss.snapshots (http://xxx:8180/px-webapp/repository/jboss.org.snapshot),
xxx (http://xxx:8180/px-webapp/repository/xxx),
xxx_public (http://xxx:8180/px-webapp/repository/public)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Dec 20 09:22:57 CET 2010
[INFO] Final Memory: 12M/28M
[INFO] ------------------------------------------------------------------------
#####################################################################################
Maven 3.0:
#####################################################################################
C:\temp\pom-dep-problem>mvn -version
Apache Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)
Java version: 1.6.0_21
Java home: C:\Program Files\Java\jdk1.6.0_21\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
C:\temp\pom-dep-problem>mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent
[INFO] A
[INFO] B
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building parent 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ parent ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building A 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ A ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building B 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ B ---
[INFO] Deleting C:\temp\pom-dep-problem\B\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ B ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\temp\pom-dep-problem\B\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ B ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
B ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\temp\pom-dep-problem\B\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ B ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ B ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ B ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\temp\pom-dep-problem\B\target\B-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent ............................................ SUCCESS [0.157s]
[INFO] A ................................................. SUCCESS [0.000s]
[INFO] B ................................................. SUCCESS [1.297s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.609s
[INFO] Finished at: Mon Dec 20 09:20:05 CET 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
Fredy
-----Ursprüngliche Nachricht-----
Von: Florian Rampp [mailto:[email protected]]
Gesendet: Freitag, 17. Dezember 2010 14:37
An: Maven Users List
Betreff: AW: AW: Dependency on pom-project not resolved in reactor on
multi-module build
I am using Maven version 2.2.1. That is also a thing that I should have
mentioned.
mvn --version:
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: en_US, platform
encoding: UTF-8 OS name: "linux" version: "2.6.32-27-generic" arch: "amd64"
Family: "unix"
Attached you find a ZIP file containing the basic setup.
Maybe this helps to reproduce the error.
We have a Nexus set up here, that is configured in the settings.xml. But this
should not make any big difference. Beyond that, there are not Maven profiles
configured.
Thanks a lot,
Florian
--
Florian Rampp, Software Architect
Phone: +49.89.45 23 47-64
-----Ursprüngliche Nachricht-----
Von: Hauschel Fred Robert [mailto:[email protected]]
Gesendet: Freitag, 17. Dezember 2010 13:39
An: Maven Users List
Betreff: AW: AW: Dependency on pom-project not resolved in reactor on
multi-module build
So I can't see a difference to my test, expecting
<version>${project.version}</version>
I've used
<version>${parent.version}</version>
Can't imagine, that that is a difference, but who knows!
Fredy
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>parent</artifactId>
<groupId>mygroup</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>B</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>A</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
-----Ursprüngliche Nachricht-----
Von: Florian Rampp [mailto:[email protected]]
Gesendet: Freitag, 17. Dezember 2010 13:31
An: Maven Users List
Betreff: AW: AW: Dependency on pom-project not resolved in reactor on
multi-module build
Yes, I have. See my first mail for the content of A/pom.xml and B/pom.xml
Florian
--
Florian Rampp, Software Architect
Phone: +49.89.45 23 47-64
-----Ursprüngliche Nachricht-----
Von: Hauschel Fred Robert [mailto:[email protected]]
Gesendet: Freitag, 17. Dezember 2010 13:12
An: Maven Users List
Betreff: AW: AW: Dependency on pom-project not resolved in reactor on
multi-module build
Hello Florian,
have you defined the <type>pom</type> ??
<dependencies>
<dependency>
<groupId>mygroup</groupId>
<artifactId>A</artifactId>
<version>${parent.version}</version>
<type>pom</type>
</dependency>
Fredy
-----Ursprüngliche Nachricht-----
Von: Florian Rampp [mailto:[email protected]]
Gesendet: Freitag, 17. Dezember 2010 12:42
An: [email protected]
Betreff: Re: AW: Dependency on pom-project not resolved in reactor on
multi-module build
Hello Freddy,
Thanks for your quick reply. I should have mentioned that mvn installs solves
the problem. So Maven resolves the dependency from the local repository. But
this is just a workaround since I expect the dependency to be resolved from the
reactor.
I think the order in which the modules are listed in the parent POM is not
important. If I change the order this does not affect the behavior. Here is the
parent POM:
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>A</module>
<module>B</module>
</modules>
</project>
The reactor build order is correct:
[INFO] Reactor build order:
[INFO] Unnamed - mygroup:parent:pom:1.0-SNAPSHOT
[INFO] Unnamed - mygroup:A:pom:1.0-SNAPSHOT
[INFO] Unnamed - mygroup:B:jar:1.0-SNAPSHOT
It seems to be a bug or at least unexpected behavior in Maven.
Thanks a lot,
Florian
P.S: If this mail does not appear as response on the first thread, I am sorry.
My mistake.
--
jambit Software Development & Management GmbH Nymphenburger Straße 13-15,
D-80335 München
Phone: +49.89.45 23 47-0 Fax: +49.89.45 23 47-70
http://www.jambit.com where innovation works
Geschäftsführer: Peter F. Fellinger, Markus Hartinger
Sitz: München; Registergericht: München, HRB 129139
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]