4 Replies Latest reply on Jul 4, 2007 12:32 PM by pgier

    Problems with maven builds again

      I created a new project that uses Maven and built it, then imported it into svn and
      once I checked it out again, it stopped building (didn't find the dependent jars for compilation).

      jbossas/projects/integration

      To try to fix the problem, I did the usual trick of blowing away my local maven repository,
      but that still didn't fix it.

      I then compared it with the microcontainer pom and found a difference.
      The mc was using

       <packaging>pom</packaging>
      

      instead of jar.

      I changed it and then it compiled? No idea how it compiled before if this is the reason.

      To make sure I had it working, I did a mvn clean and mvn assembly:assembly
      and now it throws an NPE
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building JBoss Transaction 5.0.0 SPI
      [INFO] ----------------------------------------------------------------------------
      [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
      [INFO] [site:attach-descriptor]
      [INFO] [assembly:assembly]
      [INFO] Reading assembly descriptor: /home/ejort/integration/build/assembly/bin.xml
      [INFO] Reading assembly descriptor: /home/ejort/integration/build/assembly/sources.xml
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] null
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NullPointerException
       at org.apache.maven.plugin.assembly.archive.ManifestCreationFinalizer.getVirtualFiles(ManifestCreationFinalizer.java:99)
       at org.codehaus.plexus.archiver.AbstractArchiver.hasVirtualFiles(AbstractArchiver.java:546)
       at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:258)
       at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:242)
       at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:513)
       at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:103)
       at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:278)
       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.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:219)
       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:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       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)
      


      Not only that my MC build is failing on a different NPE
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building JBoss Deployers Core SPI
      [INFO] task-segment: [install]
      [INFO] ----------------------------------------------------------------------------
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [jboss-retro:retro-compile {execution: default}]
      [INFO] [retro] Compiling classes for jdk14
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [surefire:test]
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] null
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NullPointerException
       at org.apache.maven.plugin.surefire.SurefirePlugin.constructSurefireBooter(SurefirePlugin.java:594)
       at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:391)
       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:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       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)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 44 seconds
      [INFO] Finished at: Wed Jul 04 17:04:49 CEST 2007
      [INFO] Final Memory: 24M/73M
      [INFO] ------------------------------------------------------------------------
      


        • 1. Re: Problems with maven builds again

          Actually, changing it to packaging=pom means it doesn't compile anything
          so it wasn't even fixed.

          • 2. Re: Problems with maven builds again

            I've found a way to fix the integration build, but I don't understand it
            or why it worked before.

            The microcontainer/build/pom.xml has

             <dependencyManagement>
             <!-- The parent pom manages the inter-dependencies of the modules. -->
             <dependencies>
             <dependency>
             <groupId>org.jboss.microcontainer</groupId>
             <artifactId>jboss-aop-mc-int</artifactId>
             <version>${project.version}</version>
             </dependency>
            etc.
            


            I copied this style into integration/build/pom.xml
            it doesn't work.

            However, if I remove the dependencyManagement element then it works?

            • 3. Re: Problems with maven builds again

              And doing a full clean of my MC build fixed the other NPE.

              NPE is not an acceptable error message, and it shouldn't even be failing in the first place.

              If I had time I'd report these as bugs to Maven, but I'd have to investigate them
              first so I know how to reproduce them.

              "reboot Windows every day" is not a solution. :-)

              • 4. Re: Problems with maven builds again
                pgier

                I think the second NPE that you ran into was probably this one:
                http://jira.codehaus.org/browse/SUREFIRE-300

                Looks like it has been fixed, but the fixed version hasn't been released yet.

                I'm not sure about the other one, looks like it could have been something wrong in the assembly configuration. If you try "mvn -X" it will enable debugging, and sometimes this gives more information, but obviously the error handling could be better.

                The pom packaging type is just for things like a parent pom. So that's why it doesn't compile any of the java files. Maven thinks that your project is just a pom.

                The dependency management is in there to manage the inter-module dependencies. That way we don't have something like module A and B dependent on module C version 2 and C 2.1 respectively.