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/10 17:21:42 UTC
[jira] Reopened: (MNG-460) Direct access to the POM expressions as ant properties
[ 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