maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé Boutemy (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MNG-5763) Incorrect resolution of ${project.groupId} for POM imports with different groupIds
Date Sat, 10 Oct 2015 09:05:05 GMT

    [ https://issues.apache.org/jira/browse/MNG-5763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14951734#comment-14951734
] 

Hervé Boutemy commented on MNG-5763:
------------------------------------

this is not a bug, this is a consequence of model interpolation (ie $\{..} interpretation)
happens after inheritance assembly
see reference documentation http://maven.apache.org/ref/current/maven-model-builder/

during inheritance assembly, the unevaluated $\{...} is inherited, then evaluation (= model
interpolation) happens with current context, not context of the parent pom

During ApacheCON, last week, Robert Scholte shared the idea of creating $\{this.*} syntax
to evaluate before inheritance (no MNG issue at the moment AFAIK): this would give you the
effect you're expecting currently

but such feature would not be backward compatible, then I suppose we'll need to see when we
can implement it without wrecking havoc in central...

I'll close the issue as "not a bug"

> Incorrect resolution of ${project.groupId} for POM imports with different groupIds
> ----------------------------------------------------------------------------------
>
>                 Key: MNG-5763
>                 URL: https://issues.apache.org/jira/browse/MNG-5763
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap & Build, Dependencies
>    Affects Versions: 3.1.1
>         Environment: Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17
17:22:22+0200)
> Java version: 1.7.0_67, vendor: Oracle Corporation
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Daniel Strassenburg
>         Attachments: myproject.zip
>
>
> In the attached project find a sample which causes Maven to fail when resolving POM imports.
The property {{$\{project.groupId\}}} is resolved incorrectly when
> # the imported modules have a different groupId
> # the imported POMs come from a submodule where one submodule containing a BOM POM has
another groupId
> The groupIds of all other POM imports are changed to the groupId of the third BOM.
> Console output:
> {code}
> $ mvn install
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project com.mycompany.myproject.submodule:other-extension:1.0-SNAPSHOT
(C:\dev\myproject\other-extension\pom.xml) has 2 errors
> [ERROR]     Non-resolvable import POM: Failure to find com.mycompany.myproject.submodule:bom-1:pom:1.0-SNAPSHOT
in http://repository-build.coremedia.com/nexus/content/repositories/snapshots.licenses/ was
cached in the local repository, resolution will not be reattempted until the update interval
of coremedia.internal.licenses has elapsed or updates are forced @ com.mycompany.myproject:myroot:1.0-SNAPSHOT,
C:\dev\myproject\pom.xml, line 19, column 19 -> [Help 2]
> [ERROR]     Non-resolvable import POM: Failure to find com.mycompany.myproject.submodule:bom-2:pom:1.0-SNAPSHOT
in http://repository-build.coremedia.com/nexus/content/repositories/snapshots.licenses/ was
cached in the local repository, resolution will not be reattempted until the update interval
of coremedia.internal.licenses has elapsed or updates are forced @ com.mycompany.myproject:myroot:1.0-SNAPSHOT,
C:\dev\myproject\pom.xml, line 26, column 19 -> [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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message