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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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. +P
  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.pedantic
  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. false == 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. +F
  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.fulldepend
  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. <strong>only for Ant &lt; 1.4, replaced by the nowarn
  548. attribute of javac after that</strong> -nowarn
  549. </font>
  550. </td>
  551. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  552. valign="top" align="left">
  553. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  554. build.compiler.warnings
  555. </font>
  556. </td>
  557. <td bgcolor="#a0ddf0" colspan="" rowspan=""
  558. valign="top" align="left">
  559. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  560. true == not set
  561. </font>
  562. </td>
  563. </tr>
  564. </table>
  565. </blockquote>
  566. </td></tr>
  567. </table>
  568. </a>
  569. <a name="shell-redirect-1">
  570. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  571. <tr><td bgcolor="#828DA6">
  572. <font color="#ffffff" face="arial,helvetica,sanserif">
  573. <strong>
  574. How do I include a &lt; character in my command line arguments?
  575. </strong>
  576. </font>
  577. </td></tr>
  578. <tr><td>
  579. <blockquote>
  580. <p>The short answer is "Use <code>&amp;lt;</code>".</p>
  581. <p>The long answer is, that this probably won't do what you
  582. want anyway, see <a href="#shell-redirect-2">the next
  583. section</a>.</p>
  584. </blockquote>
  585. </td></tr>
  586. </table>
  587. </a>
  588. <a name="shell-redirect-2">
  589. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  590. <tr><td bgcolor="#828DA6">
  591. <font color="#ffffff" face="arial,helvetica,sanserif">
  592. <strong>
  593. How do I redirect standard input or standard output
  594. in the <code>&lt;exec&gt;</code> task?
  595. </strong>
  596. </font>
  597. </td></tr>
  598. <tr><td>
  599. <blockquote>
  600. <p>Say you want to redirect the standard input stream of the
  601. <code>cat</code> command to read from a file, something
  602. like</p>
  603. <div align="left">
  604. <table cellspacing="4" cellpadding="0" border="0">
  605. <tr>
  606. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  607. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  608. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  609. </tr>
  610. <tr>
  611. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  612. <td bgcolor="#ffffff"><pre>
  613. shell-prompt&gt; cat &lt; foo
  614. </pre></td>
  615. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  616. </tr>
  617. <tr>
  618. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  619. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  620. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  621. </tr>
  622. </table>
  623. </div>
  624. <p>and try to translate it into</p>
  625. <div align="left">
  626. <table cellspacing="4" cellpadding="0" border="0">
  627. <tr>
  628. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  629. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  630. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  631. </tr>
  632. <tr>
  633. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  634. <td bgcolor="#ffffff"><pre>
  635. &lt;exec executable=&quot;cat&quot;&gt;
  636. &lt;arg value=&quot;&amp;lt;&quot; /&gt;
  637. &lt;arg value=&quot;foo&quot; /&gt;
  638. &lt;/exec&gt;
  639. </pre></td>
  640. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  641. </tr>
  642. <tr>
  643. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  644. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  645. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  646. </tr>
  647. </table>
  648. </div>
  649. <p>This will not do what you expect. The input-redirection is
  650. performed by your shell, not the command itself, so this
  651. should read:</p>
  652. <div align="left">
  653. <table cellspacing="4" cellpadding="0" border="0">
  654. <tr>
  655. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  656. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  657. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  658. </tr>
  659. <tr>
  660. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  661. <td bgcolor="#ffffff"><pre>
  662. &lt;exec executable=&quot;/bin/sh&quot;&gt;
  663. &lt;arg value=&quot;-c&quot; /&gt;
  664. &lt;arg value=&quot;cat &amp;lt; foo&quot; /&gt;
  665. &lt;/exec&gt;
  666. </pre></td>
  667. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  668. </tr>
  669. <tr>
  670. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  671. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  672. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  673. </tr>
  674. </table>
  675. </div>
  676. <p>Note, that you must use the <code>value</code> attribute of
  677. <code>&lt;arg&gt;</code> in the last element.</p>
  678. </blockquote>
  679. </td></tr>
  680. </table>
  681. </a>
  682. <a name="integration">
  683. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  684. <tr><td bgcolor="#828DA6">
  685. <font color="#ffffff" face="arial,helvetica,sanserif">
  686. <strong>
  687. Is Ant supported by my IDE/Editor?
  688. </strong>
  689. </font>
  690. </td></tr>
  691. <tr><td>
  692. <blockquote>
  693. <p>See the <a href="external.html#IDE and Editor Integration">section
  694. on IDE integration</a> on our external tools page.</p>
  695. </blockquote>
  696. </td></tr>
  697. </table>
  698. </a>
  699. <a name="emacs-mode">
  700. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  701. <tr><td bgcolor="#828DA6">
  702. <font color="#ffffff" face="arial,helvetica,sanserif">
  703. <strong>
  704. Why doesn't (X)Emacs/vi/MacOS X's project builder
  705. parse the error messages generated by Ant correctly?
  706. </strong>
  707. </font>
  708. </td></tr>
  709. <tr><td>
  710. <blockquote>
  711. <p>Ant adds a "banner" with the name of the current
  712. task in front of all messages - and there are no built-in
  713. regular expressions in your Editor that would account for
  714. this.</p>
  715. <p>You can disable this banner by invoking Ant with the
  716. <code>-emacs</code> switch. Alternatively you can add the
  717. following snippet to your <code>.emacs</code> to make Emacs
  718. understand Ant's output.</p>
  719. <div align="left">
  720. <table cellspacing="4" cellpadding="0" border="0">
  721. <tr>
  722. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  723. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  724. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  725. </tr>
  726. <tr>
  727. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  728. <td bgcolor="#ffffff"><pre>
  729. (require 'compile)
  730. (setq compilation-error-regexp-alist
  731. (append (list
  732. ;; works for jikes
  733. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:&quot; 1 2 3)
  734. ;; works for javac
  735. '(&quot;^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):&quot; 1 2))
  736. compilation-error-regexp-alist))
  737. </pre></td>
  738. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  739. </tr>
  740. <tr>
  741. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  742. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  743. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  744. </tr>
  745. </table>
  746. </div>
  747. <p>Yet another alternative that preserves most of Ant's
  748. formatting is to pipe Ant's output through the following Perl
  749. script by Dirk-Willem van Gulik:</p>
  750. <div align="left">
  751. <table cellspacing="4" cellpadding="0" border="0">
  752. <tr>
  753. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  754. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  755. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  756. </tr>
  757. <tr>
  758. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  759. <td bgcolor="#ffffff"><pre>
  760. #!/usr/bin/perl
  761. #
  762. # May 2001 dirkx@apache.org - remove any
  763. # [foo] lines from the output; keeping
  764. # spacing more or less there.
  765. #
  766. $|=1;
  767. while(&lt;STDIN&gt;) {
  768. if (s/^(\s+)\[(\w+)\]//) {
  769. if ($2 ne $last) {
  770. print &quot;$1\[$2\]&quot;;
  771. $s = ' ' x length($2);
  772. } else {
  773. print &quot;$1 $s &quot;;
  774. };
  775. $last = $2;
  776. };
  777. print;
  778. };
  779. </pre></td>
  780. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  781. </tr>
  782. <tr>
  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. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  785. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  786. </tr>
  787. </table>
  788. </div>
  789. </blockquote>
  790. </td></tr>
  791. </table>
  792. </a>
  793. <a name="dtd">
  794. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  795. <tr><td bgcolor="#828DA6">
  796. <font color="#ffffff" face="arial,helvetica,sanserif">
  797. <strong>
  798. Is there a DTD that I can use to validate my build
  799. files?
  800. </strong>
  801. </font>
  802. </td></tr>
  803. <tr><td>
  804. <blockquote>
  805. <p>An incomplete DTD can be created by the
  806. <code>&lt;antstructure&gt;</code> task - but this one
  807. has a few problems:</p>
  808. <ul>
  809. <li>It doesn't know about required attributes. Only
  810. manual tweaking of this file can help here.</li>
  811. <li>It is not complete - if you add new tasks via
  812. <code>&lt;taskdef&gt;</code> it won't know about it. See
  813. <a href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html">this
  814. page</a> by Michel Casabianca for a solution to this
  815. problem. Note that the DTD you can download at this page
  816. is based on Ant 0.3.1.</li>
  817. <li>It may even be an invalid DTD. As Ant allows tasks
  818. writers to define arbitrary elements, name collisions will
  819. happen quite frequently - if your version of Ant contains
  820. the optional <code>&lt;test&gt;</code> and
  821. <code>&lt;junit&gt;</code> tasks, there are two XML
  822. elements named test (the task and the nested child element
  823. of <code>&lt;junit&gt;</code>) with different attribute
  824. lists. This problem cannot be solved, DTDs don't give a
  825. syntax rich enough to support this.</li>
  826. </ul>
  827. </blockquote>
  828. </td></tr>
  829. </table>
  830. </a>
  831. <a name="xml-entity-include">
  832. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  833. <tr><td bgcolor="#828DA6">
  834. <font color="#ffffff" face="arial,helvetica,sanserif">
  835. <strong>
  836. How do I include an XML snippet in my build file?
  837. </strong>
  838. </font>
  839. </td></tr>
  840. <tr><td>
  841. <blockquote>
  842. <p>You can use XML's way of including external files and let
  843. the parser do the job for Ant:</p>
  844. <div align="left">
  845. <table cellspacing="4" cellpadding="0" border="0">
  846. <tr>
  847. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  848. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  849. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  850. </tr>
  851. <tr>
  852. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  853. <td bgcolor="#ffffff"><pre>
  854. &lt;?xml version=&quot;1.0&quot;?&gt;
  855. &lt;!DOCTYPE project [
  856. &lt;!ENTITY common SYSTEM &quot;file:./common.xml&quot;&gt;
  857. ]&gt;
  858. &lt;project name=&quot;test&quot; default=&quot;test&quot; basedir=&quot;.&quot;&gt;
  859. &lt;target name=&quot;setup&quot;&gt;
  860. ...
  861. &lt;/target&gt;
  862. &amp;common;
  863. ...
  864. &lt;/project&gt;
  865. </pre></td>
  866. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  867. </tr>
  868. <tr>
  869. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  870. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  871. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  872. </tr>
  873. </table>
  874. </div>
  875. <p>will literally include the contents of <code>common.xml</code> where
  876. you've placed the <code>&amp;common;</code> entity.</p>
  877. <p>In combination with a DTD, this would look like this:</p>
  878. <div align="left">
  879. <table cellspacing="4" cellpadding="0" border="0">
  880. <tr>
  881. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  882. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  883. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  884. </tr>
  885. <tr>
  886. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  887. <td bgcolor="#ffffff"><pre>
  888. &lt;!DOCTYPE project PUBLIC &quot;-//ANT//DTD project//EN&quot; &quot;file:./ant.dtd&quot; [
  889. &lt;!ENTITY include SYSTEM &quot;file:./header.xml&quot;&gt;
  890. ]&gt;
  891. </pre></td>
  892. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  893. </tr>
  894. <tr>
  895. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  896. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  897. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  898. </tr>
  899. </table>
  900. </div>
  901. </blockquote>
  902. </td></tr>
  903. </table>
  904. </a>
  905. <a name="mail-logger">
  906. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  907. <tr><td bgcolor="#828DA6">
  908. <font color="#ffffff" face="arial,helvetica,sanserif">
  909. <strong>
  910. How do I send an email with the result of my build
  911. process?
  912. </strong>
  913. </font>
  914. </td></tr>
  915. <tr><td>
  916. <blockquote>
  917. <p>You can use a custom BuildListener, that sends out an email
  918. in the buildFinished() method. Will Glozer
  919. &lt;will.glozer@jda.com&gt; has written such a listener based
  920. on <a href="http://java.sun.com/products/javamail/">JavaMail</a>,
  921. the source is</p>
  922. <div align="left">
  923. <table cellspacing="4" cellpadding="0" border="0">
  924. <tr>
  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. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  927. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  928. </tr>
  929. <tr>
  930. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  931. <td bgcolor="#ffffff"><pre>
  932. import java.io.*;
  933. import java.util.*;
  934. import javax.mail.*;
  935. import javax.mail.internet.*;
  936. import org.apache.tools.ant.*;
  937. /**
  938. * A simple listener that waits for a build to finish and sends an email
  939. * of the results. The settings are stored in &quot;monitor.properties&quot; and
  940. * are fairly self explanatory.
  941. *
  942. * @author Will Glozer
  943. * @version 1.05a 09/06/2000
  944. */
  945. public class BuildMonitor implements BuildListener {
  946. protected Properties props;
  947. /**
  948. * Create a new BuildMonitor.
  949. */
  950. public BuildMonitor() throws Exception {
  951. props = new Properties();
  952. InputStream is = getClass().getResourceAsStream(&quot;monitor.properties&quot;);
  953. props.load(is);
  954. is.close();
  955. }
  956. public void buildStarted(BuildEvent e) {
  957. }
  958. /**
  959. * Determine the status of the build and the actions to follow, now that
  960. * the build has completed.
  961. *
  962. * @param e Event describing the build tatus.
  963. */
  964. public void buildFinished(BuildEvent e) {
  965. Throwable th = e.getException();
  966. String status = (th != null) ? &quot;failed&quot; : &quot;succeeded&quot;;
  967. try {
  968. String key = &quot;build.&quot; + status;
  969. if (props.getProperty(key + &quot;.notify&quot;).equalsIgnoreCase(&quot;false&quot;)) {
  970. return;
  971. }
  972. Session session = Session.getDefaultInstance(props, null);
  973. MimeMessage message = new MimeMessage(session);
  974. message.addRecipients(Message.RecipientType.TO, parseAddresses(
  975. props.getProperty(key + &quot;.email.to&quot;)));
  976. message.setSubject(props.getProperty(key + &quot;.email.subject&quot;));
  977. BufferedReader br = new BufferedReader(new FileReader(
  978. props.getProperty(&quot;build.log&quot;)));
  979. StringWriter sw = new StringWriter();
  980. String line = br.readLine();
  981. while (line != null) {
  982. sw.write(line);
  983. sw.write(&quot;\n&quot;);
  984. line = br.readLine();
  985. }
  986. br.close();
  987. message.setText(sw.toString(), &quot;UTF-8&quot;);
  988. sw.close();
  989. Transport transport = session.getTransport();
  990. transport.connect();
  991. transport.send(message);
  992. transport.close();
  993. } catch (Exception ex) {
  994. System.out.println(&quot;BuildMonitor failed to send email!&quot;);
  995. ex.printStackTrace();
  996. }
  997. }
  998. /**
  999. * Parse a comma separated list of internet email addresses.
  1000. *
  1001. * @param s The list of addresses.
  1002. * @return Array of Addresses.
  1003. */
  1004. protected Address[] parseAddresses(String s) throws Exception {
  1005. StringTokenizer st = new StringTokenizer(s, &quot;,&quot;);
  1006. Address[] addrs = new Address[st.countTokens()];
  1007. for (int i = 0; i &lt; addrs.length; i++) {
  1008. addrs[i] = new InternetAddress(st.nextToken());
  1009. }
  1010. return addrs;
  1011. }
  1012. public void messageLogged(BuildEvent e) {
  1013. }
  1014. public void targetStarted(BuildEvent e) {
  1015. }
  1016. public void targetFinished(BuildEvent e) {
  1017. }
  1018. public void taskStarted(BuildEvent e) {
  1019. }
  1020. public void taskFinished(BuildEvent e) {
  1021. }
  1022. }
  1023. </pre></td>
  1024. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1025. </tr>
  1026. <tr>
  1027. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1028. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1029. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1030. </tr>
  1031. </table>
  1032. </div>
  1033. <p>With a <code>monitor.properties</code> like this</p>
  1034. <div align="left">
  1035. <table cellspacing="4" cellpadding="0" border="0">
  1036. <tr>
  1037. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1038. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1039. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1040. </tr>
  1041. <tr>
  1042. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1043. <td bgcolor="#ffffff"><pre>
  1044. # configuration for build monitor
  1045. mail.transport.protocol=smtp
  1046. mail.smtp.host=&lt;host&gt;
  1047. mail.from=Will Glozer &lt;will.glozer@jda.com&gt;
  1048. build.log=build.log
  1049. build.failed.notify=true
  1050. build.failed.email.to=will.glozer@jda.com
  1051. build.failed.email.subject=Nightly build failed!
  1052. build.succeeded.notify=true
  1053. build.succeeded.email.to=will.glozer@jda.com
  1054. build.succeeded.email.subject=Nightly build succeeded!
  1055. </pre></td>
  1056. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1057. </tr>
  1058. <tr>
  1059. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1060. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1061. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1062. </tr>
  1063. </table>
  1064. </div>
  1065. <p><code>monitor.properties</code> should be placed right next
  1066. to your compiled <code>BuildMonitor.class</code>. To use it,
  1067. invoke Ant like</p>
  1068. <div align="left">
  1069. <table cellspacing="4" cellpadding="0" border="0">
  1070. <tr>
  1071. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1072. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1073. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1074. </tr>
  1075. <tr>
  1076. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1077. <td bgcolor="#ffffff"><pre>
  1078. ant -listener BuildMonitor
  1079. </pre></td>
  1080. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1081. </tr>
  1082. <tr>
  1083. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1084. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1085. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1086. </tr>
  1087. </table>
  1088. </div>
  1089. <p>Make sure that <code>mail.jar</code> from JavaMail and
  1090. <code>activation.jar</code> from the
  1091. <a href="http://java.sun.com/products/javabeans/glasgow/jaf.html">Java
  1092. Beans Activation Framework</a> in your <code>CLASSPATH</code>.</p>
  1093. </blockquote>
  1094. </td></tr>
  1095. </table>
  1096. </a>
  1097. <a name="remove-cr">
  1098. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1099. <tr><td bgcolor="#828DA6">
  1100. <font color="#ffffff" face="arial,helvetica,sanserif">
  1101. <strong>
  1102. &lt;chmod&gt; or &lt;exec&gt; don't work in Ant
  1103. 1.3 on Unix
  1104. </strong>
  1105. </font>
  1106. </td></tr>
  1107. <tr><td>
  1108. <blockquote>
  1109. <p>The <code>antRun</code> script in <code>ANT_HOME/bin</code>
  1110. has DOS instead of Unix line endings, you must remove the
  1111. carriage return characters from this file. This can be done by
  1112. using Ant's &lt;fixcrlf&gt; task or something like:</p>
  1113. <div align="left">
  1114. <table cellspacing="4" cellpadding="0" border="0">
  1115. <tr>
  1116. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1117. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1118. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1119. </tr>
  1120. <tr>
  1121. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1122. <td bgcolor="#ffffff"><pre>
  1123. tr -d '\r' &lt; $ANT_HOME/bin/antRun &gt; /tmp/foo
  1124. mv /tmp/foo $ANT_HOME/bin/antRun
  1125. </pre></td>
  1126. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1127. </tr>
  1128. <tr>
  1129. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1130. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1131. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  1132. </tr>
  1133. </table>
  1134. </div>
  1135. </blockquote>
  1136. </td></tr>
  1137. </table>
  1138. </a>
  1139. <a name="javadoc-cannot-execute">
  1140. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  1141. <tr><td bgcolor="#828DA6">
  1142. <font color="#ffffff" face="arial,helvetica,sanserif">
  1143. <strong>
  1144. JavaDoc failed: java.io.IOException: javadoc: cannot execute
  1145. </strong>
  1146. </font>
  1147. </td></tr>
  1148. <tr><td>
  1149. <blockquote>
  1150. <p>There is a bug in the Solaris reference implementation of
  1151. 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>.
  1152. This also appears to be true under Linux, moving the JDK to
  1153. the front of the PATH fixes the problem.</p>
  1154. </blockquote>
  1155. </td></tr>
  1156. </table>
  1157. </a>
  1158. </blockquote>
  1159. </td></tr>
  1160. </table>
  1161. </td>
  1162. </tr>
  1163. <!-- FOOTER -->
  1164. <tr><td colspan="2">
  1165. <hr noshade="" size="1"/>
  1166. </td></tr>
  1167. <tr><td colspan="2">
  1168. <div align="center"><font color="#525D76" size="-1"><em>
  1169. Copyright &#169; 1999-2001, Apache Software Foundation
  1170. </em></font></div>
  1171. </td></tr>
  1172. </table>
  1173. </body>
  1174. </html>
  1175. <!-- end the processing -->