Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-953

NullPointerException in BuildInfoRecorder.addArtifactsToCurrentModule

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.12.0, 2.12.1
    • Fix Version/s: 2.12.2
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Regression:
      Yes

      Description

      The following NPE occurs after executing mvn versions:set starting with version 2.12.0. The issue does not occur with 2.11.0.

      [main] ERROR org.apache.maven.cli.MavenCli - NullPointerException
      java.lang.NullPointerException
      	at org.jfrog.build.extractor.maven.BuildInfoRecorder.addArtifactsToCurrentModule(BuildInfoRecorder.java:540)
      	at org.jfrog.build.extractor.maven.BuildInfoRecorder.addFilesToCurrentModule(BuildInfoRecorder.java:485)
      	at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeAndAddModule(BuildInfoRecorder.java:472)
      	at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeModule(BuildInfoRecorder.java:398)
      	at org.jfrog.build.extractor.maven.BuildInfoRecorder.projectSucceeded(BuildInfoRecorder.java:214)
      	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:74)
      	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:126)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      

      The pom.xml is extremely simple:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>mygroup</groupId>
          <artifactId>myproject</artifactId>
          <version>0-SNAPSHOT</version>
          <packaging>jar</packaging>
      
          <dependencies>
              <dependency>
                  <groupId>com.google.guava</groupId>
                  <artifactId>guava</artifactId>
                  <version>21.0</version>
              </dependency>
      
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.12</version>
                  <scope>test</scope>
              </dependency>
          </dependencies>
      </project>
      

      In case it matters, this is part of a (multibranch) pipeline project:

          def server = Artifactory.server("...")
          def maven = Artifactory.newMavenBuild()
          maven.tool = "Maven 3.3.9"
          maven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
          maven.deployer releaseRepo:'libs-release-local', snapshotRepo:'libs-snapshot-local', server: server
          // ...
          stage('Set Version') {
              maven.opts = "-DnewVersion=${version} -DartifactId=* -DoldVersion=*"
              maven.run pom: 'pom.xml', goals: 'versions:set'
          }
          stage('Build') {
              maven.opts = '...'
              buildInfo = maven.run pom: 'pom.xml', goals: profiles + ' clean install site'
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eyalb Eyal Ben Moshe
                Reporter:
                trevorr Trevor Robinson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: