Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2295

Jenkins cannot handle modules added by profiles - if profile is not activated via '-P' (was: Assertion in MavenModuleSetBuild for aggregator POM with modules provided by profile)

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Platform: All, OS: All

      The root POM of one of our Maven2 projects aggregates sub-modules which are
      defined in a set of profiles. So within this POM there's no <modules> defined
      outside of a profile.

      Building this project from the commandline via "mvn -P<profile1>,<profileN>
      clean install" is working like a charme. But using the same commandline from
      within a Hudson (build 2.251) Maven2 job the following exception occurs after
      installing the root POM and starting to clean the first of the aggregated
      sub-modules:

      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] reporters.get(com.acme.vk.backend:base)==null.
      reporters=

      {com.acme.vk:base=[hudson.maven.reporters.MavenMailer@260657, hudson.maven.reporters.MavenArtifactArchiver@16339b2, hudson.maven.reporters.MavenFingerprinter@c2ea0b, hudson.maven.reporters.MavenJavadocArchiver@6a4209, hudson.maven.reporters.MavenSiteArchiver@1575b4, hudson.maven.reporters.SurefireArchiver@e284ab, hudson.maven.reporters.BuildInfoRecorder@1743073]}

      proxies=

      {com.acme.vk:base=hudson.maven.MavenModuleSetBuild$Builder$FilterImpl@118e241}

      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.AssertionError: reporters.get(com.acme.vk.backend:base)==null.
      reporters=

      {com.acme.vk:base=[hudson.maven.reporters.MavenMailer@260657, hudson.maven.reporters.MavenArtifactArchiver@16339b2, hudson.maven.reporters.MavenFingerprinter@c2ea0b, hudson.maven.reporters.MavenJavadocArchiver@6a4209, hudson.maven.reporters.MavenSiteArchiver@1575b4, hudson.maven.reporters.SurefireArchiver@e284ab, hudson.maven.reporters.BuildInfoRecorder@1743073]}

      proxies=

      {com.acme.vk:base=hudson.maven.MavenModuleSetBuild$Builder$FilterImpl@118e241}

      at
      hudson.maven.MavenModuleSetBuild$Builder.postModule(MavenModuleSetBuild.java:573)
      at hudson.maven.MavenBuilder$Adapter.fireLeaveModule(MavenBuilder.java:284)
      at hudson.maven.MavenBuilder$Adapter.postBuild(MavenBuilder.java:242)
      at
      org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:45)
      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:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at hudson.maven.agent.Main.launch(Main.java:133)
      at hudson.maven.MavenBuilder.call(MavenBuilder.java:139)
      at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:543)
      at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:489)
      at hudson.remoting.UserRequest.perform(UserRequest.java:69)
      at hudson.remoting.UserRequest.perform(UserRequest.java:23)
      at hudson.remoting.Request$2.run(Request.java:213)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      at
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)

      Copying the <modules> block from one of the profiles directly into the root POM
      "fixes" this issue.

          [JENKINS-2295] Jenkins cannot handle modules added by profiles - if profile is not activated via '-P' (was: Assertion in MavenModuleSetBuild for aggregator POM with modules provided by profile)

          tjuerge created issue -

          Around 2008 January, the handling of profiles was added to handle this kind of
          cases. Any chance you were using older version of Hudson?

          Otherwise, any chance you can provide a test case?

          Kohsuke Kawaguchi added a comment - Around 2008 January, the handling of profiles was added to handle this kind of cases. Any chance you were using older version of Hudson? Otherwise, any chance you can provide a test case?
          Kohsuke Kawaguchi made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          tjuerge added a comment -

          Kohsuke, don't worry. This issue didn't happen anymore (Hudson 1.314, Maven 2.1.0).

          tjuerge added a comment - Kohsuke, don't worry. This issue didn't happen anymore (Hudson 1.314, Maven 2.1.0).
          tjuerge made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Recent recurrence of this in
          http://www.nabble.com/Bug-2295%3A-java.lang.AssertionError%3A-reporters.get-seems-to-have--reappeared-in-1.314-td24424497.html

          This time the profile is activated by a file.

          It seems to me that Hudson should give up the assumption that it can correctly
          pre-compute the modules that will be built, and just need to cope with the
          possibility that Maven may build additional modules in the reactor.

          Kohsuke Kawaguchi added a comment - Recent recurrence of this in http://www.nabble.com/Bug-2295%3A-java.lang.AssertionError%3A-reporters.get-seems-to-have--reappeared-in-1.314-td24424497.html This time the profile is activated by a file. It seems to me that Hudson should give up the assumption that it can correctly pre-compute the modules that will be built, and just need to cope with the possibility that Maven may build additional modules in the reactor.
          Kohsuke Kawaguchi made changes -
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          I'm seeing this error with hudson 1.336 and a pom with 2 profiles (JDK activated).

          [INFO] reporters.get(org.sakaiproject:sakai-search-test-1.5)==null. reporters={

          I've snipped out the list of reportes as on my build it's 100s of lines.

          at hudson.maven.MavenModuleSetBuild$Builder.postModule(MavenModuleSetBuild.java:718)
          at hudson.maven.MavenBuilder$Adapter.fireLeaveModule(MavenBuilder.java:304)
          at hudson.maven.MavenBuilder$Adapter.postBuild(MavenBuilder.java:262)
          at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:68)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
          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:592)
          at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
          at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
          at hudson.maven.agent.Main.launch(Main.java:165)
          at hudson.maven.MavenBuilder.call(MavenBuilder.java:159)
          at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:688)
          at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632)
          at hudson.remoting.UserRequest.perform(UserRequest.java:104)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:270)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
          at java.util.concurrent.FutureTask.run(FutureTask.java:123)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          at java.lang.Thread.run(Thread.java:595)

          Matthew Buckett added a comment - I'm seeing this error with hudson 1.336 and a pom with 2 profiles (JDK activated). [INFO] reporters.get(org.sakaiproject:sakai-search-test-1.5)==null. reporters={ I've snipped out the list of reportes as on my build it's 100s of lines. at hudson.maven.MavenModuleSetBuild$Builder.postModule(MavenModuleSetBuild.java:718) at hudson.maven.MavenBuilder$Adapter.fireLeaveModule(MavenBuilder.java:304) at hudson.maven.MavenBuilder$Adapter.postBuild(MavenBuilder.java:262) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:68) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 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:592) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:165) at hudson.maven.MavenBuilder.call(MavenBuilder.java:159) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:688) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632) at hudson.remoting.UserRequest.perform(UserRequest.java:104) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595)

          Testcase to reproduce bug.

          Steps when reproducing:

          • Build project (should build ok).
          • Configure the project.
          • Ste the JDK to version 5.
          • Build the project (fails). It still lists the module for 1.6.

          Attached is the console output for the failed build.

          Matthew Buckett added a comment - Testcase to reproduce bug. Steps when reproducing: Create new Maven 2 job (eg called testcase). Set Subversion as source control. Set SVN URL https://svn.oucs.ox.ac.uk/projects/vle/sakai/testcase/ Set JDK to version 6. Maven 2.2.1, pom.xml, install target. Save Build project (should build ok). Configure the project. Ste the JDK to version 5. Build the project (fails). It still lists the module for 1.6. Attached is the console output for the failed build.
          Matthew Buckett made changes -
          Attachment New: testcase.tgz [ 18930 ]
          Attachment New: testcase-build.log [ 18931 ]

            Unassigned Unassigned
            tjuerge tjuerge
            Votes:
            13 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: