Robert Thornton created MNG-5611:
------------------------------------

             Summary: Project properties are interpolated too late to be used 
in several parts of the pom
                 Key: MNG-5611
                 URL: https://jira.codehaus.org/browse/MNG-5611
             Project: Maven 2 & 3
          Issue Type: Bug
    Affects Versions: 3.2.1
            Reporter: Robert Thornton


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}
<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>
    <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.



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

Reply via email to