Bateman, Patrick wrote:
> 
> The test works from within a Maven context, but when run it as a
> stand-alone test from within Eclipse the following stack trace is
> produced.
> 
> org.codehaus.plexus.component.repository.exception.ComponentLookupException:
> Component descriptor cannot be found in the component repository:
> org.apache.maven.plugin.Mojocom.qualcomm.uds.tools.qcgen:qcgen-maven-plugin:0.1:generate.
>             at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:319)

I ran into this problem today using Maven 2.0.7 and
maven-plugin-testing-harness-1.1. After some debugging of Maven I figured
out that the DefaultPlexusContainer is missing a component called
"MavenPluginDiscoverer" when run inside Eclipse compared to a real Maven
run.

So I put maven-core.jar along with the dependency
maven-plugin-descriptor.jar on the Eclipse class path and now the Mojo
lookup works for me. Besides those JARs, one must also have the
"META-INF/maven/plugin.xml" for the plugin under test somewhere in the test
class path. The plugin.xml is obviously the file that is evaluated by the
MavenPluginDiscoverer and used to register the Mojos with the Plexus
container.

That's all kind of hacking. I would really appreciate some tweaks to the
testing harness that allows debugging using IDEs out-of-the-box.


Benjamin Bentmann
-- 
View this message in context: 
http://www.nabble.com/Execution-of-a-AbstractMojoTestCase-test-from-within-Eclipse-tf4034442s177.html#a13433155
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to