views:

1460

answers:

2

When I create a new project in Netbeans, it generates a build.xml file which it will use to compile and run the project, along with other stuff in folder nbproject.

Now, I want to have my very own build.xml file that I will use to compile to project on the server side. Some guys have tried to use the generated build file both in Netbeans and with pure Ant, but it's more trouble than it's worth.

I want to rename the auto-generated file to nb-build.xml and have my own build.xml file that Netbeans will not touch.

How do I achieve that ?

A: 

Try removing the import statement in the build.xml for the NetBeans generated build-impl.xml (i.e. <import file="nbproject/build-impl.xml"/>)and replacing it with an import of your nb-build.xml (e.g. <import file="nb-build.xml"/> )

Mads Hansen
+1  A: 

You can select the option Java project with existing sources or Web project with existing sources when creating your project. This will respect any existing build.xml file and create a secondary build file, I believe.

There is also an option when creating a project to use an existing build script, however I believe that this option will not generate a Netbeans build script for you, instead it will rely solely on the existing build script for all builds.

James McMahon