Andreas,

Thanks a lot for the quick answer, I appreciate!

In a short time I guess I've no other choice to add all dependencies in the 
features descriptions.

I understand that for a single custom bundle it's important to keep control of 
all dependencies. However, for bigger projects like a custom distribution of 
Karaf with a bunch of home-developed bundles, it would be nice to have an 
automatic way for enumerating all needed JAR libs as it's the case when 
building a WAR project. Keeping track of all dependencies and sub dependencies 
of all project's bundles might quickly become a nightmare.

Is there any project (I'm not aware of) or planned development (maven build 
plugin) for providing such capabilities?

Cheers,
Fulco


-----Original Message-----
From: Andreas Pieber [mailto:anpie...@gmail.com] 
Sent: vendredi, 10. juin 2011 12:40
To: user@karaf.apache.org
Subject: Re: Bundle dependencies

Hey Fulco,

Short answer: The clean way to go here is to define all bundles required in 
your features.xml. Everything else could generate a GREAT mess, because (for 
example) not all deps have to be osginized, not all deps import versions 
correctly (which leads to some problems since transitive dependencies could 
pull in various versions of the same bundles into Karaf) and several other 
issues...

Kind regards,
Andreas

On Fri, Jun 10, 2011 at 12:29 PM, Houkes, Fulco <fulco.hou...@efgbank.com> 
wrote:
> 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}"</Ex
> port-Package>
>         </instructions>
>     </configuration>
> </plugin>
>
> I followed the Custom distribution 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/xm
> l/features</descriptor>
>
> <descriptor>mvn:com.myapps/features/${myapps.release}/xml/features</de
> scriptor>
>                 </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.RE
> LEASE
> </bundle>
>
> <bundle>mvn:com.thoughtworks.xstream/com.springsource.com.thoughtworks
> .xstream/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