Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between build.xml and build-impl.xml

I am studying the code of a already build and well-running web app written in java. In that project, I found two files, build.xml and build-impl.xml, which contains different information related to operation that can be taken on project. I am not able to understand

1) why two different files, build.xml and build-impl.xml are required ?

2) which of above two files are mandatory ?

3) who uses those files and when and how ?

4) what exact information does they contain ?

5) are they auto-generated or they have to be created manually ?

like image 354
Mangu Singh Rajpurohit Avatar asked Nov 27 '25 21:11

Mangu Singh Rajpurohit


1 Answers

  1. why two different files, build.xml and build-impl.xml are required ?

By default, Apache Ant(a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.) uses build.xml as the name for a buildfile.

We need to build our application for the reason, say, suppose we have several classes and if someone wants to download them, one shouldn't download them individually. So, we should package our application into a jar file(a startable jar file would be good for this purpose). Once you are satisfied that your application works properly, you can prepare the application for deployment outside of your system/IDE/environment.

Whereas, from Setting Up a NetBeans Platform Application :-

The build-impl.xml file gives you access to the NetBeans Platform infrastructure, such as its "run" target. You will never need to change the build-impl.xml file. On the other hand, the build.xml file is the Ant script where you will customize, where necessary, your application's build process.


  1. which of above two files are mandatory ?

None of them are mandatory. If you've several class files(or resources), then you should build your application. Also, if you want to deploy your application outside of your environment, then there comes the use of build jar file. The latter one is by default present in any NetBeans Java application.

  1. who uses those files and when and how ?

Already answered above. Don't go in depth of when, it's just used in building your application. When you'll be building your application manually using Ant(command line), you'll get to know when!

  1. what exact information does they contain ?

I've provided the link of NetBeans Tutorial on Ant and build above. Go and visit that. That covers what information is contained in the build.xml and the build-impl.xml.

  1. are they auto-generated or they have to be created manually ?

No, you've both build.xml and build-impl.xml by default(auto generated when using NetBeans application). And, you will never need to change build-impl.xml.

like image 101
Am_I_Helpful Avatar answered Nov 29 '25 10:11

Am_I_Helpful



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!