Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5311

NPE in karaf-maven-plugin when specifying descriptor by file url

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 4.1.3, 4.2.0.M1
    • karaf
    • None

    Description

      Upgrading from Karaf 4.1.1 to 4.1.2 caused the build to fail with

      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.2:features-add-to-repository (features-add-to-repository) on project myProject: Error populating repository: NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.2:features-add-to-repository (features-add-to-repository) on project myProject: Error populating repository
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      	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)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating repository
      	at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:267)
      	at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:58)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      	... 20 more
      Caused by: java.lang.NullPointerException
      	at org.apache.karaf.tooling.features.AbstractFeatureMojo.retrieveDescriptorsRecursively(AbstractFeatureMojo.java:125)
      	at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:236)
      	... 23 more
      

      My karaf-maven-plugin is configured

      <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>karaf-maven-plugin</artifactId>
          <executions>
              <execution>
                  <id>features-add-to-repository</id>
                  <phase>prepare-package</phase>
                  <goals>
                      <goal>features-add-to-repository</goal>
                  </goals>
                  <configuration>
                      <addTransitiveFeatures>false</addTransitiveFeatures>
                      <descriptors>
                          <descriptor>file:${basedir}/target/classes/${project.artifactId}-features.xml</descriptor>
                      </descriptors>
                      <repository>${setup.folder}/${karaf.folder}/system</repository>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      

      This worked fine in 4.1.1, but it looks like KARAF-3347 caused specifying the descriptor with file: to no longer work.

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              emily.berk Emily Berk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: