maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kek (JIRA)" <j...@codehaus.org>
Subject [jira] (MNG-5682) Parent POMs not resolved in multi-module project
Date Tue, 26 Aug 2014 19:35:10 GMT

    [ https://jira.codehaus.org/browse/MNG-5682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=351875#comment-351875
] 

Kek commented on MNG-5682:
--------------------------

Thank you for your tip, but my problem has a little different project structure.  
The parent project is on the same level as submodules B and C. And all projects  A, PARENT,
B, and C have the same groupId and version.
The maven build was executed from project "A"  - root of the structure.

My inheritance structure is:
{noformat}
A<--parent<--B
                 <--C
{noformat}
and submodules structure
{noformat}
A<>--parent
 <>--B
 <>--C
{noformat}

Today I found possible workaround/solution for this structure is to set "relativePath" on
"B" and "C" to  "../parent/pom.xml".

In my opinion Maven 2.x  adds all projects to reactor and makes build in order "A", "parent",
"B", "C"   - the "A" is build and installed in local repository first, so than could be resolved
as parent for "parent", than "parent" is build and installed in local repository and could
be resolved for "B" and "C" as parent project.
This corresponds to specification in http://maven.apache.org/ref/3-LATEST/maven-model/maven.html#class_parent
??Maven looks for the parent POM first in this location on the filesystem, then the local
repository, and lastly in the remote repo. ...??

But  Maven 3.x  resolves the <parent>  specification first, without build of "A", "parent"
 - so it must throw Error, because  relativePath is not specified and projects "A","parent"
are not build and installed into local repository  - so could not be resolved. 

Is this backward incompatibility between Maven 2.x and 3.x feature or bug ?


> Parent POMs not resolved in multi-module project
> ------------------------------------------------
>
>                 Key: MNG-5682
>                 URL: https://jira.codehaus.org/browse/MNG-5682
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap & Build
>    Affects Versions: 3.0.4, 3.1.1, 3.2.3
>         Environment: Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T22:58:10+02:00)
> Java version: 1.7.0_67, vendor: Oracle Corporation
> Default locale: en_US, platform encoding: Cp1250
> OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
>            Reporter: Kek
>            Priority: Critical
>         Attachments: test-project.zip
>
>
> I have multi-module project - I attach the similar simple project structure to this issue,
to simulate the problem =>  !test-project.zip!.
> The structure is:
> {noformat}
> A    - aggregating project, parent for "parent"
>  |_parent  - parent for B and C
>  |_B
>  |_C
> {noformat}
> In reality we have more parents under A for diferent types of A-submodules, but now it
does not matter.
> When we run build under maven 2.2.1  - everything is OK, the reactor sorts the projects
like  A, PARENT, B,C and build success.
> When we run the same build under maven 3.x  (3.0.4, 3.1.1, 3.2.3 was tested), the build
fails with following errors:
> a>mvn clean
> [INFO] Scanning for projects...
> [ERROR] The build could not read 2 projects -> [Help 1]
> [ERROR]
> [ERROR]   The project a:b:[unknown-version] (\a\b\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM: Could not find artifact a:parent:pom:0.0.1-SNAPSHOT
and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2]
> [ERROR]
> [ERROR]   The project a:c:[unknown-version] (\a\c\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM: Could not find artifact a:parent:pom:0.0.1-SNAPSHOT
and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please read the
following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
> There is no explicit "relativePath" set in project POMs.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message