You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Akbarr <ak...@gmail.com> on 2006/06/03 18:08:02 UTC
Binding a plugin execution to a lifecycle phase JUST for one packaging type
Hi,
First of all, let me say I think Maven 2 is great. The major problem was the
lack of documentation, but I think it's been ove with the upcoming of the
book "Better builds with Maven".
I'd like to do something, but I'm not sure it's possible. I know how to bind
a plugin execution to a lifecycle phase, but I wonder if it'd be possible to
make this bind only for some determined packaging types. Of course, this
binding would be done in a parent POM.
For instance, execution of Hibernate doclet:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xdoclet-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>xdoclet</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="${project.build.sourceDirectory}"
/>
<hibernatedoclet
excludedtags="@version,@author,@todo"
mergeDir="${project.build.outputDirectory}"
destDir="${project.build.outputDirectory}">
<fileset dir="${
project.build.sourceDirectory}">
<include name="**/*.java" />
</fileset>
<hibernate version="2.0"
mergeDir="${project.build.outputDirectory}"
destDir="${project.build.outputDirectory}" />
</hibernatedoclet>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
I like this to be executed in every child project with "jar" packaging.
Thanks in advance,
Akbarr
Re: Binding a plugin execution to a lifecycle phase JUST for one packaging type
Posted by Akbarr <ak...@gmail.com>.
Ok, thanks for your reply!
On 6/3/06, Kenney Westerhof <ke...@apache.org> wrote:
>
> On Sat, 3 Jun 2006, Akbarr wrote:
>
> Hi,
>
> that's not possible, unless you make your own packaging which I'd
> recommend against.
>
> You can specify the binding in <pluginManagement> in the root pom,
> and then you only have to specify the plugin in the children
> (you can leave out the executions, just specify
> <plugin><groupId/><artifactId/></plugin> in the pom's you want to run it
> on.
>
> you could also just specify it in the build section of the root pom, but
> then it'll be executed in all modules (except those with packaging 'pom').
> This should be harmless, though.
>
> On a side note, if you generate sources or resources, you better link the
> xdoclet plugin to the generate-sources or generate-resources phase, so
> sources
> get compiled. Plus, it documents better what it's for.
>
> -- Kenney
>
> > Hi,
> >
> > First of all, let me say I think Maven 2 is great. The major problem was
> the
> > lack of documentation, but I think it's been ove with the upcoming of
> the
> > book "Better builds with Maven".
> >
> > I'd like to do something, but I'm not sure it's possible. I know how to
> bind
> > a plugin execution to a lifecycle phase, but I wonder if it'd be
> possible to
> > make this bind only for some determined packaging types. Of course, this
> > binding would be done in a parent POM.
> >
> > For instance, execution of Hibernate doclet:
> >
> > <plugin>
> > <groupId>org.codehaus.mojo</groupId>
> > <artifactId>xdoclet-maven-plugin</artifactId>
> > <executions>
> > <execution>
> > <phase>compile</phase>
> > <goals>
> > <goal>xdoclet</goal>
> > </goals>
> >
> > <configuration>
> > <tasks>
> > <mkdir dir="${
> project.build.sourceDirectory}"
> > />
> > <hibernatedoclet
>
> > excludedtags="@version,@author,@todo"
> > mergeDir="${project.build.outputDirectory}"
> > destDir="${project.build.outputDirectory}">
> > <fileset dir="${
> > project.build.sourceDirectory}">
> > <include name="**/*.java" />
> > </fileset>
> > <hibernate version="2.0"
> > mergeDir="${project.build.outputDirectory}"
> > destDir="${project.build.outputDirectory}" />
> > </hibernatedoclet>
> > </tasks>
> > </configuration>
> > </execution>
> > </executions>
> > </plugin>
> >
> > I like this to be executed in every child project with "jar" packaging.
> >
> > Thanks in advance,
> >
> > Akbarr
> >
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Binding a plugin execution to a lifecycle phase JUST for one
packaging type
Posted by Kenney Westerhof <ke...@apache.org>.
On Sat, 3 Jun 2006, Akbarr wrote:
Hi,
that's not possible, unless you make your own packaging which I'd
recommend against.
You can specify the binding in <pluginManagement> in the root pom,
and then you only have to specify the plugin in the children
(you can leave out the executions, just specify
<plugin><groupId/><artifactId/></plugin> in the pom's you want to run it
on.
you could also just specify it in the build section of the root pom, but
then it'll be executed in all modules (except those with packaging 'pom').
This should be harmless, though.
On a side note, if you generate sources or resources, you better link the
xdoclet plugin to the generate-sources or generate-resources phase, so sources
get compiled. Plus, it documents better what it's for.
-- Kenney
> Hi,
>
> First of all, let me say I think Maven 2 is great. The major problem was the
> lack of documentation, but I think it's been ove with the upcoming of the
> book "Better builds with Maven".
>
> I'd like to do something, but I'm not sure it's possible. I know how to bind
> a plugin execution to a lifecycle phase, but I wonder if it'd be possible to
> make this bind only for some determined packaging types. Of course, this
> binding would be done in a parent POM.
>
> For instance, execution of Hibernate doclet:
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>xdoclet-maven-plugin</artifactId>
> <executions>
> <execution>
> <phase>compile</phase>
> <goals>
> <goal>xdoclet</goal>
> </goals>
>
> <configuration>
> <tasks>
> <mkdir dir="${project.build.sourceDirectory}"
> />
> <hibernatedoclet
> excludedtags="@version,@author,@todo"
> mergeDir="${project.build.outputDirectory}"
> destDir="${project.build.outputDirectory}">
> <fileset dir="${
> project.build.sourceDirectory}">
> <include name="**/*.java" />
> </fileset>
> <hibernate version="2.0"
> mergeDir="${project.build.outputDirectory}"
> destDir="${project.build.outputDirectory}" />
> </hibernatedoclet>
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> I like this to be executed in every child project with "jar" packaging.
>
> Thanks in advance,
>
> Akbarr
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org