Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0
-
None
-
maven 3.0, windows XP
Description
I'll attach a zipped sample showing the issue; it has 3 folders, each having a small pom. They are named childFolder, parentFolder, and submodule.
The child has the parent as its parent.
The child has a <modules> section listing the parent and the submodule as things to be built.
The submodule list "parent" as its parent, but fails (on purpose, to illustrate the issue) to include a <relativePath> element.
If I do mvn clean on the "submodule", it says, correctly:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project t:submodule:1-SNAPSHOT (D:\mavenAlign\trunk\mvn-parent-relative-path\submodule\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact t:parent:pom:1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 8, column 11 -> [Help 2]
Note: line 8, column 11 is right after the "<parent>" element in the source.
But, if I run mvn clean on the "child", it says, incorrectly:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project t:child:1-SNAPSHOT (D:\mavenAlign\trunk\mvn-parent-relative-path\childFolder\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact t:parent:pom:1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
In fact, the ...\childFolder\pom.xml doesn't have an error, and the message that it points at the wrong local POM at line 5, column 11 is not correct. If you comment out the <module> reference in this pom to the "submodule", it works fine. The error is actually in the submodule. The line 5, column 11 refers to a spot right after the "<parent>" element in the child module, where everything is OK.
This of course, misleads the person trying to debug this, to look hard in the wrong place .