Community
Participate
Working Groups
Build Identifier: 0.13 git 09d71aa2f895d94bb002b7e6c6bdf299a740c224 If project A requires in its manifest bundle B that has entries like: bundle B manifest: Export-Package: com.example.b Bundle-ClassPath: ext/dependency.jar The compilation of A fails when trying to import the com.example.b package. If the line Bundle-ClassPath is removed from bundle B manifest, the compilation succeeds. Reproducible: Always Steps to Reproduce: Try to import a package from a bundle with a Bundle-ClassPath directive
Please provide complete standalone example project and steps to reproduce the problem.
Created attachment 197549 [details] Test case Finally did some tests and found the root of the problem. Looks like an entry like this: Bundle-ClassPath: ext/lib.jar works in eclipse but not in tycho. Tycho needs Bundle-ClassPath: ., ext/lib.jar (Note the .,) I'm not sure the former is correct or not. I have assembled some tests. To run them you have to: - publish p2TestRepo to http://127.0.0.1/p2TestRepo - run mvn compile p2TestRepo is a p2 repository with: HasBundleClassPathWithDot.jar - exports com.example.Example and has BundleClassPath: .,lib.jar NoBundleClassPath - exports com.example.Example and has no BundleClassPath directive HasBundleClassPath - exports com.example.Example and has BundleClassPath : lib.jar the lib.jar is some random library unused in the test. The main 3 projects are all the same but each one requiring the bundle its name states. Each project just imports com.example.Example and does a new Example(); usesHasClassBundleClassPathWithDot -> builds correctly usesHasBundleClassPath -> builds correctly usesNoClassBundleClassPath -> Fails to build in tycho. Builds with no errors in Eclipse. Eclipse and Tycho behave differently and this might lead to confusion.
(In reply to comment #2) you configured the wrong groupId "org.sonatype.tycho" for target-platform-configuration in your sample project. If I fix this, I can build successfully modules <module>usesHasClassBundleClassPathWithDot</module> <module>usesNoClassBundleClassPath</module> Module <module>usesHasClassBundleClassPath</module> fails with compilation error. This is normal because it has Require-Bundle: HasBundleClassPath;bundle-version="1.0.0" and actually HasBundleClassPath exports the package required for compilation Export-Package: com.example , but it only has Bundle-ClassPath: ext/jsr305-0.0.0.jar which does not contain this package. To summarize, I don't see this is a bug. Feel free to reopen with a sample project that proves it's a bug. The thing that may have confused you here is that in OSGi, if there is no Bundle-ClassPath MANIFEST entry, this means there is an implicit default value Bundle-ClassPath: . However as soon as you specify an explicit Bundle-ClassPath entry, the "." entry must be mentioned explicitly if desired. See OSGi core spec section 3.8.1 .