TaT GettingMavenSourcesNB

Getting sources from Maven repositories

Contributed by: Hubert A Klein Ikkink

Reposted from this blog entry: http://mrhaki.blogspot.com/2008/11/getting-sources-from-maven-repositories.html

Tips and Tricks

Adding a new Maven dependency to our project is very easy. But this will only get us the compiled classes. But what if we want to see the source code or look at the Javadoc?

Well that is easy too! Suppose we have a project with a dependency on the Jakarta commons-lang library.


To get the sources for our library we right-click on Libraries and select Download All Library Sources.


NetBeans starts a download process to get the sources. Of course we must keep in mind the sources must be available otherwise NetBeans cannot download anything. Notice the changed icon for the library if the sources are download. This indicates sources are available. We can now open a libary and open a
. NetBeans opens the source code in read-only mode in the Java editor.


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo