![]() The following outcome is the result of running the Ant file We supply the source folder and the classpath to the javac task and ask it to drop the class files in the build folder.Įxecuting Ant on this file compiles the java source files and places the classes in the build folder. Then we execute the javac command (specifying jdk1.5 as our target compilation). First of all, we create the build directory, if it does not exist. In this case, it includes the classes in the build folder and the jar files in the lib folder.įinally, the build target to build the files. The master-classpath holds the classpath information. The clean target, as the name suggests, deletes the files in the build folder. But first let us look at the clean target. The default target of our project is the compile target. In this example, the src.dir refers to the source folder of the project. As shown in the above example, the build.dir property makes a reference to the web.dir property. Properties can refer to other properties. Web.dir refers to the web source folder of the project, where you can find the JSPs, web.xml, css, javascript and other web related filesīuild.dir refers to the output folder of the project compilation. ![]() Src.dir refers to the source folder of the project where the java source files can be found. Let us consider it piece by piece.įirst, let us declare some properties for the source, web, and build folders. Here is the build.xml required for this project. Volume serial number is 00740061 EC1C:ADB1 This project forms the Hello World Fax Application for the rest of this tutorial. The java class files are stored in the WEB-INF\classes folder. The third party jar files are stored in the lib folder. The images, js, META-INF, styles (css) are stored in the war folder. ![]() The java source code is stored in the src folder. The database scripts are stored in the db folder. The aim of this chapter is to build an Ant file that compiles the java classes and places them in the WEB-INF\classes folder. Now that we have learnt about the data types in Ant, it is time to put that knowledge into action. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |