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 50 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219
  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. </table>
  362. </blockquote>
  363. </td></tr>
  364. </table>
  365. </a>
  366. <a name="no-gnu-tar">
  367. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  368. <tr><td bgcolor="#828DA6">
  369. <font color="#ffffff" face="arial,helvetica,sanserif">
  370. <strong>
  371. I get checksum errors when I try to extract the
  372. <code>tar.gz</code> distribution file. Why?
  373. </strong>
  374. </font>
  375. </td></tr>
  376. <tr><td>
  377. <blockquote>
  378. <p>Ant's distribution contains file names that are longer
  379. than 100 characters, which is not supported by the standard
  380. tar file format. Several different implementations of tar use
  381. different and incompatible ways to work around this
  382. restriction.</p>
  383. <p>Ant's &lt;tar&gt; task can create tar archives that use
  384. the GNU tar extension, and this has been used when putting
  385. together the distribution. If you are using a different
  386. version of tar (for example, the one shipping with Solaris),
  387. you cannot use it to extract the archive.</p>
  388. <p>The solution is to either install GNU tar, which can be
  389. found <a href="http://www.gnu.org/software/tar/tar.html">here</a>
  390. or use the zip archive instead (you can extract it using
  391. <code>jar xf</code>).</p>
  392. </blockquote>
  393. </td></tr>
  394. </table>
  395. </a>
  396. <a name="always-recompiles">
  397. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  398. <tr><td bgcolor="#828DA6">
  399. <font color="#ffffff" face="arial,helvetica,sanserif">
  400. <strong>
  401. Why does Ant always recompile all my Java files?
  402. </strong>
  403. </font>
  404. </td></tr>
  405. <tr><td>
  406. <blockquote>
  407. <p>In order to find out which files should be compiled, Ant
  408. compares the timestamps of the source files to those of the
  409. resulting <code>.class</code> files. Opening all source files
  410. to find out which package they belong to would be very
  411. inefficient - instead of this, Ant expects you to place your
  412. source files in a directory hierarchy that mirrors your
  413. package hierarchy and to point Ant to the root of this
  414. directory tree with the <code>srcdir</code> attribute.</p>
  415. <p>Say you have <code>&lt;javac srcdir="src"
  416. destdir="dest" /&gt;</code>. If Ant finds a file
  417. <code>src/a/b/C.java</code> it expects it to be in package
  418. <code>a.b</code> so that the resulting <code>.class</code>
  419. file is going to be <code>dest/a/b/C.class</code>.</p>
  420. <p>If your setup is different, Ant's heuristic won't work and
  421. it will recompile classes that are up to date. Ant is not the
  422. only tool, that expects a source tree layout like this.</p>
  423. </blockquote>
  424. </td></tr>
  425. </table>
  426. </a>
  427. <a name="passing-cli-args">
  428. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  429. <tr><td bgcolor="#828DA6">
  430. <font color="#ffffff" face="arial,helvetica,sanserif">
  431. <strong>
  432. How do I pass parameters from the command line to my
  433. build file?
  434. </strong>
  435. </font>
  436. </td></tr>
  437. <tr><td>
  438. <blockquote>
  439. <p>Use properties: <code>ant
  440. -D&lt;name&gt;=&lt;value&gt;</code> lets you define values for
  441. properties. These can then be used within your build file as
  442. any normal property: <code>${&lt;name&gt;}</code> will put in
  443. <code>&lt;value&gt;</code>.</p>
  444. </blockquote>
  445. </td></tr>
  446. </table>
  447. </a>
  448. <a name="jikes-switches">
  449. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  450. <tr><td bgcolor="#828DA6">
  451. <font color="#ffffff" face="arial,helvetica,sanserif">
  452. <strong>
  453. How can I use Jikes specific command line
  454. switches?
  455. </strong>
  456. </font>
  457. </td></tr>
  458. <tr><td>
  459. <blockquote>
  460. <p>A couple of switches are supported via magic
  461. properties:</p>
  462. <table>
  463. <tr>
  464. <td bgcolor="#039acc" colspan="" rowspan=""
  465. valign="top" align="left">
  466. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  467. switch
  468. </font>
  469. </td>
  470. <td bgcolor="#039acc" colspan="" rowspan=""
  471. valign="top" align="left">
  472. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  473. property
  474. </font>
  475. </td>
  476. <td bgcolor="#039acc" colspan="" rowspan=""
  477. valign="top" align="left">
  478. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  479. default
  480. </font>
  481. </td>
  482. </tr>
  483. <tr>
  484. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  485. valign="top" align="left">
  486. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  487. +E
  488. </font>
  489. </td>
  490. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  491. valign="top" align="left">
  492. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  493. build.compiler.emacs
  494. </font>
  495. </td>
  496. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  497. valign="top" align="left">
  498. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  499. false == not set
  500. </font>
  501. </td>
  502. </tr>
  503. <tr>
  504. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  505. valign="top" align="left">
  506. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  507. -nowarn
  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. build.compiler.warnings
  514. </font>
  515. </td>
  516. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  517. valign="top" align="left">
  518. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  519. true == not set
  520. </font>
  521. </td>
  522. </tr>
  523. <tr>
  524. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  525. valign="top" align="left">
  526. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  527. +P
  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. build.compiler.pedantic
  534. </font>
  535. </td>
  536. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  537. valign="top" align="left">
  538. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  539. false == not set
  540. </font>
  541. </td>
  542. </tr>
  543. <tr>
  544. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  545. valign="top" align="left">
  546. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  547. +F
  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. build.compiler.fulldepend
  554. </font>
  555. </td>
  556. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  557. valign="top" align="left">
  558. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  559. false == not set
  560. </font>
  561. </td>
  562. </tr>
  563. </table>
  564. </blockquote>
  565. </td></tr>
  566. </table>
  567. </a>
  568. <a name="shell-redirect-1">
  569. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  570. <tr><td bgcolor="#828DA6">
  571. <font color="#ffffff" face="arial,helvetica,sanserif">
  572. <strong>
  573. How do I include a &lt; character in my command line arguments?
  574. </strong>
  575. </font>
  576. </td></tr>
  577. <tr><td>
  578. <blockquote>
  579. <p>The short answer is "Use <code>&amp;lt;</code>".</p>
  580. <p>The long answer is, that this probably won't do what you
  581. want anyway, see <a href="#shell-redirect-2">the next
  582. section</a>.</p>
  583. </blockquote>
  584. </td></tr>
  585. </table>
  586. </a>
  587. <a name="shell-redirect-2">
  588. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  589. <tr><td bgcolor="#828DA6">
  590. <font color="#ffffff" face="arial,helvetica,sanserif">
  591. <strong>
  592. How do I redirect standard input or standard output
  593. in the <code>&lt;exec&gt;</code> task?
  594. </strong>
  595. </font>
  596. </td></tr>
  597. <tr><td>
  598. <blockquote>
  599. <p>Say you want to redirect the standard input stream of the
  600. <code>cat</code> command to read from a file, something
  601. like</p>
  602. <div align="left">
  603. <table cellspacing="4" cellpadding="0" border="0">
  604. <tr>
  605. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  606. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  607. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  608. </tr>
  609. <tr>
  610. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  611. <td bgcolor="#ffffff"><pre>
  612. shell-prompt&gt; cat &lt; foo
  613. </pre></td>
  614. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  615. </tr>
  616. <tr>
  617. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  618. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  619. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  620. </tr>
  621. </table>
  622. </div>
  623. <p>and try to translate it into</p>
  624. <div align="left">
  625. <table cellspacing="4" cellpadding="0" border="0">
  626. <tr>
  627. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  628. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  629. <td bgcolor="#023264" width="1" height="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"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  633. <td bgcolor="#ffffff"><pre>
  634. &lt;exec executable=&quot;cat&quot;&gt;
  635. &lt;arg value=&quot;&amp;lt;&quot; /&gt;
  636. &lt;arg value=&quot;foo&quot; /&gt;
  637. &lt;/exec&gt;
  638. </pre></td>
  639. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  640. </tr>
  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. </table>
  647. </div>
  648. <p>This will not do what you expect. The input-redirection is
  649. performed by your shell, not the command itself, so this
  650. should read:</p>
  651. <div align="left">
  652. <table cellspacing="4" cellpadding="0" border="0">
  653. <tr>
  654. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  655. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  656. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  657. </tr>
  658. <tr>
  659. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  660. <td bgcolor="#ffffff"><pre>
  661. &lt;exec executable=&quot;/bin/sh&quot;&gt;
  662. &lt;arg value=&quot;-c&quot; /&gt;
  663. &lt;arg value=&quot;cat &amp;lt; foo&quot; /&gt;
  664. &lt;/exec&gt;
  665. </pre></td>
  666. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  667. </tr>
  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. </table>
  674. </div>
  675. <p>Note, that you must use the <code>value</code> attribute of
  676. <code>&lt;arg&gt;</code> in the last element.</p>
  677. </blockquote>
  678. </td></tr>
  679. </table>
  680. </a>
  681. <a name="integration">
  682. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  683. <tr><td bgcolor="#828DA6">
  684. <font color="#ffffff" face="arial,helvetica,sanserif">
  685. <strong>
  686. Is Ant supported by my IDE/Editor?
  687. </strong>
  688. </font>
  689. </td></tr>
  690. <tr><td>
  691. <blockquote>
  692. <p>See the <a href="external.html#IDE%47Editor+Integration">section
  693. on IDE integration</a> on our external tools page.</p>
  694. </blockquote>
  695. </td></tr>
  696. </table>
  697. </a>
  698. <a name="emacs-mode">
  699. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  700. <tr><td bgcolor="#828DA6">
  701. <font color="#ffffff" face="arial,helvetica,sanserif">
  702. <strong>
  703. Why doesn't (X)Emacs/vi/MacOS X's project builder
  704. parse the error messages generated by Ant correctly?
  705. </strong>
  706. </font>
  707. </td></tr>
  708. <tr><td>
  709. <blockquote>
  710. <p>Ant adds a "banner" with the name of the current
  711. task in front of all messages - and there are no built-in
  712. regular expressions in your Editor that would account for
  713. this.</p>
  714. <p>You can disable this banner by invoking Ant with the
  715. <code>-emacs</code> switch. Alternatively you can add the
  716. following snippet to your <code>.emacs</code> to make Emacs
  717. understand Ant's output.</p>
  718. <div align="left">
  719. <table cellspacing="4" cellpadding="0" border="0">
  720. <tr>
  721. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  722. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  723. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  724. </tr>
  725. <tr>
  726. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  727. <td bgcolor="#ffffff"><pre>
  728. (require 'compile)
  729. (setq compilation-error-regexp-alist
  730. (append (list
  731. ;; works for jikes
  732. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:&quot; 1 2 3)
  733. ;; works for javac
  734. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):&quot; 1 2))
  735. compilation-error-regexp-alist))
  736. </pre></td>
  737. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  738. </tr>
  739. <tr>
  740. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  741. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  742. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  743. </tr>
  744. </table>
  745. </div>
  746. <p>Yet another alternative that preserves most of Ant's
  747. formatting is to pipe Ant's output through the following Perl
  748. script by Dirk-Willem van Gulik:</p>
  749. <div align="left">
  750. <table cellspacing="4" cellpadding="0" border="0">
  751. <tr>
  752. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  753. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  754. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  755. </tr>
  756. <tr>
  757. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  758. <td bgcolor="#ffffff"><pre>
  759. #!/usr/bin/perl
  760. #
  761. # May 2001 dirkx@apache.org - remove any
  762. # [foo] lines from the output; keeping
  763. # spacing more or less there.
  764. #
  765. $|=1;
  766. while(&lt;STDIN&gt;) {
  767. if (s/^(\s+)\[(\w+)\]//) {
  768. if ($2 ne $last) {
  769. print &quot;$1\[$2\]&quot;;
  770. $s = ' ' x length($2);
  771. } else {
  772. print &quot;$1 $s &quot;;
  773. };
  774. $last = $2;
  775. };
  776. print;
  777. };
  778. </pre></td>
  779. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  780. </tr>
  781. <tr>
  782. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  783. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  784. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  785. </tr>
  786. </table>
  787. </div>
  788. </blockquote>
  789. </td></tr>
  790. </table>
  791. </a>
  792. <a name="dtd">
  793. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  794. <tr><td bgcolor="#828DA6">
  795. <font color="#ffffff" face="arial,helvetica,sanserif">
  796. <strong>
  797. Is there a DTD that I can use to validate my build
  798. files?
  799. </strong>
  800. </font>
  801. </td></tr>
  802. <tr><td>
  803. <blockquote>
  804. <p>An incomplete DTD can be created by the
  805. <code>&lt;antstructure&gt;</code> task - but this one
  806. has a few problems:</p>
  807. <ul>
  808. <li>It doesn't know about required attributes. Only
  809. manual tweaking of this file can help here.</li>
  810. <li>It is not complete - if you add new tasks via
  811. <code>&lt;taskdef&gt;</code> it won't know about it. See
  812. <a href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html">this
  813. page</a> by Michel Casabianca for a solution to this
  814. problem. Note that the DTD you can download at this page
  815. is based on Ant 0.3.1.</li>
  816. <li>It may even be an invalid DTD. As Ant allows tasks
  817. writers to define arbitrary elements, name collisions will
  818. happen quite frequently - if your version of Ant contains
  819. the optional <code>&lt;test&gt;</code> and
  820. <code>&lt;junit&gt;</code> tasks, there are two XML
  821. elements named test (the task and the nested child element
  822. of <code>&lt;junit&gt;</code>) with different attribute
  823. lists. This problem cannot be solved, DTDs don't give a
  824. syntax rich enough to support this.</li>
  825. </ul>
  826. </blockquote>
  827. </td></tr>
  828. </table>
  829. </a>
  830. <a name="xml-entity-include">
  831. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  832. <tr><td bgcolor="#828DA6">
  833. <font color="#ffffff" face="arial,helvetica,sanserif">
  834. <strong>
  835. How do I include an XML snippet in my build file?
  836. </strong>
  837. </font>
  838. </td></tr>
  839. <tr><td>
  840. <blockquote>
  841. <p>You can use XML's way of including external files and let
  842. the parser do the job for Ant:</p>
  843. <div align="left">
  844. <table cellspacing="4" cellpadding="0" border="0">
  845. <tr>
  846. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  847. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  848. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  849. </tr>
  850. <tr>
  851. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  852. <td bgcolor="#ffffff"><pre>
  853. &lt;?xml version=&quot;1.0&quot;?&gt;
  854. &lt;!DOCTYPE project [
  855. &lt;!ENTITY common SYSTEM &quot;file:./common.xml&quot;&gt;
  856. ]&gt;
  857. &lt;project name=&quot;test&quot; default=&quot;test&quot; basedir=&quot;.&quot;&gt;
  858. &lt;target name=&quot;setup&quot;&gt;
  859. ...
  860. &lt;/target&gt;
  861. &amp;common;
  862. ...
  863. &lt;/project&gt;
  864. </pre></td>
  865. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  866. </tr>
  867. <tr>
  868. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  869. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  870. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  871. </tr>
  872. </table>
  873. </div>
  874. <p>will literally include the contents of <code>common.xml</code> where
  875. you've placed the <code>&amp;common;</code> entity.</p>
  876. <p>In combination with a DTD, this would look like this:</p>
  877. <div align="left">
  878. <table cellspacing="4" cellpadding="0" border="0">
  879. <tr>
  880. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  881. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  882. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  883. </tr>
  884. <tr>
  885. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  886. <td bgcolor="#ffffff"><pre>
  887. &lt;!DOCTYPE project PUBLIC &quot;-//ANT//DTD project//EN&quot; &quot;file:./ant.dtd&quot; [
  888. &lt;!ENTITY include SYSTEM &quot;file:./header.xml&quot;&gt;
  889. ]&gt;
  890. </pre></td>
  891. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  892. </tr>
  893. <tr>
  894. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  895. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  896. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  897. </tr>
  898. </table>
  899. </div>
  900. </blockquote>
  901. </td></tr>
  902. </table>
  903. </a>
  904. <a name="mail-logger">
  905. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  906. <tr><td bgcolor="#828DA6">
  907. <font color="#ffffff" face="arial,helvetica,sanserif">
  908. <strong>
  909. How do I send an email with the result of my build
  910. process?
  911. </strong>
  912. </font>
  913. </td></tr>
  914. <tr><td>
  915. <blockquote>
  916. <p>You can use a custom BuildListener, that sends out an email
  917. in the buildFinished() method. Will Glozer
  918. &lt;will.glozer@jda.com&gt; has written such a listener based
  919. on <a href="http://java.sun.com/products/javamail/">JavaMail</a>,
  920. the source is</p>
  921. <div align="left">
  922. <table cellspacing="4" cellpadding="0" border="0">
  923. <tr>
  924. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  925. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  926. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  927. </tr>
  928. <tr>
  929. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  930. <td bgcolor="#ffffff"><pre>
  931. import java.io.*;
  932. import java.util.*;
  933. import javax.mail.*;
  934. import javax.mail.internet.*;
  935. import org.apache.tools.ant.*;
  936. /**
  937. * A simple listener that waits for a build to finish and sends an email
  938. * of the results. The settings are stored in &quot;monitor.properties&quot; and
  939. * are fairly self explanatory.
  940. *
  941. * @author Will Glozer
  942. * @version 1.05a 09/06/2000
  943. */
  944. public class BuildMonitor implements BuildListener {
  945. protected Properties props;
  946. /**
  947. * Create a new BuildMonitor.
  948. */
  949. public BuildMonitor() throws Exception {
  950. props = new Properties();
  951. InputStream is = getClass().getResourceAsStream(&quot;monitor.properties&quot;);
  952. props.load(is);
  953. is.close();
  954. }
  955. public void buildStarted(BuildEvent e) {
  956. }
  957. /**
  958. * Determine the status of the build and the actions to follow, now that
  959. * the build has completed.
  960. *
  961. * @param e Event describing the build tatus.
  962. */
  963. public void buildFinished(BuildEvent e) {
  964. Throwable th = e.getException();
  965. String status = (th != null) ? &quot;failed&quot; : &quot;succeeded&quot;;
  966. try {
  967. String key = &quot;build.&quot; + status;
  968. if (props.getProperty(key + &quot;.notify&quot;).equalsIgnoreCase(&quot;false&quot;)) {
  969. return;
  970. }
  971. Session session = Session.getDefaultInstance(props, null);
  972. MimeMessage message = new MimeMessage(session);
  973. message.addRecipients(Message.RecipientType.TO, parseAddresses(
  974. props.getProperty(key + &quot;.email.to&quot;)));
  975. message.setSubject(props.getProperty(key + &quot;.email.subject&quot;));
  976. BufferedReader br = new BufferedReader(new FileReader(
  977. props.getProperty(&quot;build.log&quot;)));
  978. StringWriter sw = new StringWriter();
  979. String line = br.readLine();
  980. while (line != null) {
  981. sw.write(line);
  982. sw.write(&quot;\n&quot;);
  983. line = br.readLine();
  984. }
  985. br.close();
  986. message.setText(sw.toString(), &quot;UTF-8&quot;);
  987. sw.close();
  988. Transport transport = session.getTransport();
  989. transport.connect();
  990. transport.send(message);
  991. transport.close();
  992. } catch (Exception ex) {
  993. System.out.println(&quot;BuildMonitor failed to send email!&quot;);
  994. ex.printStackTrace();
  995. }
  996. }
  997. /**
  998. * Parse a comma separated list of internet email addresses.
  999. *
  1000. * @param s The list of addresses.
  1001. * @return Array of Addresses.
  1002. */
  1003. protected Address[] parseAddresses(String s) throws Exception {
  1004. StringTokenizer st = new StringTokenizer(s, &quot;,&quot;);
  1005. Address[] addrs = new Address[st.countTokens()];
  1006. for (int i = 0; i &lt; addrs.length; i++) {
  1007. addrs[i] = new InternetAddress(st.nextToken());
  1008. }
  1009. return addrs;
  1010. }
  1011. public void messageLogged(BuildEvent e) {
  1012. }
  1013. public void targetStarted(BuildEvent e) {
  1014. }
  1015. public void targetFinished(BuildEvent e) {
  1016. }
  1017. public void taskStarted(BuildEvent e) {
  1018. }
  1019. public void taskFinished(BuildEvent e) {
  1020. }
  1021. }
  1022. </pre></td>
  1023. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1024. </tr>
  1025. <tr>
  1026. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1027. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1028. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1029. </tr>
  1030. </table>
  1031. </div>
  1032. <p>With a <code>monitor.properties</code> like this</p>
  1033. <div align="left">
  1034. <table cellspacing="4" cellpadding="0" border="0">
  1035. <tr>
  1036. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1037. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1038. <td bgcolor="#023264" width="1" height="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"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1042. <td bgcolor="#ffffff"><pre>
  1043. # configuration for build monitor
  1044. mail.transport.protocol=smtp
  1045. mail.smtp.host=&lt;host&gt;
  1046. mail.from=Will Glozer &lt;will.glozer@jda.com&gt;
  1047. build.log=build.log
  1048. build.failed.notify=true
  1049. build.failed.email.to=will.glozer@jda.com
  1050. build.failed.email.subject=Nightly build failed!
  1051. build.succeeded.notify=true
  1052. build.succeeded.email.to=will.glozer@jda.com
  1053. build.succeeded.email.subject=Nightly build succeeded!
  1054. </pre></td>
  1055. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1056. </tr>
  1057. <tr>
  1058. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1059. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1060. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1061. </tr>
  1062. </table>
  1063. </div>
  1064. <p><code>monitor.properties</code> should be placed right next
  1065. to your compiled <code>BuildMonitor.class</code>. To use it,
  1066. invoke Ant like</p>
  1067. <div align="left">
  1068. <table cellspacing="4" cellpadding="0" border="0">
  1069. <tr>
  1070. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1071. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1072. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1073. </tr>
  1074. <tr>
  1075. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1076. <td bgcolor="#ffffff"><pre>
  1077. ant -listener BuildMonitor
  1078. </pre></td>
  1079. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1080. </tr>
  1081. <tr>
  1082. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1083. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1084. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1085. </tr>
  1086. </table>
  1087. </div>
  1088. <p>Make sure that <code>mail.jar</code> from JavaMail and
  1089. <code>activation.jar</code> from the
  1090. <a href="http://java.sun.com/products/javabeans/glasgow/jaf.html">Java
  1091. Beans Activation Framework</a> in your <code>CLASSPATH</code>.</p>
  1092. </blockquote>
  1093. </td></tr>
  1094. </table>
  1095. </a>
  1096. <a name="remove-cr">
  1097. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1098. <tr><td bgcolor="#828DA6">
  1099. <font color="#ffffff" face="arial,helvetica,sanserif">
  1100. <strong>
  1101. &lt;chmod&gt; or &lt;exec&gt; don't work in Ant
  1102. 1.3 on Unix
  1103. </strong>
  1104. </font>
  1105. </td></tr>
  1106. <tr><td>
  1107. <blockquote>
  1108. <p>The <code>antRun</code> script in <code>ANT_HOME/bin</code>
  1109. has DOS instead of Unix line endings, you must remove the
  1110. carriage return characters from this file. This can be done by
  1111. using Ant's &lt;fixcrlf&gt; task or something like:</p>
  1112. <div align="left">
  1113. <table cellspacing="4" cellpadding="0" border="0">
  1114. <tr>
  1115. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1116. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1117. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1118. </tr>
  1119. <tr>
  1120. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1121. <td bgcolor="#ffffff"><pre>
  1122. tr -d '\r' &lt; $ANT_HOME/bin/antRun &gt; /tmp/foo
  1123. mv /tmp/foo $ANT_HOME/bin/antRun
  1124. </pre></td>
  1125. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1126. </tr>
  1127. <tr>
  1128. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1129. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  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. </tr>
  1132. </table>
  1133. </div>
  1134. </blockquote>
  1135. </td></tr>
  1136. </table>
  1137. </a>
  1138. <a name="javadoc-cannot-execute">
  1139. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1140. <tr><td bgcolor="#828DA6">
  1141. <font color="#ffffff" face="arial,helvetica,sanserif">
  1142. <strong>
  1143. JavaDoc failed: java.io.IOException: javadoc: cannot execute
  1144. </strong>
  1145. </font>
  1146. </td></tr>
  1147. <tr><td>
  1148. <blockquote>
  1149. <p>There is a bug in the Solaris reference implementation of
  1150. 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>.
  1151. This also appears to be true under Linux, moving the JDK to
  1152. the front of the PATH fixes the problem.</p>
  1153. </blockquote>
  1154. </td></tr>
  1155. </table>
  1156. </a>
  1157. </blockquote>
  1158. </td></tr>
  1159. </table>
  1160. </td>
  1161. </tr>
  1162. <!-- FOOTER -->
  1163. <tr><td colspan="2">
  1164. <hr noshade="" size="1"/>
  1165. </td></tr>
  1166. <tr><td colspan="2">
  1167. <div align="center"><font color="#525D76" size="-1"><em>
  1168. Copyright &#169; 1999-2001, Apache Software Foundation
  1169. </em></font></div>
  1170. </td></tr>
  1171. </table>
  1172. </body>
  1173. </html>
  1174. <!-- end the processing -->