You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2018/03/16 22:42:25 UTC
[jira] [Closed] (MNG-5611) Project properties are interpolated too
late to be used in several parts of the pom
[ https://issues.apache.org/jira/browse/MNG-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov closed MNG-5611.
-------------------------------
Resolution: Auto Closed
This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.
> Project properties are interpolated too late to be used in several parts of the pom
> -----------------------------------------------------------------------------------
>
> Key: MNG-5611
> URL: https://issues.apache.org/jira/browse/MNG-5611
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.2.1
> Reporter: Robert Thornton
> Priority: Major
>
> I need projects that declare my pom as their parent to be able to define project properties to customize essential components of their build, such as repositories, pluginRepositories, and distributionManagement.
> For example:
> {code:xml}
> <parent>
> <groupId>org.apache.maven.its.mng5611</groupId>
> <artifactId>parent</artifactId>
> <version>0.1</version>
> </parent>
> <properties>
> <!--
> Using properties allows repository definitions to be customized, enabled/disabled, and tuned by child projects
> which is useful when you have several repositories that can be configured with a few simple properties.
> -->
> <repo.url>http://repo.mysite.com/nexus/content</repo.url>
> <repo.releases.enabled>true</repo.releases.enabled>
> <repo.snapshots.enabled>false</repo.snapshots.enabled>
> <repo.update>daily</repo.update>
> </properties>
> <repositories>
> <!-- Parent pom needs to be read from this repository -->
> <repository>
> <id>my-repo</id>
> <name>My Repository</name>
> <url>${repo.url}/groups/main-repo</url>
> <releases>
> <enabled>${repo.releases.enabled}</enabled>
> <updatePolicy>${repo.update}</updatePolicy>
> </releases>
> <snapshots>
> <enabled>${repo.snapshots.enabled}</enabled>
> <updatePolicy>${repo.update}</updatePolicy>
> </snapshots>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <id>my-plugin-repo</id>
> <name>My Plugin Repository</name>
> <url>${repo.url}/groups/plugin-repo</url>
> <releases>
> <enabled>${repo.releases.enabled}</enabled>
> <updatePolicy>${repo.update}</updatePolicy>
> </releases>
> <snapshots>
> <enabled>${repo.snapshots.enabled}</enabled>
> <updatePolicy>${repo.update}</updatePolicy>
> </snapshots>
> </pluginRepository>
> </pluginRepositories>
> {code}
> The bug is that the effective pom correctly shows these properties as being interpolated for the above repositories, however the Aether RemoteRepository objects for the above definitions are created before the pom's properties are interpolated. This results in unexpected behavior that can only be understood by attaching a debugger to the Maven build process. The above example fails, for example, if the above pom's parent is in the repository whose properties haven't been interpolated yet.
> The way I believe the properties interpolation process should work is that any time a project property is requested (as in the above examples), it should be interpolated based on the currently available project properties even if the entire project hierarchy has not yet been loaded.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)