Adding Source Code
One of the nifty features of bundles is that they can carry their own sources. This feature is recognized by the better IDEs on the market. Having the source code in the IDE makes debugging a lot more friendly. However, in the Maven world (where most JPM4J dependencies come from) sources are in a separate JAR. We can ask JPM4J to create a combined JAR.
If you go to the Bndtools Repository view and select the dom4j:dom4j
entry for version is 1.6.1
then with right-click you can call up a menu on that entry. The menu contains an entry to Add Sources
if the repository has source code for that artifact. This can take a few seconds because the sources must be downloaded.
Once a bundle has source code, bnd will automatically also copy that source code when it copies a package. you can disable the source code with:
-sources: false
This can be useful for proprietary code. Otherwise, always try to include the source code because it is a small overhead on disk and it is wonderful when you need it and it is already there.
Prev Next