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

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