You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matt McGill <ma...@gmail.com> on 2006/02/22 21:27:15 UTC
[m2] Multi-project plugin inheritence
I'm sure this has been answered before, and I apologize for not being
able to find the solution on my own. The only information I was able
to locate referred to [m1], and I am not familiar enough with either
incarnation of maven to pick out what's useful.
I have a mutli-project build, organized like so:
/root
- pom.xml (the main pom, using 'pom' packaging and defining all
relevant modules)
+ module1
- pom.xml (module1's pom, correctly referencing parent)
+ module2
- pom.xml (module2's pom, correctly referencing parent)
I'm working on a plugin right now that will run fitnesse tests on an
already-running fitnesse server (host, port, etc. are configured in
pom) and generate html results (think combination of surefire and
surefore-report; I should also have two separate plugins, but I'm
just getting started). Like surefire-report, the plugin does not
participate in the default build cycle, and its target must be
specified explicitly. I am using continuum for continuous integration.
Here's my problem: module1 depends on module2, so module2 needs to be
built first. To ensure that this happens, I have configured a single
maven 2.0 continuum project pointing at the main pom, with the
default --non-recursive argument removed. The SCM checkout checks out
both modules because of the way the directories are structured, and
the recursive build allows maven to ensure that the dependencies are
resolved correctly. The maven command is therefore issued like this
from the /root directory: mvn clean install my-plugin:fitnesse-test.
However, only module2 is actually associated with a suite of fitnesse
tests: I only want the my-plugin:fitnesse-test target to be run on
module2, but I can only execute the build on the root pom. How can I
do this? If I only put the configuration for the plugin in the child
pom, then executing the build on the root pom fails because certain
plugin configuration elements are required. If I put a 'default'
plugin configuration in the <pluginManagement/> section of the parent
pom, maven executes the plugin target on the parent, which is also
undesireable. Is there a way to configure things such that executing
'mvn my-plugin:fitnesse-test' on the root pom will only result in
that target being run for those child projects which include
configuration for that plugin?
Thanks,
-Matt McGill
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org