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
          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: