Hi Rodrigo,

For the first point, I'm not sure to follow you.
You build the Karaf assembly to create the tar.gz/zip file and copy on a VM without Internet connection ?

For the second point, can you run with mvn -X to get details.
The NPE is at line 178 or the goal, and here, it's where it checks the artifact classifier. I added a test to avoid the NPE if classifier is null.

Can you provide to me your pom.xml/project to work directly on my machine ?

Thanks,
Regards
JB

On 09/23/2014 10:55 PM, Rodrigo Serra wrote:
Hi JB,

I compile and run the generated assembly in a VM without internet access. The 
resulting assembly has reference to directories of my development environment. 
This is can be see in the karaf log:

2014-09-23 17:45:33,573 | WARN  | FelixStartLevel  | FeaturesServiceImpl        
      | 20 - org.apache.karaf.features.core - 3.0.2.SNAPSHOT | Unable to add 
features repository 
/Users/rserra/NetBeansProjects/Lecici/sgc/assembly/target/assembly/system/org/apache/karaf/features/framework/3.0.2-SNAPSHOT/framework-3.0.2-SNAPSHOT-features.xml
 at startup
java.lang.IllegalArgumentException: invalid URI: 
/Users/rserra/NetBeansProjects/Lecici/sgc/assembly/target/assembly/system/org/apache/karaf/features/framework/3.0.2-SNAPSHOT/framework-3.0.2-SNAPSHOT-features.xml

"/Users/rserra/NetBeansProjects/Lecici/sgc" is the project root on my machine.

Another problem was a generation of NPE if a regular jar is on dependencies: 
(is not necessary for my project, I included this dependencies in my last 
intent to generate a completed assembly)

[ERROR] Failed to execute goal 
org.apache.karaf.tooling:karaf-maven-plugin:3.0.2-SNAPSHOT:install-kars 
(default-install-kars) on project sgc: Execution default-install-kars of goal 
org.apache.karaf.tooling:karaf-maven-plugin:3.0.2-SNAPSHOT:install-kars failed. 
NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.karaf.tooling:karaf-maven-plugin:3.0.2-SNAPSHOT:install-kars 
(default-install-kars) on project sgc: Execution default-install-kars of goal 
org.apache.karaf.tooling:karaf-maven-plugin:3.0.2-SNAPSHOT:install-kars failed.
        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:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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 
default-install-kars of goal 
org.apache.karaf.tooling:karaf-maven-plugin:3.0.2-SNAPSHOT:install-kars failed.
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: java.lang.NullPointerException
        at 
org.apache.karaf.tooling.features.InstallKarsMojo.execute(InstallKarsMojo.java:178)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        ... 20 more


Regards,
Rodrigo

El 23/09/2014, a las 16:28, Jean-Baptiste Onofré <[email protected]> escribió:

Hi guys,

as discussed with some of you on IRC, I pushed my refactoring of the 
karaf-maven-plugin. For now, I only pushed the install-kar goal (I will push 
the feature-generate-descriptor goal tomorrow).

This "new" install-kar goal now work recursively to resolve transitive features 
repositories and features.

It simplifies the custom distribution creation and avoid Karaf to download some 
"core" artifacts from Internet at startup.

If you have some time to test it, it would be helpful.

I keep you posted for the other goals.

Thanks,
Regards
JB
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to