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 49 KiB

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