You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rémy <re...@gmail.com> on 2010/03/05 09:18:25 UTC

Write Maven plugin : read configuration in POM

Hello,
I wrote a Maven plugin. I manage to access the settings of my plugin (tags
<configuration> in the POM). I would like access to configuration
information of another plugin, I don't know how to do that (for exemple the
<finalName> element of maven-war-plugin).
Thanks.
Remy
-- 
View this message in context: http://old.nabble.com/Write-Maven-plugin-%3A-read-configuration-in-POM-tp27791002p27791002.html
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: Write Maven plugin : read configuration in POM

Posted by Rémy <re...@gmail.com>.
   List<Plugin> plugins = mavenProject.getBuildPlugins();
      for (Plugin plugin : plugins) {
        if (plugin.getArtifactId().equalsIgnoreCase("maven-war-plugin")) {
            ...plugin.getConfiguration();
        } 
   }


Rémy wrote:
> 
> Hello,
> I wrote a Maven plugin. I manage to access the settings of my plugin (tags
> <configuration> in the POM). I would like access to configuration
> information of another plugin, I don't know how to do that (for exemple
> the <finalName> element of maven-war-plugin).
> Thanks.
> Remy
> 

-- 
View this message in context: http://old.nabble.com/Write-Maven-plugin-%3A-read-configuration-in-POM-tp27791002p27794552.html
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: Write Maven plugin : read configuration in POM

Posted by pubudu gunawardena <pu...@gmail.com>.
    /**
     * @parameter default-value="${project.build.plugins}"
     *
     */
    private List plugins;

Would give you all the plugins as a list. You can get the configurations of
other plugins via this list.

On Fri, Mar 5, 2010 at 2:18 PM, Rémy <re...@gmail.com> wrote:

>
> Hello,
> I wrote a Maven plugin. I manage to access the settings of my plugin (tags
> <configuration> in the POM). I would like access to configuration
> information of another plugin, I don't know how to do that (for exemple the
> <finalName> element of maven-war-plugin).
> Thanks.
> Remy
> --
> View this message in context:
> http://old.nabble.com/Write-Maven-plugin-%3A-read-configuration-in-POM-tp27791002p27791002.html
> 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
>
>