I have a plugin with multiple dependencies. I am using this to copy them to lib/ <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>process-resources</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory> <includeScope>runtime</includeScope> </configuration> </execution> </executions> </plugin> </plugins> </build> (BTW, this should probably be done for all plugins by default. It isn't really fun to have to include this for every plugin.) Unfortunately RHQ pulls in cobertura and commons-logging. I managed to fix cobertura issue: diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 389b69c..abc9d0c 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -87,6 +87,13 @@ <groupId>net.sourceforge.cobertura</groupId> <artifactId>cobertura</artifactId> <version>${cobertura.version}</version> + <scope>test</scope> <!-- for testing only --> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>${commons-logging.version}</version> + <scope>provided</scope> <!-- by RHQ container --> </dependency> </dependencies> but I can't seem to fix the logging dependency issue. The logging dependency should be 'provided' not 'compile'...
per bz triage (asantos, ccrouch, mfoley. loleary)
I have not had any success using the copy-dependencies goal. It appears to be buggy and the way scopes are specified is very unintuitive. I recommend using the copy-libs goal instead and explicitly specifying the jars you want to include, which is what we do in all the core plugins. For example, from the as7 plugin: <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-libs</id> <phase>process-resources</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> </artifactItem> <artifactItem> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> </artifactItem> <artifactItem> <groupId>org.jboss.sasl</groupId> <artifactId>jboss-sasl</artifactId> </artifactItem> </artifactItems> <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory> </configuration> </execution> </executions> </plugin> Defining an rhq-agent-plugin Maven packaging type that encapsulates things like copying runtime deps into the lib dir and validating the plugin descriptor is a good idea and something I have been wanting to do for a while. Can you create a separate BZ for that?
I created Bug 840634 - Define an rhq-agent-plugin Maven packaging type This bug may be marked as duplicate or closed.
I don't think this is an issue anymore.