Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

build.xml in Java project

What is the file build.xml?

I was wondering if it is a possibility to import this project in Eclipse or Netbeans using this build.xml. I tried to import the project but I get some errors since one part is created using J2ME and the other J2SE and I guess this file should be the configuration.

like image 890
Granit Avatar asked Oct 11 '09 16:10

Granit


People also ask

What is build xml in Java?

The build. xml file is an Ant script that is created by the PDE to take your plug-in components and combine them into a deployable format. This file compiles and archives your plug-in source code into a single JAR file. The build. properties file controls what goes into your plug-in distribution.

Where is build xml in Eclipse?

xml file, right click the project select new->other->xml , enter the name as build. xml and click finish . to build the project right click the build. xml file and select ant build .

Can you write a build xml?

How do I write build. xml file? here is a sample build. xml you just need to know important element e.g. project ,target ,property and task and the order in which different target gets executed to start with basic build procedure.

What is build xml in ant?

Ant uses an xml file for its configuration. The default file name is build. xml . Ant builds are based on three blocks: tasks, targets and extension points. A task is a unit of work which should be performed and constitutes of small atomic steps, for example compile source code or create Javadoc.


2 Answers

build.xml usually is an ant build script.

It contains information necessary to build the project to produce the desired output, be it Javadocs, a compiled project, or a JAR file.

I believe Eclipse has ant built-in, so it should be possible to execute the build.xml by choosing "Run As..." and "Ant Build".

The build.xml file, if it is an ant script, is not used to import the project into an IDE like Eclipse or Netbeans. A build script is used to build the project (or produce some desired output) rather than an mechanism for importing the project into an IDE.

like image 88
coobird Avatar answered Oct 30 '22 01:10

coobird


As mentioned by @coobird this is an ant build file. Although IDEs such as Eclipse and Netbeans have ant support built-in, it is also possible to run ant from the command-line and this may be the simplest way to get started if the project has been well created.

See http://ant.apache.org/ for docs.

If you want to try this approach, install ant, cd to the directory with build.xml and issue

ant 
like image 30
peter.murray.rust Avatar answered Oct 30 '22 00:10

peter.murray.rust