You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Jason Dillon (JIRA)" <ji...@codehaus.org> on 2006/01/31 23:23:06 UTC

[jira] Created: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Properties defined in pom <properties> do not propagate to the antrun environment
---------------------------------------------------------------------------------

         Key: MANTRUN-40
         URL: http://jira.codehaus.org/browse/MANTRUN-40
     Project: Maven 2.x Antrun Plugin
        Type: Bug

    Reporter: Jason Dillon
    Priority: Critical


Properties defined in pom <properties> do not propagate to the antrun environment.

For example:

{code}
<properties>
    <my.property>foo</my.property>
</properties>
{code}

Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:

{code}
<ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
{code}

And then the Ant build.xml:

{code}
<project>
    <target name="foo">
        <echo>${my.property}</echo>
    </target>
<project>
{code}

The output will be:

{noformat}
[echo] ${my.property}
{noformat}

Instead of what it *should be*:

{noformat}
[echo] foo
{noformat}

The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:

{code}
<ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
    <property name="my.property" value="${my.property}"/>
</ant>
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-40?page=comments#action_57565 ] 

Kenney Westerhof commented on MANTRUN-40:
-----------------------------------------

It's impossible to propagate all properties to the called ant buildfile, since only listed properties
are propagated. Most properties are calculated runtime using reflection.

We could make an exception for the <properties> tag for called buildfiles and iterate over
them, but that doesn't solve it ${project.*} properties.

However, <properties> do work for ant tasks embedded in the pom, so the title
of this issue is not correct.

A nice workaround might be to override the ant task, or to ask the ant folks to fix
their Ant task so the PropertyHelper linked to the project is also propagated to
the new project instantiated by the Ant task, when inheritAll="true". It should inherit
ALL properties, wheter they're calculated or not - the script doesn't know that.. :)

> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-40?page=all ]

Carlos Sanchez updated MANTRUN-40:
----------------------------------

    type: Improvement  (was: Bug)

I don't think this was never intended so it's a new feature, not a bug

> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-40?page=comments#action_57566 ] 

Brett Porter commented on MANTRUN-40:
-------------------------------------

what about if the plugin depended on the maven-artifact-ant antlib (the thin jar + transitive deps, not the fat one), and registered that antlib with the project being used (if possible), and the project's pom with the antlib (which is possible)? This would mean they can use those tasks from the script.


> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-40?page=comments#action_57570 ] 

Jason Dillon commented on MANTRUN-40:
-------------------------------------

Sorry Kenny, but properties *do not* actually make it into the ant's execution environment.  Properties are only resolved in the pom (tasks embedded in the pom as you noted).  BUT, if one of those tasks needs to access a property that *was not* explicitly passed to it, like what is done with {{<ant><property name="" .../>}} which would then use the pom's property resolution mechanism, then that task will *not see* the value of the property.  So the title of the issue is correct.

> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-40?page=comments#action_57476 ] 

Jason Dillon commented on MANTRUN-40:
-------------------------------------

A brief chat w/jvl yesterday sounded like there was already a fix somewhere... 

But... bug/imporvement/task... I just need it fixed ;-)

> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MANTRUN-40) Properties defined in pom do not propagate to the antrun environment

Posted by "Jason Dillon (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-40?page=comments#action_57478 ] 

Jason Dillon commented on MANTRUN-40:
-------------------------------------

If no fix shows up I can create a patch for it, but was hoping this issue would shed some light on the fix that jason mentioned.

> Properties defined in pom <properties> do not propagate to the antrun environment
> ---------------------------------------------------------------------------------
>
>          Key: MANTRUN-40
>          URL: http://jira.codehaus.org/browse/MANTRUN-40
>      Project: Maven 2.x Antrun Plugin
>         Type: Improvement

>     Reporter: Jason Dillon
>     Priority: Critical

>
>
> Properties defined in pom <properties> do not propagate to the antrun environment.
> For example:
> {code}
> <properties>
>     <my.property>foo</my.property>
> </properties>
> {code}
> Does *not* get propagate to Ant.  While properties defined within the pom will resolve, the properties are not available as an Ant property.  So from antrun:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo"/>
> {code}
> And then the Ant build.xml:
> {code}
> <project>
>     <target name="foo">
>         <echo>${my.property}</echo>
>     </target>
> <project>
> {code}
> The output will be:
> {noformat}
> [echo] ${my.property}
> {noformat}
> Instead of what it *should be*:
> {noformat}
> [echo] foo
> {noformat}
> The workaround is to delegate to a build.xml file with the ant task and redefine each property that is needed:
> {code}
> <ant antfile="${pom.basedir}/src/ant/build.xml" dir="${pom.basedir}" inheritAll="true" inheritRefs="true" target="foo">
>     <property name="my.property" value="${my.property}"/>
> </ant>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org