You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Schulte (JIRA)" <ji...@apache.org> on 2016/02/13 18:43:18 UTC

[jira] [Closed] (MNG-5908) Properties in imported poms are resolved inconsistently

     [ https://issues.apache.org/jira/browse/MNG-5908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schulte closed MNG-5908.
----------------------------------
    Resolution: Won't Fix

The import scope feature is meant to be used to import from another reactor. There is no relation between an imported pom and the reactor it is imported into intentionally. When importing, the complete model to import is built (inheritance, interpolation, etc.) and the result is then imported. The command line property overrides the pom property. That's why that makes a difference here.

> Properties in imported poms are resolved inconsistently
> -------------------------------------------------------
>
>                 Key: MNG-5908
>                 URL: https://issues.apache.org/jira/browse/MNG-5908
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.3
>            Reporter: Emond Papegaaij
>         Attachments: import-with-properties.tar.bz2
>
>
> Properties in an imported pom are resolved in the inheritance chain of the import itself and can only be overridden via de commandline. The attached example project demonstrates the problem.
> Layout:
>  * {{test-parent}} defines 3 modules and a property for the slf4j version.
>  * {{test-parent-bom}} has {{dependencyManagement}} for slf4j using the version from its parent.
>  * {{test-parent-base}} imports {{test-parent-bom}}
>  * {{test-parent-project}} has {{test-parent-base}} as parent, changes the value of the property and declares a {{dependency}} on slf4j
> The overridden property value does not take effect. However, if specified on the commandline (via {{-Dtopicus.version.org.slf4j=1.7.11}}) it does, even when running mvn inside {{project}} (after running mvn install in the root):
> {code}
> # mvn dependency:tree
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test-parent-project ---
> [INFO] nl.topicus.onderwijs.test:test-parent-project:jar:1.0-SNAPSHOT
> [INFO] \- org.slf4j:slf4j-api:jar:1.7.12:compile
> {code}
> {code}
> # mvn dependency:tree -Dtopicus.version.org.slf4j=1.7.11
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test-parent-project ---
> [INFO] nl.topicus.onderwijs.test:test-parent-project:jar:1.0-SNAPSHOT
> [INFO] \- org.slf4j:slf4j-api:jar:1.7.11:compile
> {code}
> I would expect properties in a pom to override properties from imported poms.



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