You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

faq.html 51 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- Content Stylesheet for Site -->
  3. <!-- start the processing -->
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  7. <meta name="author" value="Stefan Bodewig">
  8. <meta name="email" value="bodewig@apache.org">
  9. <title>The Jakarta Site - Frequently Asked Questions</title>
  10. </head>
  11. <body bgcolor="#ffffff" text="#000000" link="#525D76">
  12. <table border="0" width="100%" cellspacing="0">
  13. <!-- TOP IMAGE -->
  14. <tr>
  15. <td colspan="2">
  16. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
  17. </td>
  18. </tr>
  19. </table>
  20. <table border="0" width="100%" cellspacing="4">
  21. <tr><td colspan="2">
  22. <hr noshade="" size="1"/>
  23. </td></tr>
  24. <tr>
  25. <!-- LEFT SIDE NAVIGATION -->
  26. <td valign="top" nowrap="true">
  27. <p><strong>Ant</strong></p>
  28. <ul>
  29. <li> <a href="./index.html">Front Page</a>
  30. </li>
  31. <li> <a href="./antnews.html">News</a>
  32. </li>
  33. <li> <a href="./manual/index.html">Documentation</a>
  34. </li>
  35. <li> <a href="./external.html">External Tools and Tasks</a>
  36. </li>
  37. <li> <a href="./resources.html">Resources</a>
  38. </li>
  39. <li> <a href="./faq.html">Ant FAQ</a>
  40. </li>
  41. <li> <a href="./problems.html">Having Problems?</a>
  42. </li>
  43. </ul>
  44. <p><strong>Download</strong></p>
  45. <ul>
  46. <li> <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
  47. </li>
  48. <li> <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
  49. </li>
  50. </ul>
  51. <p><strong>Jakarta</strong></p>
  52. <ul>
  53. <li> <a href="http://jakarta.apache.org/site/news.html">News & Status</a>
  54. </li>
  55. <li> <a href="http://jakarta.apache.org/site/mission.html">Mission</a>
  56. </li>
  57. <li> <a href="http://jakarta.apache.org/site/guidelines.html">Guidelines Notes</a>
  58. </li>
  59. <li> <a href="http://jakarta.apache.org/site/faqs.html">FAQs</a>
  60. </li>
  61. </ul>
  62. <p><strong>Get Involved</strong></p>
  63. <ul>
  64. <li> <a href="http://jakarta.apache.org/site/getinvolved.html">Overview</a>
  65. </li>
  66. <li> <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
  67. </li>
  68. <li> <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
  69. </li>
  70. <li> <a href="http://jakarta.apache.org/site/library.html">Reference Library</a>
  71. </li>
  72. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant">Bug Database</a>
  73. </li>
  74. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant&bug_severity=Enhancement">Enhancement Requests</a>
  75. </li>
  76. </ul>
  77. </td>
  78. <td align="left" valign="top">
  79. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  80. <tr><td bgcolor="#525D76">
  81. <font color="#ffffff" face="arial,helvetica,sanserif">
  82. <strong>Questions</strong>
  83. </font>
  84. </td></tr>
  85. <tr><td>
  86. <blockquote>
  87. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  88. <tr><td bgcolor="#828DA6">
  89. <font color="#ffffff" face="arial,helvetica,sanserif">
  90. <strong>General</strong>
  91. </font>
  92. </td></tr>
  93. <tr><td>
  94. <blockquote>
  95. <ul>
  96. <li><a href="#what-is-ant">
  97. What is Ant?
  98. </a></li>
  99. <li><a href="#ant-name">
  100. Why do you call it Ant?
  101. </a></li>
  102. <li><a href="#history">
  103. Tell us a little bit about Ant's history.
  104. </a></li>
  105. </ul>
  106. </blockquote>
  107. </td></tr>
  108. </table>
  109. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  110. <tr><td bgcolor="#828DA6">
  111. <font color="#ffffff" face="arial,helvetica,sanserif">
  112. <strong>Installation</strong>
  113. </font>
  114. </td></tr>
  115. <tr><td>
  116. <blockquote>
  117. <ul>
  118. <li><a href="#no-gnu-tar">
  119. I get checksum errors when I try to extract the
  120. <code>tar.gz</code> distribution file. Why?
  121. </a></li>
  122. </ul>
  123. </blockquote>
  124. </td></tr>
  125. </table>
  126. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  127. <tr><td bgcolor="#828DA6">
  128. <font color="#ffffff" face="arial,helvetica,sanserif">
  129. <strong>Using Ant</strong>
  130. </font>
  131. </td></tr>
  132. <tr><td>
  133. <blockquote>
  134. <ul>
  135. <li><a href="#always-recompiles">
  136. Why does Ant always recompile all my Java files?
  137. </a></li>
  138. <li><a href="#passing-cli-args">
  139. How do I pass parameters from the command line to my
  140. build file?
  141. </a></li>
  142. <li><a href="#jikes-switches">
  143. How can I use Jikes specific command line
  144. switches?
  145. </a></li>
  146. <li><a href="#shell-redirect-1">
  147. How do I include a &lt; character in my command line arguments?
  148. </a></li>
  149. <li><a href="#shell-redirect-2">
  150. How do I redirect standard input or standard output
  151. in the <code>&lt;exec&gt;</code> task?
  152. </a></li>
  153. </ul>
  154. </blockquote>
  155. </td></tr>
  156. </table>
  157. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  158. <tr><td bgcolor="#828DA6">
  159. <font color="#ffffff" face="arial,helvetica,sanserif">
  160. <strong>Ant and IDEs/Editors</strong>
  161. </font>
  162. </td></tr>
  163. <tr><td>
  164. <blockquote>
  165. <ul>
  166. <li><a href="#integration">
  167. Is Ant supported by my IDE/Editor?
  168. </a></li>
  169. <li><a href="#emacs-mode">
  170. Why doesn't (X)Emacs/vi/MacOS X's project builder
  171. parse the error messages generated by Ant correctly?
  172. </a></li>
  173. </ul>
  174. </blockquote>
  175. </td></tr>
  176. </table>
  177. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  178. <tr><td bgcolor="#828DA6">
  179. <font color="#ffffff" face="arial,helvetica,sanserif">
  180. <strong>Advanced issues</strong>
  181. </font>
  182. </td></tr>
  183. <tr><td>
  184. <blockquote>
  185. <ul>
  186. <li><a href="#dtd">
  187. Is there a DTD that I can use to validate my build
  188. files?
  189. </a></li>
  190. <li><a href="#xml-entity-include">
  191. How do I include an XML snippet in my build file?
  192. </a></li>
  193. <li><a href="#mail-logger">
  194. How do I send an email with the result of my build
  195. process?
  196. </a></li>
  197. </ul>
  198. </blockquote>
  199. </td></tr>
  200. </table>
  201. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  202. <tr><td bgcolor="#828DA6">
  203. <font color="#ffffff" face="arial,helvetica,sanserif">
  204. <strong>Known problems</strong>
  205. </font>
  206. </td></tr>
  207. <tr><td>
  208. <blockquote>
  209. <ul>
  210. <li><a href="#remove-cr">
  211. &lt;chmod&gt; or &lt;exec&gt; don't work in Ant
  212. 1.3 on Unix
  213. </a></li>
  214. <li><a href="#javadoc-cannot-execute">
  215. JavaDoc failed: java.io.IOException: javadoc: cannot execute
  216. </a></li>
  217. </ul>
  218. </blockquote>
  219. </td></tr>
  220. </table>
  221. </blockquote>
  222. </td></tr>
  223. </table>
  224. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  225. <tr><td bgcolor="#525D76">
  226. <font color="#ffffff" face="arial,helvetica,sanserif">
  227. <strong>Answers</strong>
  228. </font>
  229. </td></tr>
  230. <tr><td>
  231. <blockquote>
  232. <a name="what-is-ant">
  233. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  234. <tr><td bgcolor="#828DA6">
  235. <font color="#ffffff" face="arial,helvetica,sanserif">
  236. <strong>
  237. What is Ant?
  238. </strong>
  239. </font>
  240. </td></tr>
  241. <tr><td>
  242. <blockquote>
  243. <p> Ant is a Java based build tool. In theory it is kind of
  244. like "make" without makes wrinkles and with the full
  245. portability of pure Java code.</p>
  246. </blockquote>
  247. </td></tr>
  248. </table>
  249. </a>
  250. <a name="ant-name">
  251. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  252. <tr><td bgcolor="#828DA6">
  253. <font color="#ffffff" face="arial,helvetica,sanserif">
  254. <strong>
  255. Why do you call it Ant?
  256. </strong>
  257. </font>
  258. </td></tr>
  259. <tr><td>
  260. <blockquote>
  261. <p>According to Ant's original author James Duncan
  262. Davidson, the name is an acronym for "Another Neat
  263. Tool".</p>
  264. <p>Later explanations go along the lines of "Ants are
  265. doing an extremely good job at building things" or
  266. "Ants are very small and can carry a weight a dozen times
  267. of their own" - describing what Ant is intended to
  268. be.</p>
  269. </blockquote>
  270. </td></tr>
  271. </table>
  272. </a>
  273. <a name="history">
  274. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  275. <tr><td bgcolor="#828DA6">
  276. <font color="#ffffff" face="arial,helvetica,sanserif">
  277. <strong>
  278. Tell us a little bit about Ant's history.
  279. </strong>
  280. </font>
  281. </td></tr>
  282. <tr><td>
  283. <blockquote>
  284. <p>Initially Ant was part of the Tomcat code base when it was
  285. donated to the Apache Software Foundation - it has been
  286. created by James Duncan Davidson, who also is the original
  287. author of Tomcat. Ant was there to build Tomcat, nothing
  288. else.</p>
  289. <p>Soon thereafter several open source Java projects realized
  290. that Ant could solve the problems they had with makefiles.
  291. Starting with the projects hosted at Jakarta and the old Java
  292. Apache project, Ant spread like a virus and now is the build
  293. tool of choice for a lot of projects.</p>
  294. <p>In January 2000 Ant was moved to a separate CVS module and
  295. was promoted to a project of its own, independent of
  296. Tomcat.</p>
  297. <p>The first version of Ant that was exposed a lager audience
  298. was the one that shipped with Tomcat's 3.1 release on 19 April
  299. 2000. This version has later been referenced to as Ant
  300. 0.3.1.</p>
  301. <p>The first official release of Ant as a stand alone product was
  302. Ant 1.1 released on 19 July 2000. The complete release
  303. history:</p>
  304. <table>
  305. <tr>
  306. <td bgcolor="#039acc" colspan="" rowspan=""
  307. valign="top" align="left">
  308. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  309. Ant Version
  310. </font>
  311. </td>
  312. <td bgcolor="#039acc" colspan="" rowspan=""
  313. valign="top" align="left">
  314. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  315. Release Date
  316. </font>
  317. </td>
  318. </tr>
  319. <tr>
  320. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  321. valign="top" align="left">
  322. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  323. 1.1
  324. </font>
  325. </td>
  326. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  327. valign="top" align="left">
  328. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  329. 19 July 2000
  330. </font>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  335. valign="top" align="left">
  336. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  337. 1.2
  338. </font>
  339. </td>
  340. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  341. valign="top" align="left">
  342. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  343. 24 October 2000
  344. </font>
  345. </td>
  346. </tr>
  347. <tr>
  348. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  349. valign="top" align="left">
  350. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  351. 1.3
  352. </font>
  353. </td>
  354. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  355. valign="top" align="left">
  356. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  357. 3 March 2001
  358. </font>
  359. </td>
  360. </tr>
  361. <tr>
  362. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  363. valign="top" align="left">
  364. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  365. 1.4
  366. </font>
  367. </td>
  368. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  369. valign="top" align="left">
  370. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  371. 3 September 2001
  372. </font>
  373. </td>
  374. </tr>
  375. </table>
  376. </blockquote>
  377. </td></tr>
  378. </table>
  379. </a>
  380. <a name="no-gnu-tar">
  381. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  382. <tr><td bgcolor="#828DA6">
  383. <font color="#ffffff" face="arial,helvetica,sanserif">
  384. <strong>
  385. I get checksum errors when I try to extract the
  386. <code>tar.gz</code> distribution file. Why?
  387. </strong>
  388. </font>
  389. </td></tr>
  390. <tr><td>
  391. <blockquote>
  392. <p>Ant's distribution contains file names that are longer
  393. than 100 characters, which is not supported by the standard
  394. tar file format. Several different implementations of tar use
  395. different and incompatible ways to work around this
  396. restriction.</p>
  397. <p>Ant's &lt;tar&gt; task can create tar archives that use
  398. the GNU tar extension, and this has been used when putting
  399. together the distribution. If you are using a different
  400. version of tar (for example, the one shipping with Solaris),
  401. you cannot use it to extract the archive.</p>
  402. <p>The solution is to either install GNU tar, which can be
  403. found <a href="http://www.gnu.org/software/tar/tar.html">here</a>
  404. or use the zip archive instead (you can extract it using
  405. <code>jar xf</code>).</p>
  406. </blockquote>
  407. </td></tr>
  408. </table>
  409. </a>
  410. <a name="always-recompiles">
  411. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  412. <tr><td bgcolor="#828DA6">
  413. <font color="#ffffff" face="arial,helvetica,sanserif">
  414. <strong>
  415. Why does Ant always recompile all my Java files?
  416. </strong>
  417. </font>
  418. </td></tr>
  419. <tr><td>
  420. <blockquote>
  421. <p>In order to find out which files should be compiled, Ant
  422. compares the timestamps of the source files to those of the
  423. resulting <code>.class</code> files. Opening all source files
  424. to find out which package they belong to would be very
  425. inefficient - instead of this, Ant expects you to place your
  426. source files in a directory hierarchy that mirrors your
  427. package hierarchy and to point Ant to the root of this
  428. directory tree with the <code>srcdir</code> attribute.</p>
  429. <p>Say you have <code>&lt;javac srcdir="src"
  430. destdir="dest" /&gt;</code>. If Ant finds a file
  431. <code>src/a/b/C.java</code> it expects it to be in package
  432. <code>a.b</code> so that the resulting <code>.class</code>
  433. file is going to be <code>dest/a/b/C.class</code>.</p>
  434. <p>If your setup is different, Ant's heuristic won't work and
  435. it will recompile classes that are up to date. Ant is not the
  436. only tool, that expects a source tree layout like this.</p>
  437. </blockquote>
  438. </td></tr>
  439. </table>
  440. </a>
  441. <a name="passing-cli-args">
  442. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  443. <tr><td bgcolor="#828DA6">
  444. <font color="#ffffff" face="arial,helvetica,sanserif">
  445. <strong>
  446. How do I pass parameters from the command line to my
  447. build file?
  448. </strong>
  449. </font>
  450. </td></tr>
  451. <tr><td>
  452. <blockquote>
  453. <p>Use properties: <code>ant
  454. -D&lt;name&gt;=&lt;value&gt;</code> lets you define values for
  455. properties. These can then be used within your build file as
  456. any normal property: <code>${&lt;name&gt;}</code> will put in
  457. <code>&lt;value&gt;</code>.</p>
  458. </blockquote>
  459. </td></tr>
  460. </table>
  461. </a>
  462. <a name="jikes-switches">
  463. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  464. <tr><td bgcolor="#828DA6">
  465. <font color="#ffffff" face="arial,helvetica,sanserif">
  466. <strong>
  467. How can I use Jikes specific command line
  468. switches?
  469. </strong>
  470. </font>
  471. </td></tr>
  472. <tr><td>
  473. <blockquote>
  474. <p>A couple of switches are supported via magic
  475. properties:</p>
  476. <table>
  477. <tr>
  478. <td bgcolor="#039acc" colspan="" rowspan=""
  479. valign="top" align="left">
  480. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  481. switch
  482. </font>
  483. </td>
  484. <td bgcolor="#039acc" colspan="" rowspan=""
  485. valign="top" align="left">
  486. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  487. property
  488. </font>
  489. </td>
  490. <td bgcolor="#039acc" colspan="" rowspan=""
  491. valign="top" align="left">
  492. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  493. default
  494. </font>
  495. </td>
  496. </tr>
  497. <tr>
  498. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  499. valign="top" align="left">
  500. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  501. +E
  502. </font>
  503. </td>
  504. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  505. valign="top" align="left">
  506. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  507. build.compiler.emacs
  508. </font>
  509. </td>
  510. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  511. valign="top" align="left">
  512. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  513. false == not set
  514. </font>
  515. </td>
  516. </tr>
  517. <tr>
  518. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  519. valign="top" align="left">
  520. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  521. +P
  522. </font>
  523. </td>
  524. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  525. valign="top" align="left">
  526. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  527. build.compiler.pedantic
  528. </font>
  529. </td>
  530. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  531. valign="top" align="left">
  532. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  533. false == not set
  534. </font>
  535. </td>
  536. </tr>
  537. <tr>
  538. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  539. valign="top" align="left">
  540. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  541. +F
  542. </font>
  543. </td>
  544. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  545. valign="top" align="left">
  546. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  547. build.compiler.fulldepend
  548. </font>
  549. </td>
  550. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  551. valign="top" align="left">
  552. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  553. false == not set
  554. </font>
  555. </td>
  556. </tr>
  557. <tr>
  558. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  559. valign="top" align="left">
  560. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  561. <strong>only for Ant &lt; 1.4, replaced by the nowarn
  562. attribute of javac after that</strong> -nowarn
  563. </font>
  564. </td>
  565. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  566. valign="top" align="left">
  567. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  568. build.compiler.warnings
  569. </font>
  570. </td>
  571. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  572. valign="top" align="left">
  573. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  574. true == not set
  575. </font>
  576. </td>
  577. </tr>
  578. </table>
  579. </blockquote>
  580. </td></tr>
  581. </table>
  582. </a>
  583. <a name="shell-redirect-1">
  584. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  585. <tr><td bgcolor="#828DA6">
  586. <font color="#ffffff" face="arial,helvetica,sanserif">
  587. <strong>
  588. How do I include a &lt; character in my command line arguments?
  589. </strong>
  590. </font>
  591. </td></tr>
  592. <tr><td>
  593. <blockquote>
  594. <p>The short answer is "Use <code>&amp;lt;</code>".</p>
  595. <p>The long answer is, that this probably won't do what you
  596. want anyway, see <a href="#shell-redirect-2">the next
  597. section</a>.</p>
  598. </blockquote>
  599. </td></tr>
  600. </table>
  601. </a>
  602. <a name="shell-redirect-2">
  603. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  604. <tr><td bgcolor="#828DA6">
  605. <font color="#ffffff" face="arial,helvetica,sanserif">
  606. <strong>
  607. How do I redirect standard input or standard output
  608. in the <code>&lt;exec&gt;</code> task?
  609. </strong>
  610. </font>
  611. </td></tr>
  612. <tr><td>
  613. <blockquote>
  614. <p>Say you want to redirect the standard input stream of the
  615. <code>cat</code> command to read from a file, something
  616. like</p>
  617. <div align="left">
  618. <table cellspacing="4" cellpadding="0" border="0">
  619. <tr>
  620. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  621. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  622. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  623. </tr>
  624. <tr>
  625. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  626. <td bgcolor="#ffffff"><pre>
  627. shell-prompt&gt; cat &lt; foo
  628. </pre></td>
  629. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  630. </tr>
  631. <tr>
  632. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  633. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  634. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  635. </tr>
  636. </table>
  637. </div>
  638. <p>and try to translate it into</p>
  639. <div align="left">
  640. <table cellspacing="4" cellpadding="0" border="0">
  641. <tr>
  642. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  643. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  644. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  645. </tr>
  646. <tr>
  647. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  648. <td bgcolor="#ffffff"><pre>
  649. &lt;exec executable=&quot;cat&quot;&gt;
  650. &lt;arg value=&quot;&amp;lt;&quot; /&gt;
  651. &lt;arg value=&quot;foo&quot; /&gt;
  652. &lt;/exec&gt;
  653. </pre></td>
  654. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  655. </tr>
  656. <tr>
  657. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  658. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  659. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  660. </tr>
  661. </table>
  662. </div>
  663. <p>This will not do what you expect. The input-redirection is
  664. performed by your shell, not the command itself, so this
  665. should read:</p>
  666. <div align="left">
  667. <table cellspacing="4" cellpadding="0" border="0">
  668. <tr>
  669. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  670. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  671. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  672. </tr>
  673. <tr>
  674. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  675. <td bgcolor="#ffffff"><pre>
  676. &lt;exec executable=&quot;/bin/sh&quot;&gt;
  677. &lt;arg value=&quot;-c&quot; /&gt;
  678. &lt;arg value=&quot;cat &amp;lt; foo&quot; /&gt;
  679. &lt;/exec&gt;
  680. </pre></td>
  681. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  682. </tr>
  683. <tr>
  684. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  685. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  686. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  687. </tr>
  688. </table>
  689. </div>
  690. <p>Note, that you must use the <code>value</code> attribute of
  691. <code>&lt;arg&gt;</code> in the last element.</p>
  692. </blockquote>
  693. </td></tr>
  694. </table>
  695. </a>
  696. <a name="integration">
  697. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  698. <tr><td bgcolor="#828DA6">
  699. <font color="#ffffff" face="arial,helvetica,sanserif">
  700. <strong>
  701. Is Ant supported by my IDE/Editor?
  702. </strong>
  703. </font>
  704. </td></tr>
  705. <tr><td>
  706. <blockquote>
  707. <p>See the <a href="external.html#IDE and Editor Integration">section
  708. on IDE integration</a> on our external tools page.</p>
  709. </blockquote>
  710. </td></tr>
  711. </table>
  712. </a>
  713. <a name="emacs-mode">
  714. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  715. <tr><td bgcolor="#828DA6">
  716. <font color="#ffffff" face="arial,helvetica,sanserif">
  717. <strong>
  718. Why doesn't (X)Emacs/vi/MacOS X's project builder
  719. parse the error messages generated by Ant correctly?
  720. </strong>
  721. </font>
  722. </td></tr>
  723. <tr><td>
  724. <blockquote>
  725. <p>Ant adds a "banner" with the name of the current
  726. task in front of all messages - and there are no built-in
  727. regular expressions in your Editor that would account for
  728. this.</p>
  729. <p>You can disable this banner by invoking Ant with the
  730. <code>-emacs</code> switch. Alternatively you can add the
  731. following snippet to your <code>.emacs</code> to make Emacs
  732. understand Ant's output.</p>
  733. <div align="left">
  734. <table cellspacing="4" cellpadding="0" border="0">
  735. <tr>
  736. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  737. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  738. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  739. </tr>
  740. <tr>
  741. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  742. <td bgcolor="#ffffff"><pre>
  743. (require 'compile)
  744. (setq compilation-error-regexp-alist
  745. (append (list
  746. ;; works for jikes
  747. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:&quot; 1 2 3)
  748. ;; works for javac
  749. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):&quot; 1 2))
  750. compilation-error-regexp-alist))
  751. </pre></td>
  752. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  753. </tr>
  754. <tr>
  755. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  756. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  757. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  758. </tr>
  759. </table>
  760. </div>
  761. <p>Yet another alternative that preserves most of Ant's
  762. formatting is to pipe Ant's output through the following Perl
  763. script by Dirk-Willem van Gulik:</p>
  764. <div align="left">
  765. <table cellspacing="4" cellpadding="0" border="0">
  766. <tr>
  767. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  768. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  769. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  770. </tr>
  771. <tr>
  772. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  773. <td bgcolor="#ffffff"><pre>
  774. #!/usr/bin/perl
  775. #
  776. # May 2001 dirkx@apache.org - remove any
  777. # [foo] lines from the output; keeping
  778. # spacing more or less there.
  779. #
  780. $|=1;
  781. while(&lt;STDIN&gt;) {
  782. if (s/^(\s+)\[(\w+)\]//) {
  783. if ($2 ne $last) {
  784. print &quot;$1\[$2\]&quot;;
  785. $s = ' ' x length($2);
  786. } else {
  787. print &quot;$1 $s &quot;;
  788. };
  789. $last = $2;
  790. };
  791. print;
  792. };
  793. </pre></td>
  794. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  795. </tr>
  796. <tr>
  797. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  798. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  799. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  800. </tr>
  801. </table>
  802. </div>
  803. </blockquote>
  804. </td></tr>
  805. </table>
  806. </a>
  807. <a name="dtd">
  808. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  809. <tr><td bgcolor="#828DA6">
  810. <font color="#ffffff" face="arial,helvetica,sanserif">
  811. <strong>
  812. Is there a DTD that I can use to validate my build
  813. files?
  814. </strong>
  815. </font>
  816. </td></tr>
  817. <tr><td>
  818. <blockquote>
  819. <p>An incomplete DTD can be created by the
  820. <code>&lt;antstructure&gt;</code> task - but this one
  821. has a few problems:</p>
  822. <ul>
  823. <li>It doesn't know about required attributes. Only
  824. manual tweaking of this file can help here.</li>
  825. <li>It is not complete - if you add new tasks via
  826. <code>&lt;taskdef&gt;</code> it won't know about it. See
  827. <a href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html">this
  828. page</a> by Michel Casabianca for a solution to this
  829. problem. Note that the DTD you can download at this page
  830. is based on Ant 0.3.1.</li>
  831. <li>It may even be an invalid DTD. As Ant allows tasks
  832. writers to define arbitrary elements, name collisions will
  833. happen quite frequently - if your version of Ant contains
  834. the optional <code>&lt;test&gt;</code> and
  835. <code>&lt;junit&gt;</code> tasks, there are two XML
  836. elements named test (the task and the nested child element
  837. of <code>&lt;junit&gt;</code>) with different attribute
  838. lists. This problem cannot be solved, DTDs don't give a
  839. syntax rich enough to support this.</li>
  840. </ul>
  841. </blockquote>
  842. </td></tr>
  843. </table>
  844. </a>
  845. <a name="xml-entity-include">
  846. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  847. <tr><td bgcolor="#828DA6">
  848. <font color="#ffffff" face="arial,helvetica,sanserif">
  849. <strong>
  850. How do I include an XML snippet in my build file?
  851. </strong>
  852. </font>
  853. </td></tr>
  854. <tr><td>
  855. <blockquote>
  856. <p>You can use XML's way of including external files and let
  857. the parser do the job for Ant:</p>
  858. <div align="left">
  859. <table cellspacing="4" cellpadding="0" border="0">
  860. <tr>
  861. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  862. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  863. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  864. </tr>
  865. <tr>
  866. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  867. <td bgcolor="#ffffff"><pre>
  868. &lt;?xml version=&quot;1.0&quot;?&gt;
  869. &lt;!DOCTYPE project [
  870. &lt;!ENTITY common SYSTEM &quot;file:./common.xml&quot;&gt;
  871. ]&gt;
  872. &lt;project name=&quot;test&quot; default=&quot;test&quot; basedir=&quot;.&quot;&gt;
  873. &lt;target name=&quot;setup&quot;&gt;
  874. ...
  875. &lt;/target&gt;
  876. &amp;common;
  877. ...
  878. &lt;/project&gt;
  879. </pre></td>
  880. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  881. </tr>
  882. <tr>
  883. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  884. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  885. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  886. </tr>
  887. </table>
  888. </div>
  889. <p>will literally include the contents of <code>common.xml</code> where
  890. you've placed the <code>&amp;common;</code> entity.</p>
  891. <p>In combination with a DTD, this would look like this:</p>
  892. <div align="left">
  893. <table cellspacing="4" cellpadding="0" border="0">
  894. <tr>
  895. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  896. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  897. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  898. </tr>
  899. <tr>
  900. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  901. <td bgcolor="#ffffff"><pre>
  902. &lt;!DOCTYPE project PUBLIC &quot;-//ANT//DTD project//EN&quot; &quot;file:./ant.dtd&quot; [
  903. &lt;!ENTITY include SYSTEM &quot;file:./header.xml&quot;&gt;
  904. ]&gt;
  905. </pre></td>
  906. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  907. </tr>
  908. <tr>
  909. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  910. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  911. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  912. </tr>
  913. </table>
  914. </div>
  915. </blockquote>
  916. </td></tr>
  917. </table>
  918. </a>
  919. <a name="mail-logger">
  920. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  921. <tr><td bgcolor="#828DA6">
  922. <font color="#ffffff" face="arial,helvetica,sanserif">
  923. <strong>
  924. How do I send an email with the result of my build
  925. process?
  926. </strong>
  927. </font>
  928. </td></tr>
  929. <tr><td>
  930. <blockquote>
  931. <p>You can use a custom BuildListener, that sends out an email
  932. in the buildFinished() method. Will Glozer
  933. &lt;will.glozer@jda.com&gt; has written such a listener based
  934. on <a href="http://java.sun.com/products/javamail/">JavaMail</a>,
  935. the source is</p>
  936. <div align="left">
  937. <table cellspacing="4" cellpadding="0" border="0">
  938. <tr>
  939. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  940. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  941. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  942. </tr>
  943. <tr>
  944. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  945. <td bgcolor="#ffffff"><pre>
  946. import java.io.*;
  947. import java.util.*;
  948. import javax.mail.*;
  949. import javax.mail.internet.*;
  950. import org.apache.tools.ant.*;
  951. /**
  952. * A simple listener that waits for a build to finish and sends an email
  953. * of the results. The settings are stored in &quot;monitor.properties&quot; and
  954. * are fairly self explanatory.
  955. *
  956. * @author Will Glozer
  957. * @version 1.05a 09/06/2000
  958. */
  959. public class BuildMonitor implements BuildListener {
  960. protected Properties props;
  961. /**
  962. * Create a new BuildMonitor.
  963. */
  964. public BuildMonitor() throws Exception {
  965. props = new Properties();
  966. InputStream is = getClass().getResourceAsStream(&quot;monitor.properties&quot;);
  967. props.load(is);
  968. is.close();
  969. }
  970. public void buildStarted(BuildEvent e) {
  971. }
  972. /**
  973. * Determine the status of the build and the actions to follow, now that
  974. * the build has completed.
  975. *
  976. * @param e Event describing the build tatus.
  977. */
  978. public void buildFinished(BuildEvent e) {
  979. Throwable th = e.getException();
  980. String status = (th != null) ? &quot;failed&quot; : &quot;succeeded&quot;;
  981. try {
  982. String key = &quot;build.&quot; + status;
  983. if (props.getProperty(key + &quot;.notify&quot;).equalsIgnoreCase(&quot;false&quot;)) {
  984. return;
  985. }
  986. Session session = Session.getDefaultInstance(props, null);
  987. MimeMessage message = new MimeMessage(session);
  988. message.addRecipients(Message.RecipientType.TO, parseAddresses(
  989. props.getProperty(key + &quot;.email.to&quot;)));
  990. message.setSubject(props.getProperty(key + &quot;.email.subject&quot;));
  991. BufferedReader br = new BufferedReader(new FileReader(
  992. props.getProperty(&quot;build.log&quot;)));
  993. StringWriter sw = new StringWriter();
  994. String line = br.readLine();
  995. while (line != null) {
  996. sw.write(line);
  997. sw.write(&quot;\n&quot;);
  998. line = br.readLine();
  999. }
  1000. br.close();
  1001. message.setText(sw.toString(), &quot;UTF-8&quot;);
  1002. sw.close();
  1003. Transport transport = session.getTransport();
  1004. transport.connect();
  1005. transport.send(message);
  1006. transport.close();
  1007. } catch (Exception ex) {
  1008. System.out.println(&quot;BuildMonitor failed to send email!&quot;);
  1009. ex.printStackTrace();
  1010. }
  1011. }
  1012. /**
  1013. * Parse a comma separated list of internet email addresses.
  1014. *
  1015. * @param s The list of addresses.
  1016. * @return Array of Addresses.
  1017. */
  1018. protected Address[] parseAddresses(String s) throws Exception {
  1019. StringTokenizer st = new StringTokenizer(s, &quot;,&quot;);
  1020. Address[] addrs = new Address[st.countTokens()];
  1021. for (int i = 0; i &lt; addrs.length; i++) {
  1022. addrs[i] = new InternetAddress(st.nextToken());
  1023. }
  1024. return addrs;
  1025. }
  1026. public void messageLogged(BuildEvent e) {
  1027. }
  1028. public void targetStarted(BuildEvent e) {
  1029. }
  1030. public void targetFinished(BuildEvent e) {
  1031. }
  1032. public void taskStarted(BuildEvent e) {
  1033. }
  1034. public void taskFinished(BuildEvent e) {
  1035. }
  1036. }
  1037. </pre></td>
  1038. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1039. </tr>
  1040. <tr>
  1041. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1042. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1043. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1044. </tr>
  1045. </table>
  1046. </div>
  1047. <p>With a <code>monitor.properties</code> like this</p>
  1048. <div align="left">
  1049. <table cellspacing="4" cellpadding="0" border="0">
  1050. <tr>
  1051. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1052. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1053. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1054. </tr>
  1055. <tr>
  1056. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1057. <td bgcolor="#ffffff"><pre>
  1058. # configuration for build monitor
  1059. mail.transport.protocol=smtp
  1060. mail.smtp.host=&lt;host&gt;
  1061. mail.from=Will Glozer &lt;will.glozer@jda.com&gt;
  1062. build.log=build.log
  1063. build.failed.notify=true
  1064. build.failed.email.to=will.glozer@jda.com
  1065. build.failed.email.subject=Nightly build failed!
  1066. build.succeeded.notify=true
  1067. build.succeeded.email.to=will.glozer@jda.com
  1068. build.succeeded.email.subject=Nightly build succeeded!
  1069. </pre></td>
  1070. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1071. </tr>
  1072. <tr>
  1073. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1074. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1075. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1076. </tr>
  1077. </table>
  1078. </div>
  1079. <p><code>monitor.properties</code> should be placed right next
  1080. to your compiled <code>BuildMonitor.class</code>. To use it,
  1081. invoke Ant like</p>
  1082. <div align="left">
  1083. <table cellspacing="4" cellpadding="0" border="0">
  1084. <tr>
  1085. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1086. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1087. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1088. </tr>
  1089. <tr>
  1090. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1091. <td bgcolor="#ffffff"><pre>
  1092. ant -listener BuildMonitor
  1093. </pre></td>
  1094. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1095. </tr>
  1096. <tr>
  1097. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1098. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1099. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1100. </tr>
  1101. </table>
  1102. </div>
  1103. <p>Make sure that <code>mail.jar</code> from JavaMail and
  1104. <code>activation.jar</code> from the
  1105. <a href="http://java.sun.com/products/javabeans/glasgow/jaf.html">Java
  1106. Beans Activation Framework</a> in your <code>CLASSPATH</code>.</p>
  1107. </blockquote>
  1108. </td></tr>
  1109. </table>
  1110. </a>
  1111. <a name="remove-cr">
  1112. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1113. <tr><td bgcolor="#828DA6">
  1114. <font color="#ffffff" face="arial,helvetica,sanserif">
  1115. <strong>
  1116. &lt;chmod&gt; or &lt;exec&gt; don't work in Ant
  1117. 1.3 on Unix
  1118. </strong>
  1119. </font>
  1120. </td></tr>
  1121. <tr><td>
  1122. <blockquote>
  1123. <p>The <code>antRun</code> script in <code>ANT_HOME/bin</code>
  1124. has DOS instead of Unix line endings, you must remove the
  1125. carriage return characters from this file. This can be done by
  1126. using Ant's &lt;fixcrlf&gt; task or something like:</p>
  1127. <div align="left">
  1128. <table cellspacing="4" cellpadding="0" border="0">
  1129. <tr>
  1130. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1131. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1132. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1133. </tr>
  1134. <tr>
  1135. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1136. <td bgcolor="#ffffff"><pre>
  1137. tr -d '\r' &lt; $ANT_HOME/bin/antRun &gt; /tmp/foo
  1138. mv /tmp/foo $ANT_HOME/bin/antRun
  1139. </pre></td>
  1140. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1141. </tr>
  1142. <tr>
  1143. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1144. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1145. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1146. </tr>
  1147. </table>
  1148. </div>
  1149. </blockquote>
  1150. </td></tr>
  1151. </table>
  1152. </a>
  1153. <a name="javadoc-cannot-execute">
  1154. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1155. <tr><td bgcolor="#828DA6">
  1156. <font color="#ffffff" face="arial,helvetica,sanserif">
  1157. <strong>
  1158. JavaDoc failed: java.io.IOException: javadoc: cannot execute
  1159. </strong>
  1160. </font>
  1161. </td></tr>
  1162. <tr><td>
  1163. <blockquote>
  1164. <p>There is a bug in the Solaris reference implementation of
  1165. the JDK, see <a href="http://developer.java.sun.com/developer/bugParade/bugs/4230399.html">http://developer.java.sun.com/developer/bugParade/bugs/4230399.html</a>.
  1166. This also appears to be true under Linux, moving the JDK to
  1167. the front of the PATH fixes the problem.</p>
  1168. </blockquote>
  1169. </td></tr>
  1170. </table>
  1171. </a>
  1172. </blockquote>
  1173. </td></tr>
  1174. </table>
  1175. </td>
  1176. </tr>
  1177. <!-- FOOTER -->
  1178. <tr><td colspan="2">
  1179. <hr noshade="" size="1"/>
  1180. </td></tr>
  1181. <tr><td colspan="2">
  1182. <div align="center"><font color="#525D76" size="-1"><em>
  1183. Copyright &#169; 1999-2001, Apache Software Foundation
  1184. </em></font></div>
  1185. </td></tr>
  1186. </table>
  1187. </body>
  1188. </html>
  1189. <!-- end the processing -->