I would like to call attention to
http://jira.codehaus.org/browse/MNG-4479and see if the Maven
developers have any thoughts on this.  If this is an
issue better suited to the users list, I will happily take it over there,
but this seemed a bit arcane for your average Maven user.

Briefly, using Maven 2.2.1, when I configure a plugin for execution from the
command line, using the default-cli execution, a particular class cannot be
found.  When I run the plugin by binding one of its goals to a phase
instead, the class *can* be found.

Specifically, the problem lies in the Plexus "implementation" attribute.  I
have set up my plugin so that you can specify a particular FoobarProvider
like so:

<foobarProvider implementation="com.foobar.BaseFoobarProvider">
...

First of all, the plugin is not in the com.foobar package.

Second of all, the jar file containing the com.foobar.BaseFoobarProvider is
correctly specified in the project POM as a dependency of the plugin.  So
the plugin itself, on its own, out in the wild, knows nothing of the
com.foobar package, but in my project, which uses both the plugin and the
com.foobar package, I have set up the plugin's dependencies to include the
jar containing the com.foobar package (and obviously the BaseFoobarProvider
class).

>From running mvn -X, it appears that the default-cli execution handles
dependency resolution a little differently from other executions, and I
suspect that that's where the bug lies.  Plexus jumps in almost immediately
and says--before, it appears, dependencies have been fully resolved--that it
knows nothing of the com.foobar.BaseFoobarProvider class.

No such issue arises when I bind my plugin's main goal to the
generate-sources phase via another execution.

Could it be that default-cli handles dependencies differently from other
executions?

All thoughts welcome; this is a rather large issue for me I'm afraid.

Best,
Laird

Reply via email to