Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-140

Tests fail during release:perform but work elsewhere

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2.0-beta-4
    • Fix Version/s: None
    • Component/s: perform
    • Labels:
      None
    • Environment:
      Maven 2.0.4. Linux
    • Number of attachments :
      4

      Description

      Summary

      I have a project that builds successfully when mvn clean install is executed.
      When mvn clean release:prepare is executed the integration tests run successfully too.
      When mvn release:perform is executed the junit tests using surefire fail.

      Details

      The project layout

      The project is an EJB 3 project. The unit tests bootstrap/startup an embedded EJB container to test the EJBs. The container is configured via a set of xml and property files that are specified in the testResources section of the pom. The embedded container is a dependency of the project with test scope.

      release:perform output

      The output of the release:perform goal is attached to this issue.

      surefire junit test report

      The output of the release:perform goal is attached to this issue. A snippet is shown here:

      -------------------------------------------------------------------------------
      Battery: com.dolby.pics.core.ejb.bean.CountryBeanTestCase
      -------------------------------------------------------------------------------
      Tests run: 11, Failures: 0, Errors: 11, Time elapsed: 7.234 sec 
      
      testGetAll(com.dolby.pics.core.ejb.bean.CountryBeanTestCase)  Time elapsed: 2.255 sec  <<< ERROR!
      
      [ stdout ] ---------------------------------------------------------------
      
      
      
      [ stderr ] ---------------------------------------------------------------
      
      
      
      [ stacktrace ] -----------------------------------------------------------
      
      java.lang.RuntimeException: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
      	at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:391)
      	at com.dolby.pics.test.AbstractEJBTestCase.startupEmbeddedJboss(AbstractEJBTestCase.java:63)
      	at com.dolby.pics.test.AbstractEJBTestCase.setUp(AbstractEJBTestCase.java:145)
      	at com.dolby.pics.core.ejb.bean.CountryBeanTestCase.setUp(CountryBeanTestCase.java:43)
      	at junit.framework.TestCase.runBare(TestCase.java:128)
      	at junit.framework.TestResult$1.protect(TestResult.java:110)
      	at junit.framework.TestResult.runProtected(TestResult.java:128)
      	at junit.framework.TestResult.run(TestResult.java:113)
      	at junit.framework.TestCase.run(TestCase.java:120)
      	at junit.framework.TestSuite.runTest(TestSuite.java:228)
      	at junit.framework.TestSuite.run(TestSuite.java:223)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:615)
      	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
      	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
      	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
      	at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
      	at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:615)
      	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:313)
      	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:221)
      	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:371)
      	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:615)
      	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
      	at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
      	at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:84)
      	at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:380)
      	... 44 more
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
      	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:69)
      	at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:55)
      	at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
      	... 46 more
      Caused by: javax.xml.parsers.ParserConfigurationException: validation is not supported
      	at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:100)
      	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:65)
      	... 48 more
      

      I would guess the problem is regarding something not on the class path when the tests run within release:perform, but I am not sure. This is a eral blocker as we cannot release a working project.

        Issue Links

          Activity

          Hide
          Adrian added a comment -

          This file is the equivelent to TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml but the output that is given when the tests compile successfully.

          Show
          Adrian added a comment - This file is the equivelent to TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml but the output that is given when the tests compile successfully.
          Hide
          Adrian added a comment -

          Note that in the working junit xml test report the java.class.path is set as follows:

          <property value="/home/apill/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/apill/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/apill/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar" name="java.class.path"/>

          and in the broken test it is

          <property value="/usr/local/apps/maven/core/boot/classworlds-1.1.jar" name="java.class.path"/>

          This may be a red herring though?

          Show
          Adrian added a comment - Note that in the working junit xml test report the java.class.path is set as follows: <property value= "/home/apill/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/apill/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/apill/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar" name= "java.class.path" /> and in the broken test it is <property value= "/usr/local/apps/maven/core/boot/classworlds-1.1.jar" name= "java.class.path" /> This may be a red herring though?
          Hide
          Adrian added a comment -

          This file is the equivelent to TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml but the output that is given when the tests compile successfully.

          My comment quoted above is referring to the attached file WORKING-TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml

          Show
          Adrian added a comment - This file is the equivelent to TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml but the output that is given when the tests compile successfully. My comment quoted above is referring to the attached file WORKING-TEST-com.dolby.pics.core.ejb.bean.CountryBeanTestCase.xml
          Hide
          Emmanuel Venisse added a comment -

          I can't reproduce it with latest code. Can you test with the release plugin snapshot?

          Show
          Emmanuel Venisse added a comment - I can't reproduce it with latest code. Can you test with the release plugin snapshot?
          Hide
          Emmanuel Venisse added a comment -

          ping

          Show
          Emmanuel Venisse added a comment - ping
          Hide
          Lammert Westerhoff added a comment -

          I have the same problem with my project. Currently this block my company from using this plugin, which would make life a lot easier if we could use it.

          During the execution of my test I get a ClassNotFoundException so it's definitely the same problem and I think it has to do with jars with classifiers. My project has to dependencies to the same project but with a different classifier.
          E.g.
          a-1.0.jar
          a-1.0-tests.jar

          The class that could not be found is in the normal a-1.0.jar, which is not in the classpath of the tests. The jar a-1.0-tests.jar with the tests classifier however is in the classpath. I at some point of execution the jar with the classifier overwrites the normal jar.

          Also just like described above, running the tests normal without the release plugin with "mvn test" or any other normal lifecycle phase works fine.

          Since this case happens in a complex project with many dependencies its hard to find out if this is really the problem but I will try to create a simple reproduction and submit it here.

          Show
          Lammert Westerhoff added a comment - I have the same problem with my project. Currently this block my company from using this plugin, which would make life a lot easier if we could use it. During the execution of my test I get a ClassNotFoundException so it's definitely the same problem and I think it has to do with jars with classifiers. My project has to dependencies to the same project but with a different classifier. E.g. a-1.0.jar a-1.0-tests.jar The class that could not be found is in the normal a-1.0.jar, which is not in the classpath of the tests. The jar a-1.0-tests.jar with the tests classifier however is in the classpath. I at some point of execution the jar with the classifier overwrites the normal jar. Also just like described above, running the tests normal without the release plugin with "mvn test" or any other normal lifecycle phase works fine. Since this case happens in a complex project with many dependencies its hard to find out if this is really the problem but I will try to create a simple reproduction and submit it here.
          Hide
          Lammert Westerhoff added a comment -

          The stacktrace:

          [INFO] java.lang.NoClassDefFoundError: com/.../AdoService
          [INFO] at java.lang.Class.getDeclaredMethods0(Native Method)
          [INFO] at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
          [INFO] at java.lang.Class.getMethod0(Class.java:2670)
          [INFO] at java.lang.Class.getMethod(Class.java:1603)
          [INFO] at org.easymock.internal.ObjectMethodsFilter.<init>(ObjectMethodsFilter.java:32)
          [INFO] at org.easymock.internal.MocksControl.createMock(MocksControl.java:48)
          [INFO] at org.easymock.classextension.EasyMock.createMock(EasyMock.java:50)
          [INFO] at com.ac.util.test.easymock.MockedTest.createMethodMocks(MockedTest.java:93)
          [INFO] at com.ac.util.test.easymock.MockedTest.createMethodMocks(MockedTest.java:72)
          [INFO] at com.ac.util.test.easymock.runner.MockedClassMethodsRunner.createMethodRunner(MockedClassMethodsRunner.java:52)
          [INFO] at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
          [INFO] at com.ac.util.test.easymock.runner.MockedClassMethodsRunner.invokeTestMethod(MockedClassMethodsRunner.java:68)
          [INFO] at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
          [INFO] at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
          [INFO] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
          [INFO] at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
          [INFO] at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
          [INFO] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
          [INFO] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
          [INFO] at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
          [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          [INFO] at java.lang.reflect.Method.invoke(Method.java:597)
          [INFO] at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
          [INFO] at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
          [INFO] Caused by: java.lang.ClassNotFoundException: com.ac.dms.datamodel.essentials.AdoService
          [INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          [INFO] at java.security.AccessController.doPrivileged(Native Method)
          [INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          [INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          [INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
          [INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          [INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          [INFO] ... 26 more

          Show
          Lammert Westerhoff added a comment - The stacktrace: [INFO] java.lang.NoClassDefFoundError: com/.../AdoService [INFO] at java.lang.Class.getDeclaredMethods0(Native Method) [INFO] at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [INFO] at java.lang.Class.getMethod0(Class.java:2670) [INFO] at java.lang.Class.getMethod(Class.java:1603) [INFO] at org.easymock.internal.ObjectMethodsFilter.<init>(ObjectMethodsFilter.java:32) [INFO] at org.easymock.internal.MocksControl.createMock(MocksControl.java:48) [INFO] at org.easymock.classextension.EasyMock.createMock(EasyMock.java:50) [INFO] at com.ac.util.test.easymock.MockedTest.createMethodMocks(MockedTest.java:93) [INFO] at com.ac.util.test.easymock.MockedTest.createMethodMocks(MockedTest.java:72) [INFO] at com.ac.util.test.easymock.runner.MockedClassMethodsRunner.createMethodRunner(MockedClassMethodsRunner.java:52) [INFO] at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) [INFO] at com.ac.util.test.easymock.runner.MockedClassMethodsRunner.invokeTestMethod(MockedClassMethodsRunner.java:68) [INFO] at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) [INFO] at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) [INFO] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [INFO] at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) [INFO] at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) [INFO] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) [INFO] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) [INFO] at org.apache.maven.surefire.Surefire.run(Surefire.java:177) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) [INFO] at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) [INFO] Caused by: java.lang.ClassNotFoundException: com.ac.dms.datamodel.essentials.AdoService [INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [INFO] at java.security.AccessController.doPrivileged(Native Method) [INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) [INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) [INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [INFO] ... 26 more
          Hide
          Lammert Westerhoff added a comment -

          And after the previous stacktrace, the build fail with the following stacktrace:

          [ERROR] BUILD ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] Maven execution failed, exit code: '1'
          
          [INFO] ------------------------------------------------------------------------
          [INFO] Trace
          org.apache.maven.lifecycle.LifecycleExecutionException: Maven execution failed, exit code: '1'
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
          	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
          	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
          	at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
          	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 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
          	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
          	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
          	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
          Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
          	at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:133)
          	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
          	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
          	... 16 more
          Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
          	at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
          	at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:67)
          	at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:334)
          	at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:282)
          	at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:262)
          	at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:129)
          	... 18 more
          Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
          	at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:375)
          	at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:393)
          	at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
          	... 23 more
          
          
          Show
          Lammert Westerhoff added a comment - And after the previous stacktrace, the build fail with the following stacktrace: [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Maven execution failed, exit code: '1' [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Maven execution failed, exit code: '1' at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) 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 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1' at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:133) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) ... 16 more Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1' at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89) at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:67) at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:334) at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:282) at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:262) at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:129) ... 18 more Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1' at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:375) at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:393) at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81) ... 23 more
          Hide
          Lammert Westerhoff added a comment -

          I have not been able to reproduce this bug in a smaller project. My project looks similar to this:

          Project X with modules A, B and C.
          Module A depends on module B (compile scope).
          Module B depends on module C (compile scope) and module C with classifier 'tests' (test scope).

          Now in module A, the test fails that is using a class from C. It cannot find the class from C.

          I did find a (quite simple) work around for this. Switching the order of the C and C-tests dependencies around works. So instead of C and then C-tests I now defined first C-tests and then C (within the same pom in the dependencies structure).

          Show
          Lammert Westerhoff added a comment - I have not been able to reproduce this bug in a smaller project. My project looks similar to this: Project X with modules A, B and C. Module A depends on module B (compile scope). Module B depends on module C (compile scope) and module C with classifier 'tests' (test scope). Now in module A, the test fails that is using a class from C. It cannot find the class from C. I did find a (quite simple) work around for this. Switching the order of the C and C-tests dependencies around works. So instead of C and then C-tests I now defined first C-tests and then C (within the same pom in the dependencies structure).
          Hide
          tosc added a comment -

          I have the same problem. Unfortunately the described workaround above doesn't work for me.

          Does anyone has a solution, resp. another workaround?

          Show
          tosc added a comment - I have the same problem. Unfortunately the described workaround above doesn't work for me. Does anyone has a solution, resp. another workaround?
          Hide
          Ryan Lea added a comment -

          I've recently run into this issue also using maven-2.2.1 and maven-release-plugin-2.0-beta9.

          After playing round with a few things I think this may actually be related to the site:deploy goal that is used by default in release:perform.

          http://jira.codehaus.org/browse/MSITE-432

          Show
          Ryan Lea added a comment - I've recently run into this issue also using maven-2.2.1 and maven-release-plugin-2.0-beta9. After playing round with a few things I think this may actually be related to the site:deploy goal that is used by default in release:perform. http://jira.codehaus.org/browse/MSITE-432
          Hide
          Ryan Lea added a comment -

          If I set -Dgoals=deploy and forego the site deployment, everything works fine for me.

          Show
          Ryan Lea added a comment - If I set -Dgoals=deploy and forego the site deployment, everything works fine for me.
          Hide
          Stephen Connolly added a comment -

          Have you tried changing forkMode on surefire... by default forkMode will be none, which means that if the release plugin is pulling in extra classes, they will still be in the JVM (even if classworlds keeps them on a separate classloader)

          Show
          Stephen Connolly added a comment - Have you tried changing forkMode on surefire... by default forkMode will be none, which means that if the release plugin is pulling in extra classes, they will still be in the JVM (even if classworlds keeps them on a separate classloader)
          Hide
          Randall Fidler added a comment -

          Annoying lil bugger isn't it?

          I've tried upgrading from Maven 2.0.9 to 2.2.1

          Using the latest release plugin version (2.0)
          Using the latest surefire plugin (2.5)

          Tried with Java 1.5 and 1.6 (was working fine with 1.5).

          Also tried on Windows and Linux, same result.

          I have also changed the forkmode to pertest, same result.

          From what I see, it appears the 'test' thread is just exiting for some reason because there is no test summary information, "Tests: 400 Passed: 399 Failed: 1..." - it just lists the tests that were running and then there's a build error, with I believe the 'main' thread reporting there were test failures. When I dig through all the test reports, none of them have any issues, it's all clear. What I have noticed is that all tests do not run, something like half of them run and then the build fails (when comparing the test 'time' of release:prepare to release:perform).

          I saw the above comment that it might be site related, so disabled all the site configuration/settings in the pom just to try it out, but same result... test failures for tests that have no failures!!

          It'll be interesting to see what's the cause of this issue.

          Show
          Randall Fidler added a comment - Annoying lil bugger isn't it? I've tried upgrading from Maven 2.0.9 to 2.2.1 Using the latest release plugin version (2.0) Using the latest surefire plugin (2.5) Tried with Java 1.5 and 1.6 (was working fine with 1.5). Also tried on Windows and Linux, same result. I have also changed the forkmode to pertest, same result. From what I see, it appears the 'test' thread is just exiting for some reason because there is no test summary information, "Tests: 400 Passed: 399 Failed: 1..." - it just lists the tests that were running and then there's a build error, with I believe the 'main' thread reporting there were test failures. When I dig through all the test reports, none of them have any issues, it's all clear. What I have noticed is that all tests do not run, something like half of them run and then the build fails (when comparing the test 'time' of release:prepare to release:perform). I saw the above comment that it might be site related, so disabled all the site configuration/settings in the pom just to try it out, but same result... test failures for tests that have no failures!! It'll be interesting to see what's the cause of this issue.
          Hide
          CTT added a comment -

          I'm experiencing the same NoClassDefFoundError/ClassNotFoundException error due to classpath problems with test-jar dependencies.

          Versions of software in use:

          Ubuntu Linux 9.10
          Java version: 1.6.0_12
          Apache Maven 2.2.1 (rdebian-1)
          maven-release-plugin 2.0

          The release plugin triggers three separate executions of my JUnit tests and the test failures only occur on the third test execution. The first test run is part of release:prepare. The next two runs are part of release:perform. The second run builds the release artifacts, and the third test run is part of the "site" goal.

          I'm currently working around this issue by removing the "site" goal.

          The test failures are caused by the inability to locate classes in a project that is providing both a type "test-jar" and a type "jar" artifact. Only the tests that depend on classes in the "test-jar" fail, all the other tests pass.

          Here is the surefire classpath on the second test run:

          [INFO] [DEBUG] Test Classpath :
          [INFO] [DEBUG]   /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/test-classes
          [INFO] [DEBUG]   /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/classes
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0-tests.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-io/commons-io/1.2/commons-io-1.2.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/jibx/jibx-run/1.1.6a/jibx-run-1.1.6a.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0-tests.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/vega/VEGA-RCS-RoomBoards/1.0.0/VEGA-RCS-RoomBoards-1.0.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-context/2.5.6.SEC01/spring-context-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-beans/2.5.6.SEC01/spring-beans-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-core/2.5.6.SEC01/spring-core-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-test/2.5.6.SEC01/spring-test-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/junit/junit/4.4/junit-4.4.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/jibx/jibx-extras/1.1.6a/jibx-extras-1.1.6a.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/mockito/mockito-core/1.8.3/mockito-core-1.8.3.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/objenesis/objenesis/1.0/objenesis-1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/noelios/restlet/com.noelios.restlet/1.1.8/com.noelios.restlet-1.1.8.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/restlet/org.restlet/1.1.8/org.restlet-1.1.8.jar
          

          Here is the surefire classpath on the third (failing) test run:

          [INFO] [DEBUG] Test Classpath :
          [INFO] [DEBUG]   /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/test-classes
          [INFO] [DEBUG]   /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/classes
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-io/commons-io/1.2/commons-io-1.2.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/jibx/jibx-run/1.1.6a/jibx-run-1.1.6a.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/lifetouch/vega/VEGA-RCS-RoomBoards/1.0.0/VEGA-RCS-RoomBoards-1.0.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-context/2.5.6.SEC01/spring-context-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-beans/2.5.6.SEC01/spring-beans-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-core/2.5.6.SEC01/spring-core-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/springframework/spring-test/2.5.6.SEC01/spring-test-2.5.6.SEC01.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/junit/junit/4.4/junit-4.4.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/jibx/jibx-extras/1.1.6a/jibx-extras-1.1.6a.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/mockito/mockito-core/1.8.3/mockito-core-1.8.3.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/objenesis/objenesis/1.0/objenesis-1.0.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/com/noelios/restlet/com.noelios.restlet/1.1.8/com.noelios.restlet-1.1.8.jar
          [INFO] [DEBUG]   /home/ctt/.m2/repository/org/restlet/org.restlet/1.1.8/org.restlet-1.1.8.jar
          

          Note that the third classpath entry ImagePath_Core-2.1.0-tests.jar got converted to ImagePath_Core-2.1.0.jar in the failed test run.

          The JUnit stack traces look like this:

              <error message="com/lifetouch/lti/product/domain/CompositionObjectMother" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: com/lifetouch/lti/product/domain/CompositionObjectMother
                  at com.lifetouch.vega.rcs.impl.AbstractComposerTest.testVerifyAllTermsSupplied_NoTermsInLook(AbstractComposerTest.java:27)
                  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 org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
                  at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
                  at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
                  at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
                  at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
                  at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
                  at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
                  at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                  at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                  at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                  at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                  at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                  at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
                  at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
                  at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
                  at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
                  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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
                  at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
          Caused by: java.lang.ClassNotFoundException: com.lifetouch.lti.product.domain.CompositionObjectMother
                  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                  ... 27 more
              </error>
          

          and finally, the pom.xml looks like this (approximately):

          <project>
              <properties>
          		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
          		
          		<!-- Versions of internal dependencies -->
          		<rcs.room.boards.version>1.0.0</rcs.room.boards.version>
          		<imagepath.version>2.1.0</imagepath.version>
          	</properties>
          
          	<dependencies>
          		<!-- ImagePath Test Jars -->
          		<dependency>
          			<groupId>com.lifetouch.lti</groupId>
          			<artifactId>ImagePath_Core</artifactId>
          			<version>${imagepath.version}</version>
          			<type>test-jar</type>
          			<scope>test</scope>
          		</dependency>
          		<dependency>
          			<groupId>com.lifetouch.lti</groupId>
          			<artifactId>ImagePath_SceneApplication</artifactId>
          			<version>${imagepath.version}</version>
          			<type>test-jar</type>
          			<scope>test</scope>
          		</dependency>
          
          		<!-- ImagePath Production -->
          		<dependency>
          			<groupId>com.lifetouch.lti</groupId>
          			<artifactId>ImagePath_Core</artifactId>
          			<version>${imagepath.version}</version>
          			<scope>compile</scope>
          		</dependency>
          		<dependency>
          			<groupId>com.lifetouch.lti</groupId>
          			<artifactId>ImagePath_SceneApplication</artifactId>
          			<version>${imagepath.version}</version>
          			<scope>compile</scope>
          		</dependency>
          
          		<dependency>
          			<groupId>com.lifetouch.vega</groupId>
          			<artifactId>VEGA-RCS-RoomBoards</artifactId>
          			<version>${rcs.room.boards.version}</version>
          			<scope>runtime</scope>
          		</dependency>
          		<dependency>
          			<groupId>org.springframework</groupId>
          			<artifactId>spring-context</artifactId>
          			<version>2.5.6.SEC01</version>
          			<scope>compile</scope>
          		</dependency>
          		<dependency>
          			<groupId>org.springframework</groupId>
          			<artifactId>spring-test</artifactId>
          			<version>2.5.6.SEC01</version>
          			<scope>test</scope>
          		</dependency>
          		<dependency> 
          			<groupId>org.jibx</groupId>
          			<artifactId>jibx-extras</artifactId>
          			<version>1.1.6a</version>
          			<scope>test</scope>
          		</dependency>
          		<dependency> 
          			<groupId>xpp3</groupId>
          			<artifactId>xpp3</artifactId>
          			<version>1.1.3.4.O</version>
          			<scope>test</scope>
          		</dependency>
          		<dependency>
          			<groupId>junit</groupId>
          			<artifactId>junit</artifactId>
          			<version>4.4</version>
          			<type>jar</type>
          			<scope>test</scope>
          		</dependency>
          		<dependency>
          			<groupId>org.mockito</groupId>
          			<artifactId>mockito-core</artifactId>
          			<version>1.8.3</version>
          			<scope>test</scope>
          		</dependency>
          		<dependency>
          			<groupId>com.noelios.restlet</groupId>
          			<artifactId>com.noelios.restlet</artifactId>
          			<version>1.1.8</version>
          			<scope>compile</scope>
          		</dependency>	
          		<dependency>
          			<groupId>commons-logging</groupId>
          			<artifactId>commons-logging</artifactId>
          			<version>1.1.1</version>
          			<scope>compile</scope>
          		</dependency>	
          	</dependencies>
          
          	<build>
          		<plugins>
          			<plugin>
          				<groupId>org.apache.maven.plugins</groupId>
          				<artifactId>maven-release-plugin</artifactId>
          				<version>2.0</version>
          				<configuration>
          					<tagBase>...</tagBase>
          					<goals>clean package deploy</goals>
          				</configuration>
          			</plugin>
          			<plugin>
          				<groupId>org.apache.maven.plugins</groupId>
          				<artifactId>maven-compiler-plugin</artifactId>
          				<configuration>
          					<source>1.6</source>
          					<target>1.6</target>
          				</configuration>
          			</plugin>
          			<plugin>
          				<groupId>org.apache.maven.plugins</groupId>
          				<artifactId>maven-surefire-plugin</artifactId>
          				<version>2.5</version>
          				<configuration>
          					<forkMode>once</forkMode>
          					<redirectTestOutputToFile>true</redirectTestOutputToFile>
          					<argLine>-Xms256m -Xmx1024m</argLine>
          					<testFailureIgnore>false</testFailureIgnore>
          					<skip>false</skip>
          					<includes>
          						<include>**/*Test.java</include>
          						<include>**/*TestFunc.java</include>
          					</includes>
          					<excludes>
          						<exclude>**/*TestCase.java</exclude>
          						<exclude>**/*Tester.java</exclude>
          					</excludes>
          				</configuration>
          			</plugin>
          			<plugin>
          				<groupId>org.jibx</groupId>
          				<artifactId>maven-jibx-plugin</artifactId>
          				<version>1.1.6a</version>
          				<configuration>
          					<includes>
          						<includes>*_binding*.xml</includes>
          					</includes>
          				</configuration>
          				<executions>
          					<execution>
          						<goals>
          							<goal>bind</goal>
          						</goals>
          					</execution>
          				</executions>
          			</plugin>
          		</plugins>
          	</build>
          	<reporting>
          		<plugins>
          		</plugins>
          	</reporting>
          	<distributionManagement>
          	</distributionManagement>
          </project>
          
          Show
          CTT added a comment - I'm experiencing the same NoClassDefFoundError/ClassNotFoundException error due to classpath problems with test-jar dependencies. Versions of software in use: Ubuntu Linux 9.10 Java version: 1.6.0_12 Apache Maven 2.2.1 (rdebian-1) maven-release-plugin 2.0 The release plugin triggers three separate executions of my JUnit tests and the test failures only occur on the third test execution. The first test run is part of release:prepare. The next two runs are part of release:perform. The second run builds the release artifacts, and the third test run is part of the "site" goal. I'm currently working around this issue by removing the "site" goal. The test failures are caused by the inability to locate classes in a project that is providing both a type "test-jar" and a type "jar" artifact. Only the tests that depend on classes in the "test-jar" fail, all the other tests pass. Here is the surefire classpath on the second test run: [INFO] [DEBUG] Test Classpath : [INFO] [DEBUG] /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/test-classes [INFO] [DEBUG] /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/classes [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0-tests.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-io/commons-io/1.2/commons-io-1.2.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/jibx/jibx-run/1.1.6a/jibx-run-1.1.6a.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0-tests.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/vega/VEGA-RCS-RoomBoards/1.0.0/VEGA-RCS-RoomBoards-1.0.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-context/2.5.6.SEC01/spring-context-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-beans/2.5.6.SEC01/spring-beans-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-core/2.5.6.SEC01/spring-core-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-test/2.5.6.SEC01/spring-test-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/junit/junit/4.4/junit-4.4.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/jibx/jibx-extras/1.1.6a/jibx-extras-1.1.6a.jar [INFO] [DEBUG] /home/ctt/.m2/repository/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/mockito/mockito-core/1.8.3/mockito-core-1.8.3.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/objenesis/objenesis/1.0/objenesis-1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/noelios/restlet/com.noelios.restlet/1.1.8/com.noelios.restlet-1.1.8.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/restlet/org.restlet/1.1.8/org.restlet-1.1.8.jar Here is the surefire classpath on the third (failing) test run: [INFO] [DEBUG] Test Classpath : [INFO] [DEBUG] /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/test-classes [INFO] [DEBUG] /home/ctt/workspace_head/RenderableCreationServiceTemp/target/checkout/target/classes [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-io/commons-io/1.2/commons-io-1.2.jar [INFO] [DEBUG] /home/ctt/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/jibx/jibx-run/1.1.6a/jibx-run-1.1.6a.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_Core/2.1.0/ImagePath_Core-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/lti/ImagePath_SceneApplication/2.1.0/ImagePath_SceneApplication-2.1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/lifetouch/vega/VEGA-RCS-RoomBoards/1.0.0/VEGA-RCS-RoomBoards-1.0.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-context/2.5.6.SEC01/spring-context-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-beans/2.5.6.SEC01/spring-beans-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-core/2.5.6.SEC01/spring-core-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/springframework/spring-test/2.5.6.SEC01/spring-test-2.5.6.SEC01.jar [INFO] [DEBUG] /home/ctt/.m2/repository/junit/junit/4.4/junit-4.4.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/jibx/jibx-extras/1.1.6a/jibx-extras-1.1.6a.jar [INFO] [DEBUG] /home/ctt/.m2/repository/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/mockito/mockito-core/1.8.3/mockito-core-1.8.3.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/objenesis/objenesis/1.0/objenesis-1.0.jar [INFO] [DEBUG] /home/ctt/.m2/repository/com/noelios/restlet/com.noelios.restlet/1.1.8/com.noelios.restlet-1.1.8.jar [INFO] [DEBUG] /home/ctt/.m2/repository/org/restlet/org.restlet/1.1.8/org.restlet-1.1.8.jar Note that the third classpath entry ImagePath_Core-2.1.0-tests.jar got converted to ImagePath_Core-2.1.0.jar in the failed test run. The JUnit stack traces look like this: <error message="com/lifetouch/lti/product/domain/CompositionObjectMother" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: com/lifetouch/lti/product/domain/CompositionObjectMother at com.lifetouch.vega.rcs.impl.AbstractComposerTest.testVerifyAllTermsSupplied_NoTermsInLook(AbstractComposerTest.java:27) 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 org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102) at org.apache.maven.surefire.Surefire.run(Surefire.java:180) 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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021) Caused by: java.lang.ClassNotFoundException: com.lifetouch.lti.product.domain.CompositionObjectMother at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 27 more </error> and finally, the pom.xml looks like this (approximately): <project> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!-- Versions of internal dependencies --> <rcs.room.boards.version>1.0.0</rcs.room.boards.version> <imagepath.version>2.1.0</imagepath.version> </properties> <dependencies> <!-- ImagePath Test Jars --> <dependency> <groupId>com.lifetouch.lti</groupId> <artifactId>ImagePath_Core</artifactId> <version>${imagepath.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>com.lifetouch.lti</groupId> <artifactId>ImagePath_SceneApplication</artifactId> <version>${imagepath.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <!-- ImagePath Production --> <dependency> <groupId>com.lifetouch.lti</groupId> <artifactId>ImagePath_Core</artifactId> <version>${imagepath.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.lifetouch.lti</groupId> <artifactId>ImagePath_SceneApplication</artifactId> <version>${imagepath.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.lifetouch.vega</groupId> <artifactId>VEGA-RCS-RoomBoards</artifactId> <version>${rcs.room.boards.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>2.5.6.SEC01</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>2.5.6.SEC01</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jibx</groupId> <artifactId>jibx-extras</artifactId> <version>1.1.6a</version> <scope>test</scope> </dependency> <dependency> <groupId>xpp3</groupId> <artifactId>xpp3</artifactId> <version>1.1.3.4.O</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <type>jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>1.8.3</version> <scope>test</scope> </dependency> <dependency> <groupId>com.noelios.restlet</groupId> <artifactId>com.noelios.restlet</artifactId> <version>1.1.8</version> <scope>compile</scope> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> <scope>compile</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.0</version> <configuration> <tagBase>...</tagBase> <goals>clean package deploy</goals> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.5</version> <configuration> <forkMode>once</forkMode> <redirectTestOutputToFile>true</redirectTestOutputToFile> <argLine>-Xms256m -Xmx1024m</argLine> <testFailureIgnore>false</testFailureIgnore> <skip>false</skip> <includes> <include>**/*Test.java</include> <include>**/*TestFunc.java</include> </includes> <excludes> <exclude>**/*TestCase.java</exclude> <exclude>**/*Tester.java</exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.jibx</groupId> <artifactId>maven-jibx-plugin</artifactId> <version>1.1.6a</version> <configuration> <includes> <includes>*_binding*.xml</includes> </includes> </configuration> <executions> <execution> <goals> <goal>bind</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <reporting> <plugins> </plugins> </reporting> <distributionManagement> </distributionManagement> </project>
          Show
          Michael Osipov added a comment - Is anyone shading here? You might have been struck by http://jira.codehaus.org/browse/MNG-2045?focusedCommentId=321718&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-321718

            People

            • Assignee:
              Unassigned
              Reporter:
              Adrian
            • Votes:
              7 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: