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 bundlemvn:…./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 bundlemvn:…./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 groupIdorg.springframework.ldap/groupId artifactIdorg.springframework.ldap/artifactId version1.3.0.RELEASE /version /dependency dependency groupIdcom.thoughtworks.xstream/groupId artifactIdcom.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 groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId extensionstrue/extensions configuration instructions Bundle-SymbolicName${bundle.symbolicName}/Bundle-SymbolicName Bundle-Version${project.version}/Bundle-Version Export-Package${bundle.namespace}.*;version=${project.version}/Export-Package /instructions /configuration /plugin I followed the Custom distribution guide. The feature-maven-plugin configuration looks like: plugin groupIdorg.apache.karaf.tooling/groupId artifactIdfeatures-maven-plugin/artifactId executions execution idadd-features-to-repo/id phasegenerate-resources/phase goals goaladd-features-to-repo/goal /goals configuration descriptors descriptormvn:org.apache.karaf.assemblies.features/standard/2.2.1/xml/features/descriptor descriptormvn:com.myapps/features/${myapps.release}/xml/features/descriptor /descriptors features featureconfig/feature featuressh/feature featuremanagement/feature featurejetty/feature featurewebconsole/feature featurewar/feature featurespring/feature featurespring-web/feature featurespring-dm/feature featurespring-dm-web/feature featuremy-custom-bundle/feature /features includeMvnBasedDescriptorstrue/includeMvnBasedDescriptors repositorytarget/features-repo/repository addTransitiveFeaturestrue/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) bundlemvn:org.springframework.ldap/org.springframework.ldap/1.3.0.RELEASE /bundle bundlemvn:com.thoughtworks.xstream/com.springsource.com.thoughtworks.xstream/1.3.1/bundle bundlemvn:com.myapps/myapps/${myapps.release}/bundle /feature The EFG Mail Gateway made the following
RE: Bundle dependencies
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 bundlemvn:/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 bundlemvn:/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 groupIdorg.springframework.ldap/groupId artifactIdorg.springframework.ldap/artifactId version1.3.0.RELEASE /version /dependency dependency groupIdcom.thoughtworks.xstream/groupId artifactIdcom.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 groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId extensionstrue/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 groupIdorg.apache.karaf.tooling/groupId artifactIdfeatures-maven-plugin/artifactId executions execution idadd-features-to-repo/id phasegenerate-resources/phase goals goaladd-features-to-repo/goal /goals configuration descriptors descriptormvn:org.apache.karaf.assemblies.features/standard/2.2.1/xm l/features/descriptor descriptormvn:com.myapps/features/${myapps.release}/xml/features/de scriptor /descriptors features featureconfig/feature featuressh/feature featuremanagement/feature featurejetty/feature featurewebconsole/feature featurewar/feature featurespring/feature featurespring-web/feature featurespring-dm/feature featurespring-dm-web/feature featuremy-custom-bundle/feature /features includeMvnBasedDescriptorstrue/includeMvnBasedDescriptors
Re: Bundle dependencies
Well, there are two goals in the Karaf Maven Plugin which might do what you want ([1] and [2]). Please check if they do what you like. I've never used them but they should be able to automatically generate the feature files including dependencies. Kind regards, Andreas [1] http://svn.apache.org/repos/asf/karaf/tags/karaf-2.2.1/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesFileMojo.java [2] http://svn.apache.org/repos/asf/karaf/tags/karaf-2.2.1/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java On Fri, Jun 10, 2011 at 3:46 PM, Houkes, Fulco fulco.hou...@efgbank.com wrote: 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 bundlemvn:/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 bundlemvn:/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 groupIdorg.springframework.ldap/groupId artifactIdorg.springframework.ldap/artifactId version1.3.0.RELEASE /version /dependency dependency groupIdcom.thoughtworks.xstream/groupId artifactIdcom.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 groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId extensionstrue/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 groupIdorg.apache.karaf.tooling/groupId artifactIdfeatures-maven-plugin/artifactId executions execution idadd-features-to-repo/id phasegenerate-resources/phase goals goaladd-features-to-repo/goal /goals configuration descriptors descriptormvn:org.apache.karaf.assemblies.features/standard/2.2.1/xm l/features/descriptor descriptormvn:com.myapps/features/${myapps.release}/xml/features/de scriptor
Re: Bundle dependencies
Note that those goals have some problems in karaf 2.x (not bugs, but rather by design). This is being worked out for 3.x and auto-generation of features descriptors should be much better. On Fri, Jun 10, 2011 at 16:24, Andreas Pieber anpie...@gmail.com wrote: Well, there are two goals in the Karaf Maven Plugin which might do what you want ([1] and [2]). Please check if they do what you like. I've never used them but they should be able to automatically generate the feature files including dependencies. Kind regards, Andreas [1] http://svn.apache.org/repos/asf/karaf/tags/karaf-2.2.1/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesFileMojo.java [2] http://svn.apache.org/repos/asf/karaf/tags/karaf-2.2.1/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java On Fri, Jun 10, 2011 at 3:46 PM, Houkes, Fulco fulco.hou...@efgbank.com wrote: 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 bundlemvn:/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 bundlemvn:/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 groupIdorg.springframework.ldap/groupId artifactIdorg.springframework.ldap/artifactId version1.3.0.RELEASE /version /dependency dependency groupIdcom.thoughtworks.xstream/groupId artifactIdcom.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 groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId extensionstrue/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 groupIdorg.apache.karaf.tooling/groupId artifactIdfeatures-maven-plugin/artifactId executions execution idadd-features-to-repo/id phasegenerate-resources/phase goals