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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to