You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julian Wood <wo...@ucalgary.ca> on 2006/02/09 00:06:50 UTC
Accessing plugin properties in POM
I have a plugin which does some work and generates a value. How can I
access that value in the POM?
I've tried adding the value into the Map retrieved from
getPluginContext(), and using System.putProperty, but in neither case
can I access the property in the POM, using something like $
{maven.myplugin.value}.
The plugin is bound and generates it's value correctly, btw.
What's the procedure?
Thanks,
J
--
Julian Wood <wo...@ucalgary.ca>
Programmer/Analyst
University of Calgary
http://commons.ucalgary.ca
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Accessing plugin properties in POM
Posted by Julian Wood <wo...@ucalgary.ca>.
I figured this out.
Add this field to your mojo:
/**
* The maven project.
*
* @parameter expression="${project}"
* @required
* @readonly
*/
private MavenProject project;
Then in your code:
project.getProperties().put("myKey", myValue);
And finally in the pom:
${myKey}
J
On 8-Feb-06, at 4:06 PM, Julian Wood wrote:
> I have a plugin which does some work and generates a value. How can
> I access that value in the POM?
>
> I've tried adding the value into the Map retrieved from
> getPluginContext(), and using System.putProperty, but in neither
> case can I access the property in the POM, using something like $
> {maven.myplugin.value}.
>
> The plugin is bound and generates it's value correctly, btw.
>
> What's the procedure?
>
> Thanks,
>
> J
> --
> Julian Wood <wo...@ucalgary.ca>
>
> Programmer/Analyst
> University of Calgary
>
> http://commons.ucalgary.ca
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Julian Wood <wo...@ucalgary.ca>
Programmer/Analyst
University of Calgary
http://commons.ucalgary.ca
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org