I added some targets and set onerror="continue": here is the complete code:
<target name="printAccountsData"> <echo message="PRINT accounts DATA USING: ${db.driver} ${db.url}"/> <sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" print="true"> <classpath refid="master-classpath"/> SELECT * FROM accounts; </sql> </target> <target name="printUsStatesData"> <echo message="PRINT us_states DATA USING: ${db.driver} ${db.url}"/> <sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" print="true"> <classpath refid="master-classpath"/> SELECT * FROM us_states; </sql> </target> <target name="printUserTypesData"> <echo message="PRINT user_types DATA USING: ${db.driver} ${db.url}"/> <sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" print="true"> <classpath refid="master-classpath"/> SELECT * FROM user_types; </sql> </target> <target name="printUsersData"> <echo message="PRINT users DATA USING: ${db.driver} ${db.url}"/> <sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" print="true"> <classpath refid="master-classpath"/> SELECT * FROM users; </sql> </target> <target name="printData" depends="printUsStatesData, printAccountsData, printUserTypesData, printUsersData"> <echo message="PRINT DATA USING: ${db.driver} ${db.url}"/> </target> ==================== Here is the output ... it still only prints data from the first target, but if I run each target individually, it prints the data appropriately for each target. # ant -v printData Apache Ant version 1.7.1 compiled on June 27 2008 Buildfile: build.xml Detected Java version: 1.5 in: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home Detected OS: Mac OS X parsing buildfile /Users/richard/Projects/lotterymagic/build.xml with URI = file:/Users/richard/Projects/lotterymagic/build.xml Project base dir set to: /Users/richard/Projects/lotterymagic [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found. [property] Loading /Users/richard/Projects/lotterymagic/build.properties Build sequence for target(s) `printData' is [printUsStatesData, printAccountsData, printUserTypesData, printUsersData, printData] Complete build sequence is [printUsStatesData, printAccountsData, printUserTypesData, printUsersData, printData, dropUsStatesTable, createUserTypesTable, createUsStatesTable, createAccountsTable, createUsersTable, createTables, build, deploywar, dropUserTypesTable, loadUsStatesData, loadAccountsData, loadUserTypesData, loadUsersData, loadData, clearUsStatesData, usage, clearUserTypesData, buildtests, tests, undeploy, stop, dropAccountsTable, list, start, install, clearUsersData, clearAccountsData, clearData, dropUsersTable, dropTables, clean, shutdownDb, dbTests, deploy, reload, ] printUsStatesData: [echo] PRINT us_states DATA USING: com.mysql.jdbc.Driver jdbc:mysql:// mysql.binarydream.us/lotterymagic [sql] connecting to jdbc:mysql://mysql.binarydream.us/lotterymagic [sql] Loading com.mysql.jdbc.Driver using AntClassLoader with classpath /Users/richard/Projects/lotterymagic/war/WEB-INF/lib/commons-logging.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/jstl.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/junit-3.8.2.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/servlet-api.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/spring-test.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/spring-webmvc.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/spring.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/lib/standard.jar:/usr/local/tomcat/lib/servlet-api.jar:/Users/richard/Projects/lotterymagic/war/WEB-INF/classes [sql] Executing commands [sql] SQL: SELECT * FROM us_states [sql] Processing new result set. [sql] us_state_id,name,code,lottery,games [sql] 1,Alabama,AL,0,0 [sql] 2,Alaska,AK,0,0 [sql] 3,American Samoa,AS,0,0 [sql] 4,Arizona,AZ,1,1 [sql] 5,Arkansas,AR,1,1 [sql] 6,California,CA,1,1 [sql] 7,Colorado,CO,1,1 [sql] 8,Connecticut,CT,1,1 [sql] 9,Delaware,DE,1,3 [sql] 10,District of Columbia,DC,1,2 [sql] 11,Federated States of Micronesia,FM,0,0 [sql] 12,Florida,FL,1,1 [sql] 13,Georgia,GA,1,2 [sql] 14,Guam,GU,0,0 [sql] 15,Hawaii,HI,0,0 [sql] 16,Idaho,ID,1,3 [sql] 17,Illinois,IL,1,1 [sql] 18,Indiana,IN,1,1 [sql] 19,Iowa,IA,1,3 [sql] 20,Kansas,KS,1,4 [sql] 21,Kentucky,KY,1,2 [sql] 22,Louisiana,LA,1,1 [sql] 23,Maine,ME,1,5 [sql] 24,Marshall Islands,MH,0,0 [sql] 25,Maryland,MD,1,1 [sql] 26,Massachusetts,MA,1,1 [sql] 27,Michigan,MI,1,1 [sql] 28,Minnesota,MN,1,2 [sql] 29,Mississippi,MS,0,0 [sql] 30,Missouri,MO,1,1 [sql] 31,Montana,MT,1,3 [sql] 32,Nebraska,NE,1,2 [sql] 33,Nevada,NV,0,0 [sql] 34,New Hampshire,NH,1,6 [sql] 35,New Jersey,NJ,1,1 [sql] 36,New Mexico,NM,0,2 [sql] 37,New York,NY,1,1 [sql] 38,North Carolina,NC,1,4 [sql] 39,North Dakota,ND,1,3 [sql] 40,Northern Mariana Islands,MP,0,0 [sql] 41,Ohio,OH,1,1 [sql] 42,Oklahoma,OK,1,2 [sql] 43,Oregon,OR,1,1 [sql] 44,Palau,PW,0,0 [sql] 45,Pennsylvania,PA,1,1 [sql] 46,Puerto Rico,PR,1,0 [sql] 47,Rhode Island,RI,1,2 [sql] 48,South Carolina,SC,1,1 [sql] 49,South Dakota,SD,1,3 [sql] 50,Tennessee,TN,1,1 [sql] 51,Texas,TX,1,1 [sql] 52,Utah,UT,0,0 [sql] 53,Vermont,VT,1,5 [sql] 54,Virgin Islands,VI,1,1 [sql] 55,Virginia,VA,1,2 [sql] 56,Washington,WA,1,1 [sql] 57,West Virginia,WV,1,3 [sql] 58,Wisconsin,WI,1,1 [sql] 59,Wyoming,WY,0,0 [sql] [sql] 0 rows affected [sql] 0 rows affected [sql] Committing transaction [sql] 1 of 1 SQL statements executed successfully printAccountsData: [echo] PRINT accounts DATA USING: com.mysql.jdbc.Driver jdbc:mysql:// mysql.binarydream.us/lotterymagic [sql] connecting to jdbc:mysql://mysql.binarydream.us/lotterymagic [sql] Loading com.mysql.jdbc.Driver using a cached AntClassLoader. [sql] Executing commands [sql] SQL: SELECT * FROM accounts [sql] Processing new result set. [sql] 0 rows affected [sql] Committing transaction [sql] 1 of 1 SQL statements executed successfully printUserTypesData: [echo] PRINT user_types DATA USING: com.mysql.jdbc.Driver jdbc:mysql:// mysql.binarydream.us/lotterymagic [sql] connecting to jdbc:mysql://mysql.binarydream.us/lotterymagic [sql] Loading com.mysql.jdbc.Driver using a cached AntClassLoader. [sql] Executing commands [sql] SQL: SELECT * FROM user_types [sql] Processing new result set. [sql] 0 rows affected [sql] Committing transaction [sql] 1 of 1 SQL statements executed successfully printUsersData: [echo] PRINT users DATA USING: com.mysql.jdbc.Driver jdbc:mysql:// mysql.binarydream.us/lotterymagic [sql] connecting to jdbc:mysql://mysql.binarydream.us/lotterymagic [sql] Loading com.mysql.jdbc.Driver using a cached AntClassLoader. [sql] Executing commands [sql] SQL: SELECT * FROM users [sql] Processing new result set. [sql] 0 rows affected [sql] Committing transaction [sql] 1 of 1 SQL statements executed successfully printData: [echo] PRINT DATA USING: com.mysql.jdbc.Driver jdbc:mysql:// mysql.binarydream.us/lotterymagic BUILD SUCCESSFUL Total time: 0 seconds Richard P. Brunelle Solutions Architect BinaryDream On Mon, Nov 16, 2009 at 11:05 AM, glenn opdycke-hansen <glenn...@gmail.com>wrote: > What is the output from verbose? ant -v ... > > On Mon, Nov 16, 2009 at 08:29, Scot P. Floess <sflo...@nc.rr.com> wrote: > > > > > I see you have onerror set to stop. What happens if you don't set that > > attribute? It defaults to abort if not set... > > > > >