You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jiaqi Guo <cy...@gmail.com> on 2007/02/12 23:22:25 UTC
Can I get MavenProject instance of plugin itself within a Mojo?
I need some of the maven2 plugin's dependencies during execute() method
of a Mojo. In maven1 there's ${plugin.get...} that I can use in jelly
script, how can I do similar thing in maven2 Mojo class? Thanks in advance.
I've tryed printing out getPluginContext() but it seems to return empty Map.
Regards
--
Jiaqi Guo
http://www.cyclopsgroup.org
jiaqi.guo@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Can I get MavenProject instance of plugin itself within a
Mojo?
Posted by franz see <fr...@gmail.com>.
Good day to you, Jiaqi,
See the "http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook"
section in [1].
Cheers,
Franz
[1] http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook
Jiaqi Guo wrote:
>
> I need some of the maven2 plugin's dependencies during execute() method
> of a Mojo. In maven1 there's ${plugin.get...} that I can use in jelly
> script, how can I do similar thing in maven2 Mojo class? Thanks in
> advance.
>
> I've tryed printing out getPluginContext() but it seems to return empty
> Map.
>
>
> Regards
>
> --
>
>
>
> Jiaqi Guo
>
> http://www.cyclopsgroup.org
> jiaqi.guo@gmail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Can-I-get-MavenProject-instance-of-plugin-itself-within-a-Mojo--tf3217048s177.html#a8942573
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Can I get MavenProject instance of plugin itself within a Mojo?
Posted by Janecek Jan <ja...@kb.cz>.
Hi,
Add this to your mojo:
/**
* @parameter expression="${project}"
* @readonly
*/
private MavenProject project;
See guides about plugin development in
http://maven.apache.org/guides/index.html
Regards,
Jan
-----Original Message-----
From: Jiaqi Guo [mailto:cyclopsgroup@gmail.com]
Sent: Monday, February 12, 2007 11:22 PM
To: users@maven.apache.org
Subject: Can I get MavenProject instance of plugin itself within a Mojo?
I need some of the maven2 plugin's dependencies during execute() method
of a Mojo. In maven1 there's ${plugin.get...} that I can use in jelly
script, how can I do similar thing in maven2 Mojo class? Thanks in
advance.
I've tryed printing out getPluginContext() but it seems to return empty
Map.
Regards
--
Jiaqi Guo
http://www.cyclopsgroup.org
jiaqi.guo@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Tento e-mail je urcen pouze pro jeho adresata/adresaty a muze obsahovat duverne informace, jejichz ochrana muze byt vyzadovana pravnimi predpisy.
Jestlize jste zpravu obdrzel(a) omylem, neprodlene informujte jejiho odesilatele a tuto zpravu, jeji prilohy a pripadne kopie ihned vymazte. Jakakoli forma uziti, zverejneni, reprodukce, kopirovani, distribuce a sireni teto zpravy je v takovem pripade zakazana.
Komercni banka, a.s., neodpovida za mozne skody zpusobene neuplnym prenosem, moznou modifikaci ci zpozdenim teto zpravy behem prenosu od odesilatele k adresatovi.
This e-mail transmission is intended solely for the ordinary user of the e-mail address to which it was addressed. It may contain legally privileged and/or confidential information.
If you have received this e-mail in error or are not an intended recipient please inform the sender with-out delay and delete this e-mail, attachments and possible copies immediately. The unauthorised use, disclosure, distribution and/or copying of this e-mail or any information it contains is prohibited.
Komercni banka, a. s., does not accept liability for any damage caused by incomplete transmission, possible modification or delay of this e-mail during the transmission from the sender to the recipient.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org