6
votes

I have an existing Java project with an ant build.xml and I'm trying to use Netbeans as my IDE.

In Netbeans I've created a new Java Free-Form Project and pointed it at my ant file. This works fine for building, running, etc. However code completion does not work unless I manually add all the java sources for my project (that are already defined in my own build.xml!) via the Netbeans project properties "Java Sources" tab. This is very tedius because this project has has many source dirs.

Is there a way to get Netbeans to recognize the source dirs that are already defined in my ant build.xml to get functionality like autocomplete working?

1
Did you ever resolve this issue? What version of NetBeans were you using? - John Yeary
No. I switched our build system to Maven. Works extremely well with Netbeans (I'm using v7.2). I can confidently run the build from the command line (and Jenkins) or Netbeans and guarantee the same results. - Leif Gruenwoldt

1 Answers

0
votes

Netbeans stores the project information in project.xml file not to modify build.xml.

You can set code completion for your case. For this:

- do right click on your project and select ‘Properties’

- click on ‘Java Source Classpath’ in ‘Categories’ panel

- check ‘Separate Classpath for Each Source Package Folder’

If you want to add new source folder select ‘Java Source’ in ‘Categories’ panel and then click on button ‘Add Folder...’