Navigating to Sources in a Maven-Driven NetBeans Platform Project

On the NetBeans Platform course in Poznan, students wanted to know how to navigate to NetBeans sources in a Mavenized NetBeans Platform application. I asked Milos and he told me this: "When you right-click on Libraries, it has an action called 'Download sources'. By default we don't download anything on project opening, but people are free to change the settings in Tools/Options (and suffer the performance penalty)."

So, here's the menu item referred to above. Note that I have a TopComponent, which means I have a dependency on the Window System API, and then I click "Download Sources" and then the sources are downloaded. When I do Ctrl-mouseclick on "TopComponent" in my TopComponent extension class, the TopComponent class opens as below:

In the Miscellaneous category of the Options window, there's a Maven tab where you can cause the sources to be downloaded automatically (though, as Milos points out above, that will impact performance of the related UI). Hope that answers the question! More answers to other questions will follow soon.


Yes, this is a great feature when you have access to the sources.

Posted by Jean-Marc Borer on January 19, 2010 at 07:37 PM PST #

I think that the problem was to add sources manually (when there are no sources on maven repo) - there is a button but it didn't work or something - I don't remember who exacly asked that question.

Posted by guest on January 19, 2010 at 09:11 PM PST #

This was my question. I know that downloading sources from maven repository works, but question was about adding local sources/javadoc because in our project we don't have sources/javadoc on maven repository.

There is Add local sources/javadoc option in context menu but it seems to not work properly. Is there any way to do this in 6.8 or is it bug that should be fixed in 6.9

Posted by Patryk Żywica on January 25, 2010 at 04:44 AM PST #

Good day, Geertjan!
I have some questions about netbeans and maven:
1)Why some nb modules didn't have packages with source code in nb maven repository? (for ex. org-netbeans-core-\*, org-netbeans-boot)
2) Does netbeans modules in maven repository contains all changes, which have been released in netbeans 6.7.1? I am asking this, because all these modules have version RELEASE67 now.


Posted by Alexander on February 03, 2010 at 06:16 PM PST #

Hello Alexander,

1. I don't follow what the actual problem is. contains source jar and the o.n.core.\* jars I check also do.

2. no, 6.7.1 has not been pushed to the repository. We will include milestones, RCs, and all releases from 6.9 onward. You can generate your own repo if you need it using nbm:populate-repository

Posted by mkleint on February 04, 2010 at 02:18 AM PST #

Hello mkleint,
thanks for you answer, maybe I made some mistakes and didn't find source package :(

We will be waiting for 6.9 release, and hope that you can implement all new planned features! :)

P.S. We just finished transfer our YANPA to maven build and got great satisfaction from the new opportunities!!! :)

Posted by Alexander on February 04, 2010 at 03:21 AM PST #

Hi Geertjan!
I work in a project with netbeans 7.4 using maven 3 and a nexus repository with all the needed dependencies.
Downloaded all the dependencies sources and javadocs with maven.
In netbeans some dependencies I can see the javadoc and sources, other's I can't.

Other ide's (eclipse for instance) can donwload the sources and javadoc with no problem.

any help?

Posted by guest on February 26, 2014 at 04:26 AM PST #

Yeh, like really impossible to help you with the information you've provided. If you want help, provide steps so that I can try and reproduce the problem.

Posted by Geertjan on February 26, 2014 at 05:00 AM PST #

Hi Geertjan!
sent you an email with the info.


Posted by guest on February 26, 2014 at 06:34 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« June 2016