You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tristan Rouse <tj...@gmail.com> on 2009/09/25 03:12:00 UTC

Calling a custom maven plugin

I'm currently working with the book "Better Builds with Maven" and doing
some custom maven plugin development. I have a plugin I've created with the
following POM info.

<groupId>com.exist.mvnbook.plugins</groupId>
> <artifactId>maven-buildinfo-plugin</artifactId>
> <packaging>maven-plugin</packaging>
>

You know how you can just type "mvn <pluginName>:<mojoName>" for many mojos?
My mojo has to run like this: "mvn
com.exist.mvnbook.plugins:maven-buildinfo-plugin:extract"
where "extract" is the mojo name. From the error I get when I try to run it
like this 'mvn buildinfo:extract" it looks like I could get it to run that
way if I changed the groupId of my mojo to "org.apache.maven.plugins". It
seems rather inappropriate to use this groupId myself? Is there another way
to get my mojo to run without having to be so verbose?

Thanks very much.

Re: Calling a custom maven plugin

Posted by Stephen Connolly <st...@gmail.com>.
Also if you have the plugin configured in your pom (even in
pluginManagement) and the goalPrefix
(http://maven.apache.org/plugins/maven-plugin-plugin/descriptor-mojo.html#goalPrefix)
was correctly configured or auto-detected for your plugin, then you
can just use goalPrefix:goal when running maven against that pom.xml

2009/9/25 Anders Hammar <an...@hammar.net>:
> The way I know of is through the pluginGroups element of settings.xml.
>
> /Anders
>
> On Fri, Sep 25, 2009 at 03:12, Tristan Rouse <tj...@gmail.com> wrote:
>
>> I'm currently working with the book "Better Builds with Maven" and doing
>> some custom maven plugin development. I have a plugin I've created with the
>> following POM info.
>>
>> <groupId>com.exist.mvnbook.plugins</groupId>
>> > <artifactId>maven-buildinfo-plugin</artifactId>
>> > <packaging>maven-plugin</packaging>
>> >
>>
>> You know how you can just type "mvn <pluginName>:<mojoName>" for many
>> mojos?
>> My mojo has to run like this: "mvn
>> com.exist.mvnbook.plugins:maven-buildinfo-plugin:extract"
>> where "extract" is the mojo name. From the error I get when I try to run it
>> like this 'mvn buildinfo:extract" it looks like I could get it to run that
>> way if I changed the groupId of my mojo to "org.apache.maven.plugins". It
>> seems rather inappropriate to use this groupId myself? Is there another way
>> to get my mojo to run without having to be so verbose?
>>
>> Thanks very much.
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Calling a custom maven plugin

Posted by Anders Hammar <an...@hammar.net>.
The way I know of is through the pluginGroups element of settings.xml.

/Anders

On Fri, Sep 25, 2009 at 03:12, Tristan Rouse <tj...@gmail.com> wrote:

> I'm currently working with the book "Better Builds with Maven" and doing
> some custom maven plugin development. I have a plugin I've created with the
> following POM info.
>
> <groupId>com.exist.mvnbook.plugins</groupId>
> > <artifactId>maven-buildinfo-plugin</artifactId>
> > <packaging>maven-plugin</packaging>
> >
>
> You know how you can just type "mvn <pluginName>:<mojoName>" for many
> mojos?
> My mojo has to run like this: "mvn
> com.exist.mvnbook.plugins:maven-buildinfo-plugin:extract"
> where "extract" is the mojo name. From the error I get when I try to run it
> like this 'mvn buildinfo:extract" it looks like I could get it to run that
> way if I changed the groupId of my mojo to "org.apache.maven.plugins". It
> seems rather inappropriate to use this groupId myself? Is there another way
> to get my mojo to run without having to be so verbose?
>
> Thanks very much.
>