You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org> on 2005/06/08 16:58:09 UTC

[jira] Created: (MNG-460) Direct access to the POM expressions as ant properties

Direct access to the POM expressions as ant properties
------------------------------------------------------

         Key: MNG-460
         URL: http://jira.codehaus.org/browse/MNG-460
     Project: Maven 2
        Type: New Feature
  Components: maven-artifact-ant  
    Reporter: Nicola Ken Barozzi
    Priority: Minor
 Attachments: POMProperties.java

** Disclaimer **
I have no time now to test it fully ATM, but it should basically work.
****************

This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 

IOW this:

    <artifact:setProperty property="my.artifactid" 
              expression="project.artifactId" 
              pomRefId="my.maven.project" />
    
    then use ${my.artifactid}

can be replaced by this:

    use ${pom:my.maven.project/project.artifactId}

                       - ~ -

Here is a sample test buildfile:

<?xml version="1.0" encoding="UTF-8"?>
<project name="foo" 
         xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
         default="test-pom">
         
  <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
           name="pomproperties"       
           classname="org.apache.maven.artifact.ant.POMProperties"/>
         
  <target name="test-pom">
    <artifact:pom file="pom.xml" id="my.maven.project"/>

    <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
    <echo>Artifact ID = ${my.artifactid}</echo>
    
    <pomproperties/>
    <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
        
  </target>
</project>
        

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=comments#action_40961 ]
     
Nicola Ken Barozzi commented on MNG-460:
----------------------------------------

Thanks! :-)

I had used the dot insted of the colon in the last patch so that 
properties can look exactly like they are in Maven if the rederence is "pom".

Here:

http://maven.apache.org/reference/scripting.html
"
 The current project is always available under the context variable ${pom}. 
...
 To access the project variables of the plugin itself, 
 use the variable ${plugin}.
"

It seems consistent to use the pom @id in Ant, where Maven instead uses pom. or plugin.



> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=all ]

Nicola Ken Barozzi updated MNG-460:
-----------------------------------

    Attachment: pompatch.diff

Patch to make <...:pom> register the property helper

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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] Closed: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=all ]
     
Brett Porter closed MNG-460:
----------------------------

    Resolution: Fixed

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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] Closed: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=all ]
     
Brett Porter closed MNG-460:
----------------------------

    Resolution: Fixed

applied - thanks!
I made some modifications:
- a few formatting things (the patch didn't apply straight out, for some reason)
- made execute() initialise the project, so extends AbstractArtifactTask
- removed setProperty altogether
- used ':' as the separator to make it clear what is the reference and what is the property


> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=comments#action_40865 ]
     
Nicola Ken Barozzi commented on MNG-460:
----------------------------------------

With pompatch.diff one can access the POM by using

 ${[pom_id].[expression]}

where expression is without "project.".


It can be tested like this:

<project name="foo" 
         xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
         default="test-pom">
         
  <target name="test-pom">
    <artifact:pom file="pom.xml" id="pom"/>

    <artifact:setProperty property="my.artifactid" 
                          expression="project.artifactId"
                          pomRefId="pom" />

    <artifact:pom file="pom2.xml" id="my.maven.project"/>

    <artifact:setProperty property="my.artifactid2" 
                          expression="project.artifactId"
                          pomRefId="my.maven.project" />

                      
    <echo>Artifact ID2 = ${my.artifactid2}</echo>
    <echo>Artifact ID2 with PropertyHelper = ${my.maven.project.artifactId}</echo>

    <echo>Artifact ID = ${my.artifactid}</echo>
    <echo>Artifact ID with PropertyHelper = ${pom.artifactId}</echo>   
  </target>
  
</project>

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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] Reopened: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=all ]
     
Nicola Ken Barozzi reopened MNG-460:
------------------------------------


I had used the dot insted of the colon in the last patch so that
properties can look exactly like they are in Maven if the rederence is "pom".

Here:

http://maven.apache.org/reference/scripting.html
"
 The current project is always available under the context variable ${pom}.
...
 To access the project variables of the plugin itself,
 use the variable ${plugin}.
"

It seems consistent to use the pom @id in Ant, where Maven instead uses "pom.xxx" or "plugin.xxx"

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=all ]

Brett Porter updated MNG-460:
-----------------------------

    Fix Version: 2.0-alpha-3

ok, just to be clear - you're currently still working on it, and will be incorporating it in the pom task so that these both hold:
- you can still define multiple poms with different references
- you don't need to list <pomproperties/>, it is done by <...:pom />
if so, that sounds great - thanks!

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Nicola Ken Barozzi (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=comments#action_40820 ]
     
Nicola Ken Barozzi commented on MNG-460:
----------------------------------------

I'm changing it to be part of the pom task itself, and to use the same notation as in Maven.

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>  Attachments: POMProperties.java
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

-- 
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: (MNG-460) Direct access to the POM expressions as ant properties

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-460?page=comments#action_41031 ]
     
Brett Porter commented on MNG-460:
----------------------------------

good point. Done.

> Direct access to the POM expressions as ant properties
> ------------------------------------------------------
>
>          Key: MNG-460
>          URL: http://jira.codehaus.org/browse/MNG-460
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-artifact-ant
>     Reporter: Nicola Ken Barozzi
>     Priority: Minor
>      Fix For: 2.0-alpha-3
>  Attachments: POMProperties.java, pompatch.diff
>
>
> ** Disclaimer **
> I have no time now to test it fully ATM, but it should basically work.
> ****************
> This task sets up a PropertyHelper that makes it possible to resolve pom values directly from Ant properties. 
> IOW this:
>     <artifact:setProperty property="my.artifactid" 
>               expression="project.artifactId" 
>               pomRefId="my.maven.project" />
>     
>     then use ${my.artifactid}
> can be replaced by this:
>     use ${pom:my.maven.project/project.artifactId}
>                        - ~ -
> Here is a sample test buildfile:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="foo" 
>          xmlns:artifact="antlib:org.apache.maven.artifact.ant" 
>          default="test-pom">
>          
>   <taskdef classpath="C:\Documents and Settings\barozzink\Desktop\m2-artifact-nkb\build\classes"
>            name="pomproperties"       
>            classname="org.apache.maven.artifact.ant.POMProperties"/>
>          
>   <target name="test-pom">
>     <artifact:pom file="pom.xml" id="my.maven.project"/>
>     <artifact:setProperty property="my.artifactid" expression="project.artifactId" pomRefId="my.maven.project" />
>     <echo>Artifact ID = ${my.artifactid}</echo>
>     
>     <pomproperties/>
>     <echo>Artifact ID with PropertyHelper = ${pom:my.maven.project/project.artifactId}</echo>
>         
>   </target>
> </project>
>         

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