I am new babie in ant please help me.
I have created war files using Apache Ant version 1.8.1, war files is generated successfully. I want to start tomcat 7.0.23 and place my project in webapps directory of tomcat but after creating war files build.xml not executing below bold lines. I donot know what is wrong, please look into this i am sending by build.xml files as well as build.properties files
Joined: Jun 22, 2005
arvind kushwaha wrote:I donot know what is wrong...
I am getting the below error.
I donot know which file is not found.
[echo] !!!Making directories !!!
[echo] !!!Compiling Java Files !!!
[javac] /home/aa/tempworkspace/build.xml:31: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[echo] !!!Creating War files !!!
[war] Building war: /home/aa/tempworkspace/dist/togle.war
[echo] !!!deploy !!!
[echo] !!!install Target!!!
/home/aa/tempworkspace/build.xml:108: java.io.FileNotFoundException: togle (Is a directory)
at java.io.FileInputStream.open(Native Method)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
The part in red is the file name, the part in blue is what Ant doesn't like. If you go back to the "install" target, you will note that the "war" property on line 106 is set to a directory, but it expects a file.
Thanks Peter for your's precious comment. The Problem is solved.
Thanks to all guys who help on this matter. I had make some changes and it worked. But on below bold line No: 29 want to pass dynamic file name instead of hard code. Can Any one Help on this. I am
attaching build. xml and build.properties file.
I assume, based on the file name, that the file is generated by some process somewhere and that process includes a date/time string in the filename, and what you want to do is set up the build.xml generically enough to handle whatever name was generated. This requires two steps:
1) First, change line 29 to be:
2) Set the sql.fileName property to the file's name. Exactly how that is done depends on who or what generated the file. Possibilities include updating the build.properties with the name and passing it using -D or setting an environment variable. There are probably other ways. But without knowing how the file gets generated, I can't be more specific.
Joined: Aug 12, 2011
The file is given by user, i don't have to worried about that, thank you so much, but supposed above file run it created database, table and inserted all value. but i had updated some jsp again i have to run the build.xml file, in this scenario though table is created already it again try to do the same . I want to skip the database part when its run second time or all the data is already present in user machine. how would i achieve this in single build.xml file.