Updating war file with ant

To do this first you need to add all the lib files inside the "Web Content/WEB-INF/lib" directory to the classpath. The destfile attribute specifies the war file location and the webxml attribute specifies the file location.

If you wish to avoid this behavior you must set the The character encoding to use for filenames inside the archive.

It is not recommended to change this value as the created archive will most likely be unreadable for Java otherwise.

If you wish to avoid this behavior you must set the Whether the file modification times will be rounded up to the next even number of seconds.

Zip archives store file modification times with a granularity of two seconds, so the times will either be rounded up or down.

If we want to make the an executable jar file we need to add the manifest with the Main-Class meta attribute.

(The War task is a shortcut for specifying the particular layout of a WAR file.However, we are excluding the classes that end with the name Test.The output jar file will be placed in the web application lib folder.The created war file will be placed inside the dist directory.So first we create the build/classes and the dist directory. The next step is to compile all the classes in the src directory and place them in the build/classes directory. To create the war file you need to specify the web directory, lib directory and the classes directory.The commonly used attributes of the jar task are as follows − Here, the property points to the path of the web source files. The property in this example points to the build folder where the class files for the can be found.

Tags: , ,