Use Java source dirs from ant build.xml to configure Netbeans project
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开发者_如何学C in my ant build.xml
to get functionality like autocomplete working?
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...’
精彩评论