I have a java application project (ant) under Netbeans and I want to programmatically call the action similar to Netbeans' clean and build (clean the project and than build it) command using something like javac or ant. How am I supposed to do that? I've already look at this but it didn't help me.
-
What a clean build differ from a dirty build?Roman C– Roman C2012-10-23 09:58:50 +00:00Commented Oct 23, 2012 at 9:58
-
Sorry, there was an "and" missing, it's clean and buildHericDenis– HericDenis2012-10-23 10:17:40 +00:00Commented Oct 23, 2012 at 10:17
-
Downvoter can please tell me the reason?HericDenis– HericDenis2012-10-23 12:12:41 +00:00Commented Oct 23, 2012 at 12:12
-
1I'm currently in the home office, and running netbeans over an ssh tunnel is awfully slow. For that reason, an option to start netbeans with a command line parameter to automatically clean and build a given project would be very helpful. Writing the ant script myself, as proposed by Paulius, seems like busywork.Erich Kitzmueller– Erich Kitzmueller2020-04-29 12:07:34 +00:00Commented Apr 29, 2020 at 12:07
Add a comment
|
1 Answer
Netbeans for clean and build is using Ant (If it is not a maven project). Make some research of it (try with Writing a Simple Buildfile) and you will be able to do the same with your project by writing Ant build script for it.
3 Comments
HericDenis
I already have the build files, I want to run ant using those netbeans created build files
Paulius Matulionis
Well, netbeans is generating ant script automatically, so they are IDE dependent. I would not suggest try running or modifying those scripts. Also netbeans generates a lot of crap in those files, you should write them your self, then you'll know what you are doing exactly. To generate ANT scripts automatically is almost the same as to create a web page using FrontPage.
HericDenis
You must be right, I used netbeans' ant-launcher.jar to build my project and it gives error while parsing build files.