[jbosstools-issues] [JBoss JIRA] (JBIDE-14396) Imported maven projects sometimes fail to resolve required classpath dependencies for tests

Fred Bricon (JIRA) jira-events at lists.jboss.org
Tue May 14 13:22:06 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-14396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774279#comment-12774279 ] 

Fred Bricon commented on JBIDE-14396:
-------------------------------------

For the moment, the m2e-forge plugin I hacked has no official support anywhere. That was a quick'n dirty workaround for your issue.
We *may* be able to have m2e discover such a plugin if, for instance, it was mapped to the forge-maven-plugin AND some forge-maven-plugin goal was participating to an [interesting maven execution phase|https://docs.sonatype.org/display/M2ECLIPSE/Project+build+lifecycle+mapping#Projectbuildlifecyclemapping-Introducenotionsof%22interesting%22and%22notinteresting%22mojoexecutions]

                
> Imported maven projects sometimes fail to resolve required classpath dependencies for tests
> -------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-14396
>                 URL: https://issues.jboss.org/browse/JBIDE-14396
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: maven, upstream
>    Affects Versions: 4.1.0.Alpha2
>            Reporter: Lincoln Baxter III
>         Attachments: m2e-forge.site-0.0.1-SNAPSHOT.zip
>
>
> Example project: https://github.com/forge/core/tree/M2ECLIPSE-BUG
> Steps to reproduce:
> * Import all modules into the workspace. 
> * Select "aesh-tests" project.
> * Run as -> JUnit Test
> You should see the test fail to launch because of the following Class not found exception:
> {code}
> java.lang.NoClassDefFoundError: Lorg/jboss/forge/aesh/TestShellConfiguration;
> 	at java.lang.Class.getDeclaredFields0(Native Method)
> 	at java.lang.Class.privateGetDeclaredFields(Class.java:2300)
> 	at java.lang.Class.getDeclaredFields(Class.java:1745)
> 	at org.junit.runners.model.TestClass.<init>(TestClass.java:49)
> 	at org.junit.runners.ParentRunner.<init>(ParentRunner.java:75)
> 	at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:57)
> 	at org.jboss.arquillian.junit.Arquillian.<init>(Arquillian.java:50)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
> 	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
> 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> 	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
> 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> 	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
> 	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.jboss.forge.aesh.TestShellConfiguration
> 	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)
> 	... 25 more
> {code}
> This can be solved by manually adding required projects in the workspace as classpath dependencies of the JUnit launch configured for the project being tested, but this is obviously not right, and should be configured automatically by the M2E integration.

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


More information about the jbosstools-issues mailing list