Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
4.0.2
-
None
-
Linux 2.6.32-504.23.4.el6.x86_64 #1 SMP GNU/Linux
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00)
Maven home: /opt/maven/default
Java version: 1.8.0_60, vendor: Oracle Corporation
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.23.4.el6.x86_64", arch: "amd64", family: "unix"Linux 2.6.32-504.23.4.el6.x86_64 #1 SMP GNU/Linux java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00) Maven home: /opt/maven/default Java version: 1.8.0_60, vendor: Oracle Corporation Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-504.23.4.el6.x86_64", arch: "amd64", family: "unix"
Description
When using the karaf-maven-plugin version 4.0.2-SNAPSHOT with the features-add-to-repository goal, I get an NPE when a feature has a protocol of blueprint:file:
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.2-SNAPSHOT:features-add-to-repository (features-add-to-repository) on project myproject: Execution features-add-to-repository of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.2-SNAPSHOT:features-add-to-repository failed: Can't resolve artifact null: NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.2-SNAPSHOT:features-add-to-repository (features-add-to-repository) on project myproject: Execution features-add-to-repository of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.2-SNAPSHOT:features-add-to-repository failed: Can't resolve artifact null at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224) 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:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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:497) 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.PluginExecutionException: Execution features-add-to-repository of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.2-SNAPSHOT:features-add-to-repository failed: Can't resolve artifact null at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more Caused by: java.lang.RuntimeException: Can't resolve artifact null at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveArtifact(AbstractFeatureMojo.java:144) at org.apache.karaf.tooling.features.AddToRepositoryMojo.copyBundlesToDestRepository(AddToRepositoryMojo.java:75) at org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:63) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more Caused by: java.lang.NullPointerException at org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveArtifact(AbstractFeatureMojo.java:138) ... 24 more
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features name="myfeatures" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"> <feature name="myfeature" version="${project.version}" > <bundle start-level="50">blueprint:file:static-content-servlet.xml</bundle> </feature> </features>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>4.0.2-SNAPSHOT</version>
<executions>
<execution>
<id>features-add-to-repository</id>
<phase>prepare-package</phase>
<goals>
<goal>features-add-to-repository</goal>
</goals>
<configuration>
<descriptors>
<descriptor>file:features.xml</descriptor>
</descriptors>
<repository>target/system</repository>
<karafVersion>4.0.1</karafVersion>
</configuration>
</execution>
</executions>
</plugin>
Seems related to https://issues.apache.org/jira/browse/KARAF-3638, but different. All my other dependencies download and copy into the target repository normally.