As mentioned previously, the war target is the (Photo web hosting)

As mentioned previously, the war target is the default target for the project. This means that when Ant is run from the command line without a target argument, the war target is executed. The war target runs only if the compiletarget has been run first. The war task requires you to define the name of the WAR file and the location of the web.xml file. All the other attributes are optional; if you are interested in seeing them, they are listed in the online Ant documentation (http://jakarta.apache.org/ant/manual/CoreTasks/war.html). Another great reference on Ant is Ant:TheDefinitiveGuide by Jesse Tilly and Eric Burke (O’Reilly). The nested elements tell the war task where the contents of the WAR file are located. The fileset element defines the base web content of the WAR file. This element is used to declare where the HTML files, JSP pages, images, and so on are located. The classes element points to the Java class files that should be included in the WEB-INF/classes directory in the WAR file, and the lib element declares which files should be included in the WEB-INF/lib folder. In the Storefront example, everything in the web subdirectory is included. The various subdirectories contain all of the necessary resources (HTML, JSP pages, images, etc.). All of the compiled classes in the build subdirectory are copied into the WAR file’s WEB-INF/classes directory along with the properties files. All of the third-party JARs in the lib subdirectory are copied into the WAR’s WEBINF/lib directory. If the lib subdirectory contains any JARs that you don’t want to be included, you can use the following snippet:
Here, all the JARs in the lib directory except dont_need.jar will be copied into the WAR file’s WEBINF/lib directory. The last and often the clearest option is to explicitly include each desired JAR file. While slightly more verbose, this method is immune to changes to the lib folder if other developers in the project start adding JARs indiscriminately. It is also much easier to see exactly what is going to be included in the WAR file. 16.4.6 Cleaning Up The final two targets are trivial but important. The clean target deletes the build directory, thus removing all of the Java class files:
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply