[ 
https://jira.codehaus.org/browse/MPLUGINTESTING-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=300325#comment-300325
 ] 

Benjamin Reed commented on MPLUGINTESTING-25:
---------------------------------------------

OK, I just added the latest version of plexus-container-default as a dependency:

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-container-default</artifactId>
      <version>1.5.5</version>
    </dependency>

...and now I get this:

{code}org.codehaus.plexus.component.repository.exception.ComponentLookupException:
 Component descriptor cannot be found in the component repository
      role: org.apache.maven.plugin.Mojo
  roleHint: org.apache.maven.plugin.my:maven-my-plugin:1.0-SNAPSHOT:touch
classRealm: none specified
        at 
org.codehaus.plexus.DefaultComponentRegistry.getComponentManager(DefaultComponentRegistry.java:435)
        at 
org.codehaus.plexus.DefaultComponentRegistry.getComponent(DefaultComponentRegistry.java:353)
        at 
org.codehaus.plexus.DefaultComponentRegistry.lookup(DefaultComponentRegistry.java:178)
        at 
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:378)
        at org.codehaus.plexus.PlexusTestCase.lookup(PlexusTestCase.java:202)
        at 
org.apache.maven.plugin.testing.AbstractMojoTestCase.lookupMojo(AbstractMojoTestCase.java:291)
        at 
org.apache.maven.plugin.testing.AbstractMojoTestCase.lookupMojo(AbstractMojoTestCase.java:236)
        at 
org.apache.maven.plugin.my.MyMojoTest.testSomething(MyMojoTest.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197){code}
                
> cookbook example doesn't work
> -----------------------------
>
>                 Key: MPLUGINTESTING-25
>                 URL: https://jira.codehaus.org/browse/MPLUGINTESTING-25
>             Project: Maven 2.x Plugin Testing
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Benjamin Reed
>
> I have run into issues even getting a simple unit test working with my maven 
> plugin skeleton.  I posted about it here:
> http://mail-archives.apache.org/mod_mbox/maven-users/201206.mbox/%3C4FCCC631.6050607%40opennms.org%3E
> ...in the process of being unable to debug this failure, I figured I'd try 
> walking through the cookbook without using any of my own code.
> Following the cookbook example fails, with this exception:
> java.lang.NoClassDefFoundError: 
> org/apache/maven/plugin/descriptor/PluginDescriptorBuilder
>       at 
> org.apache.maven.plugin.testing.AbstractMojoTestCase.setUp(AbstractMojoTestCase.java:116)
>       at org.apache.maven.plugin.my.MyMojoTest.setUp(MyMojoTest.java:15)
>       at junit.framework.TestCase.runBare(TestCase.java:125)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.maven.plugin.descriptor.PluginDescriptorBuilder
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>       ... 15 more
> The documentation says to use the archetype for creating a maven plugin, but 
> by default it uses maven-plugin-api 2.0, which is incompatible with the 
> latest plugin.  Changing it to maven-plugin-api 3.0 in pom.xml then results 
> in the following exception:
> java.lang.NoClassDefFoundError: org/codehaus/plexus/ContainerConfiguration
>       at java.lang.Class.getDeclaredMethods0(Native Method)
>       at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
>       at java.lang.Class.getDeclaredMethods(Class.java:1791)
>       at junit.framework.TestSuite.<init>(TestSuite.java:73)
>       at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
>       at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.ClassNotFoundException: 
> org.codehaus.plexus.ContainerConfiguration
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>       ... 10 more
> I've not been able to figure out how to actually unit-test the cookbook 
> example, much less my own plugin. :P

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to