karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodrigo Serra <rodrigo.se...@jlab.com.ar>
Subject Re: [UPDATE] New install-kar goal of karaf-maven-plugin
Date Wed, 24 Sep 2014 09:38:53 GMT
Hi JB,

I test again and NPE is gone and no more references to my working directory :)

I Have a new problem, I thinks this is related to my project configuration. When start karaf
i see errors related to unresolved bundles. Maybe some kars o features dependencies are missing.
This is the list of bundles extracted from the log:

org.apache.karaf.features:spring:xml:features:3.0.2-SNAPSHOT
org.apache.karaf.management:org.apache.karaf.management.server
org.apache.karaf.package:org.apache.karaf.package.core:jar:3.0.2-SNAPSHOT
org.apache.mina:mina-core:jar:2.0.7
org.apache.karaf.config:org.apache.karaf.config.core:jar:3.0.2-SNAPSHOT
org.apache.karaf.kar:org.apache.karaf.kar.core:jar:3.0.2-SNAPSHOT
org.apache.karaf.instance:org.apache.karaf.instance.core:jar:3.0.2-SNAPSHOT
org.eclipse.equinox:region:jar:1.0.0.v20110506

This is my pom file:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <artifactId>sgc</artifactId>
        <groupId>ar.com.jlab</groupId>
        <version>1.1.13-SNAPSHOT</version>
    </parent>

    <groupId>ar.com.jlab.sgc.sgc-assembly</groupId>
    <artifactId>sgc</artifactId>
    <packaging>karaf-assembly</packaging>

    <name>SGC :: Assembly</name>
    <dependencies>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <version>${karaf.version}</version>
            <type>kar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <version>${karaf.version}</version>
            <artifactId>standard</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <version>${karaf.version}</version>
            <artifactId>enterprise</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ar.com.jlab.sgc.sgc-features</groupId>
            <artifactId>sgc</artifactId>
            <version>1.1.13-SNAPSHOT</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ar.com.jlab.osgi.derby</groupId>
            <artifactId>osgi-derby-feature</artifactId>
            <version>${osgi-derby.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>${pom.basedir}/src/main</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <property name="versionNumerica" value="${project.version}"
/>
                                <script language="javascript">
                                    var versionNumerica = project.getProperty("versionNumerica");
                                    project.setProperty("versionNumerica", versionNumerica.replaceAll("-",
"."));
                                </script>
                            </tasks>
                            <exportAntProperties>true</exportAntProperties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>resource</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <filtering>true</filtering>
                                    <directory>src/main/resources/</directory>
                                </resource>
                            </resources>
                            <outputDirectory>target/assembly</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>${karaf.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <resourcesDir>${basedir}/target/resources</resourcesDir>
                    <bootFeatures>
                        <feature>wrapper</feature>
                        <feature>derby-server</feature>
                        <feature>sgc</feature>
                    </bootFeatures>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


El 24/09/2014, a las 03:46, Jean-Baptiste Onofré <jb@nanthrax.net> escribió:

> I fixed it.
> 
> I'm preparing some tests.
> 
> Regards
> JB
> 
> On 09/24/2014 07:08 AM, Jean-Baptiste Onofré wrote:
>> OK, I see a small mistake in the update of
>> etc/org.apache.karaf.features.cfg file.
>> 
>> I gonna fix that.
>> 
>> 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é <jb@nanthrax.net>
>>> 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é
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message