| Summary: | Manifest export packages sections ignored if Bundle-ClassPath directive present | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Frederic Perez <fredericp> | ||||
| Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> | ||||
| Status: | CLOSED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | igor, jan.sievers | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Frederic Perez
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 . |