Hi folks,

 

I'm relatively new to Karaf and I'm struggling since a few days about
solving a problem of dependencies. I don't know if I'm doing something
wrong, if it's a proxy issue or if it's not handled by Karaf
Provisioning. I didn't found any previous post about this in the mailing
list.

 

My problem is that I'm building a custom bundle, which I can
successfully deploy in Karaf, but  the dependencies of this bundle
aren't deployed and the bundle won't start. I tried to make a feature of
this bundle by adding the direct dependencies as
<bundle>mvn:....</bundle> entries. All these dependencies are deployed
now in the system/ repo, however the dependencies of the dependencies
are not deployed. This will be a recurrent issue until reaching the end
of the dependencies chain.

 

Do I have to include all dependencies (and all dependencies of
dependencies of...) as a <bundle>mvn:....</bundle> entry in my feature
description?  Or did I overlooked a way to do it automatically? Or
should Karaf automatically try do get those dependencies from the MVN
repositories defined in the 'org.ops4j.pax.url.mvn.repositories'
property?

 

Many thanks in advance for any help :)

 

Cheers,

Fulco

 

 

 

For information, I'm using Karaf 2.2.1 and Maven 3 for my project. My
bundle's POM contains the following dependencies:

<dependencies>
    <dependency>
        <groupId>org.springframework.ldap</groupId>
        <artifactId>org.springframework.ldap</artifactId>
        <version>1.3.0.RELEASE </version>
    </dependency>
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
 
<artifactId>com.springsource.com.thoughtworks.xstream</artifactId>
        <version> 1.3.1 </version>
    </dependency>
</dependencies>

And the JAR file is build by the maven-bundle-plugin, configured like

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <instructions>
 
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
            <Bundle-Version>${project.version}</Bundle-Version>
 
<Export-Package>${bundle.namespace}.*;version="${project.version}"</Expo
rt-Package>
        </instructions>
    </configuration>
</plugin>

I followed the Custom distribution
<http://karaf.apache.org/manual/2.2.1-SNAPSHOT/developers-guide/custom-d
istribution.html>  guide. The feature-maven-plugin configuration looks
like:

<plugin>
    <groupId>org.apache.karaf.tooling</groupId>
    <artifactId>features-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>add-features-to-repo</id>
           <phase>generate-resources</phase>
            <goals>
                <goal>add-features-to-repo</goal>
            </goals>
            <configuration>
                <descriptors>
 
<descriptor>mvn:org.apache.karaf.assemblies.features/standard/2.2.1/xml/
features</descriptor>
 
<descriptor>mvn:com.myapps/features/${myapps.release}/xml/features</desc
riptor>
                </descriptors>

                <features>
                    <feature>config</feature>
                    <feature>ssh</feature>
                    <feature>management</feature>
                    <feature>jetty</feature>
                    <feature>webconsole</feature>
                    <feature>war</feature>
                    <feature>spring</feature>
                    <feature>spring-web</feature>
                    <feature>spring-dm</feature>
                    <feature>spring-dm-web</feature>

                    <feature>my-custom-bundle</feature>
                </features>

 
<includeMvnBasedDescriptors>true</includeMvnBasedDescriptors>
                <repository>target/features-repo</repository>
                <addTransitiveFeatures>true</addTransitiveFeatures>
            </configuration>
        </execution>
    </executions>
</plugin>

I tried to add the includeMvnBasedDescriptors and addTransitiveFeatures
tags, but it doesn't seem to fix the problem.

I also customized the org.ops4j.pax.ulr.mvn.cfg file, so that the proxy
support is enabled and that the 'org.ops4j.pax.url.mvn.settings'  and
'org.ops4j.pax.url.mvn.localRepository' properties are correctly set to
my local repository and maven settings (where my proxy is defined).

My feature description looks like:

<feature name="myFeature" version="${myapps.release}" resolver="(orb)">
 
<bundle>mvn:org.springframework.ldap/org.springframework.ldap/1.3.0.RELE
ASE </bundle>
 
<bundle>mvn:com.thoughtworks.xstream/com.springsource.com.thoughtworks.x
stream/1.3.1</bundle>
    <bundle>mvn:com.myapps/myapps/${myapps.release}</bundle>
</feature>

 


==== The EFG Mail Gateway made the following annotation ====
This e-mail is confidential. If you are not the intended recipient, you should 
not
copy it, re-transmit it, use it or disclose its contents, but should return it 
to
the sender immediately and delete the copy from your system. 
EFG is not responsible for, nor endorses, any opinion, recommendation, 
conclusion,
solicitation, offer or agreement or any information contained in this 
communication.
EFG cannot accept any responsibility for the accuracy or completeness of this 
message
as it has been transmitted over a public network.
If you suspect that the message may have been intercepted or amended, please 
call the
sender. Should you require any further information, please contact the 
Compliance
Manager on off...@efggroup.com.
==============================================================================

Reply via email to