bndtools/bndtools — Issue #310: Bundle that uses packages from a plain jar does not expose them correctly in other projects.
Author: m4rr5
Created: 2011-12-02 21:07:13+00:00
State: open

1. Create a new project called "org.json".
1. Download the jar from this URL and copy it to the root of the project: http://repo1.maven.org/maven2/org/json/json/20090211/json-20090211.jar
1. Add the following lines to the bnd.bnd file:
* `-buildpath: json-20090211.jar;version=file`
* `Export-Package: org.json`
1. Create a second project called "consumer".
1. Add the following line to the bnd.bnd file:
* `-buildpath: org.json;version=latest`
1. Create a `consumer.Consumer` class in this project and add an `import org.json.*` statement.
1. You now see that this package cannot be found, even though we added the proper bundle to the -buildpath.

Workaround for now: Go into the project properties of the org.json project, go to "Java Build Path", then "Order and Export" and place a checkmark in front of the "Bnd Bundle Path" entry.