Attaching Source and JavaDoc to third party bundles

140 views
Skip to first unread message

Jack Condor

unread,
Mar 7, 2015, 6:51:21 PM3/7/15
to bndtool...@googlegroups.com
Have seen some threads on this subject, but I'm still not clear about the best way to enable the viewing of sources and java docs for a binary jar in my build class path that has separate source and javadoc jars. 

Any tips would be appreciated. 

BJ Hargrave

unread,
Mar 8, 2015, 1:19:27 PM3/8/15
to bndtool...@googlegroups.com
On Mar 7, 2015, at 18:51 , Jack Condor <jcon...@gmail.com> wrote:

Have seen some threads on this subject, but I'm still not clear about the best way to enable the viewing of sources and java docs for a binary jar in my build class path that has separate source and javadoc jars. 

Any tips would be appreciated. 

bndtools will look for external sources for a bundle by trying to find a bundle in the repo with the Bundle-SymbolicName(bsn) suffixed by “.source”. So if the bundle has the bsn com.acme.foo, then bndtools will look for com.acme.foo.source in the configured repos.

Also, if you manually edit the source attachment information for the Bnd Bundle Path classpath container, bndtools will persistently remember all the source attachement settings for the project. This info is stored in the file: .metadata/.plugins/bndtools.builder/<projectname>.sources where <projectname> is the name of the Eclipse project.



--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

BJ



Jack Condor

unread,
Mar 8, 2015, 7:09:25 PM3/8/15
to bndtool...@googlegroups.com
But none of those techniques seem to work. 

BTW - I am simply highlighting a class and hitting my F3 key. (Open Declaration)

Here are some of the problems I am coming up with:

1. biz.aQute.junit-latest.jar 
  Just wanted to look at the org.junit.Assert class.  Instead I got the 'Source Not Found' screen.  So tried a 'Change Attached Source' and see that it is pointing to
  /cnf/cache/biz.aQute.junit/biz.aQute.junit-latest.jardoe

  Trying to change this or any other attached source from that screen does not work.  I see that the bundle itself has some source files in it but not the org.junit sources. 
  Where are the sources for this bundle?  Why are there some sources and not all of them in this bundle?  Can I supplement additional sources with this bundle?

2. Some bundles I have found on JPM but others I have to manually bring in to my Local repo. 
In this case I try to bring both bin and source into local repo.

For example I have a bundle in the local repo Bundle-SymbolicName: com.verticon.osgi.monitor
It is located in:   /home/jconlon/git/com.verticon.irouter/cnf/local/com.verticon.osgi.monitor/com.verticon.osgi.monitor-1.0.0.jar
Its sources are Bundle-SymbolicName: com.verticon.osgi.monitor.source
Located in         /home/jconlon/git/com.verticon.irouter/cnf/local/com.verticon.osgi.monitor.source/com.verticon.osgi.monitor.source-1.0.0.jar

I have not manually edited the Source attachment info as it was already generated:
/home/jconlon/Workspaces/com.verticon.irouter/.metadata/.plugins/bndtools.builder/com.verticon.irouter.mqtt.provider.sources
entry of interest:
 /cnf/local/com.verticon.osgi.monitor/com.verticon.osgi.monitor-1.0.0.jar.srcPath=/cnf/local/com.verticon.osgi.monitor.source/com.verticon.osgi.monitor.source-1.0.0.jar

Yet BndTools can't find these sources.

3. Some binaries are on JPM, but their sources are not.  Try to use JPM and Central repo as much as possible, but have to download sources at times. 
Tried to use the source attachment information file to manually point to these sources but that does not work either. 

I seem to have lost the source(s) of all existence! :-(

BJ Hargrave

unread,
Mar 8, 2015, 7:21:56 PM3/8/15
to bndtool...@googlegroups.com
You don't say what version of bndtools you are using. We have been doing a lot of work in this area for 3.0. Try the latest build from cloudbees. 

-- 
BJ

Jack Condor

unread,
Mar 8, 2015, 9:28:10 PM3/8/15
to bndtool...@googlegroups.com
From about Eclipse...
Bndtools    3.0.0.DEV-20150221-134001-g9062551    bndtools.main.feature.feature.group    Bndtools

BJ Hargrave

unread,
Mar 8, 2015, 11:16:09 PM3/8/15
to bndtool...@googlegroups.com
On Mar 8, 2015, at 21:28 , Jack Condor <jcon...@gmail.com> wrote:

From about Eclipse...
Bndtools    3.0.0.DEV-20150221-134001-g9062551    bndtools.main.feature.feature.group    Bndtools

Try the most recent builds. Neil just found and fixed a bug that caused the .sources files to not working.

Jack Condor

unread,
Mar 8, 2015, 11:44:33 PM3/8/15
to bndtool...@googlegroups.com
Just upgraded to:
  Bndtools    3.0.0.DEV-20150308-143451-g0561098    bndtools.main.feature.feature.group    Bndtools

Bingo!  Its fixed.  Now I can use the Attached source dialog!

Thanks BJ and Neil
Reply all
Reply to author
Forward
0 new messages