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.

problems.html 21 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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="Conor MacNeill">
  8. <meta name="email" value="conor@apache.org">
  9. <title>Apache Ant - Having Problems?</title>
  10. </head>
  11. <body bgcolor="#ffffff" text="#000000" link="#525D76">
  12. <table border="0" width="100%" cellspacing="0">
  13. <!-- TOP IMAGE -->
  14. <tr>
  15. <td colspan="2">
  16. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
  17. </td>
  18. </tr>
  19. </table>
  20. <table border="0" width="100%" cellspacing="4">
  21. <tr><td colspan="2">
  22. <hr noshade="" size="1"/>
  23. </td></tr>
  24. <tr>
  25. <!-- LEFT SIDE NAVIGATION -->
  26. <td valign="top" nowrap="true">
  27. <p><strong>Apache Ant</strong></p>
  28. <ul>
  29. <li> <a href="./index.html">Front Page</a>
  30. </li>
  31. <li> <a href="./antnews.html">News</a>
  32. </li>
  33. <li> <a href="./manual/index.html">Documentation</a>
  34. </li>
  35. <li> <a href="./projects.html">Related Projects</a>
  36. </li>
  37. <li> <a href="./external.html">External Tools and Tasks</a>
  38. </li>
  39. <li> <a href="./resources.html">Resources</a>
  40. </li>
  41. <li> <a href="./faq.html">Ant FAQ</a>
  42. </li>
  43. <li> <a href="./problems.html">Having Problems?</a>
  44. </li>
  45. </ul>
  46. <p><strong>Download</strong></p>
  47. <ul>
  48. <li> <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
  49. </li>
  50. <li> <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
  51. </li>
  52. </ul>
  53. <p><strong>Jakarta</strong></p>
  54. <ul>
  55. <li> <a href="http://jakarta.apache.org/site/news.html">News & Status</a>
  56. </li>
  57. <li> <a href="http://jakarta.apache.org/site/mission.html">Mission</a>
  58. </li>
  59. <li> <a href="http://jakarta.apache.org/site/guidelines.html">Guidelines Notes</a>
  60. </li>
  61. <li> <a href="http://jakarta.apache.org/site/faqs.html">FAQs</a>
  62. </li>
  63. </ul>
  64. <p><strong>Get Involved</strong></p>
  65. <ul>
  66. <li> <a href="http://jakarta.apache.org/site/getinvolved.html">Overview</a>
  67. </li>
  68. <li> <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
  69. </li>
  70. <li> <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
  71. </li>
  72. <li> <a href="http://jakarta.apache.org/site/library.html">Reference Library</a>
  73. </li>
  74. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant">Bug Database</a>
  75. </li>
  76. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant&bug_severity=Enhancement">Enhancement Requests</a>
  77. </li>
  78. </ul>
  79. </td>
  80. <td align="left" valign="top">
  81. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  82. <tr><td bgcolor="#525D76">
  83. <font color="#ffffff" face="arial,helvetica,sanserif">
  84. <a name="Having problems?"><strong>Having problems?</strong></a>
  85. </font>
  86. </td></tr>
  87. <tr><td>
  88. <blockquote>
  89. <p>This page details some steps you can take to try and resolve
  90. any problems you may be having with Ant. If you find you can't
  91. resolve the problem, then this page will help you collect some of
  92. the relevant information to provide in a bug report. This information
  93. will help the Ant developers understand and resolve the problem.
  94. Of course, not all the steps here will make sense for every problem
  95. you may encounter &ndash; these are just some suggestions to point
  96. you in the right direction.
  97. </p>
  98. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  99. <tr><td bgcolor="#828DA6">
  100. <font color="#ffffff" face="arial,helvetica,sanserif">
  101. <a name="Read the Manual"><strong>Read the Manual</strong></a>
  102. </font>
  103. </td></tr>
  104. <tr><td>
  105. <blockquote>
  106. <p>The first step to take when you have a problem with Ant is to read
  107. the <a href="manual/index.html">manual</a> entry for the task or
  108. concept that is giving you trouble. In particular, check the
  109. meaning of a task's attributes and nested elements. Perhaps an
  110. attribute is available that would provide the behavior you require.
  111. If you have problems with the manual itself, you can submit a
  112. documentation bug report (see below) to help us improve the Ant
  113. documentation.
  114. </p>
  115. </blockquote>
  116. </td></tr>
  117. </table>
  118. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  119. <tr><td bgcolor="#828DA6">
  120. <font color="#ffffff" face="arial,helvetica,sanserif">
  121. <a name="Examine Debug Output"><strong>Examine Debug Output</strong></a>
  122. </font>
  123. </td></tr>
  124. <tr><td>
  125. <blockquote>
  126. <p>If you're still having a problem, the next step is to try and
  127. gather additional information about what Ant is doing.
  128. Try running Ant with the <code>verbose</code> flag:<br><br>
  129. <font face="verdana" size="-1">ant -verbose</font><br><br>
  130. or<br><br>
  131. <font face="verdana" size="-1">ant -v</font><br><br>
  132. This will produce output that starts like the following:</p>
  133. <div align="left">
  134. <table cellspacing="4" cellpadding="0" border="0">
  135. <tr>
  136. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  137. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  138. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  139. </tr>
  140. <tr>
  141. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  142. <td bgcolor="#ffffff">
  143. <font face="verdana" size="-1">
  144. Ant version 1.4.1 compiled on October 11 2001<br>
  145. Buildfile: build.xml<br>
  146. Detected Java version: 1.3 in: D:\usr\local\java\jdk13\jre<br>
  147. Detected OS: Windows NT<br>
  148. parsing buildfile D:\ant\build.xml
  149. with URI = file:D:/ant/build.xml<br>
  150. Project base dir set to: D:\ant<br>
  151. &nbsp;[property] Loading Environment env.<br>
  152. &nbsp;[property] Loading D:\ant\conf.properties<br>
  153. Build sequence for target &#39;debug&#39; is [debug]<br>
  154. Complete build sequence is [debug, gensrc, compile, jar, test]<br>
  155. . . .<br>
  156. </font>
  157. </td>
  158. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  159. </tr>
  160. <tr>
  161. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  162. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  163. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  164. </tr>
  165. </table>
  166. </div>
  167. <p>You should be able to see from the trace more about what Ant
  168. is doing and why it's taking a particular course of action.
  169. If you need even more information, you can use the
  170. <code>&#x2011;debug</code> flag rather than
  171. <code>&#x2011;verbose</code>.
  172. This will generally produce so much
  173. output that you may want to save the output to a file and
  174. analyze it in an editor. You can save the output using the
  175. <code>&#x2011;logfile&nbsp;&lt;filename&gt;</code> flag, or using
  176. redirection.
  177. </p>
  178. <p>Once you have all this debug information, how can you use it
  179. to solve your problem? That will depend on the task in question
  180. and the nature of your problem. Each task logs different aspects
  181. of its operation, but it should give you an idea of what is going
  182. on. For example, the &lt;javac&gt; task logs the reasons why it
  183. chooses to compile particular class files and not others, along
  184. with which compiler it is using and the arguments it will pass
  185. to that compiler. The following partial trace shows why
  186. &lt;javac&gt; is adding one class file but skipping another.
  187. This is followed by which compiler it will be using, the
  188. arguments that will get passed to the compiler,
  189. and a list of all the class files to be compiled.
  190. </p>
  191. <div align="left">
  192. <table cellspacing="4" cellpadding="0" border="0">
  193. <tr>
  194. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  195. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  196. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  197. </tr>
  198. <tr>
  199. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  200. <td bgcolor="#ffffff">
  201. <font face="verdana" size="-1">
  202. [javac] Test.java omitted as D:\classes\Test.class is up to date.<br>
  203. [javac] Unset.java added as D:\classes\Unset.class is outdated.<br>
  204. [javac] Compiling 1 source file to D:\classes<br>
  205. [javac] Using classic compiler<br>
  206. [javac] Compilation args: -d D:\classes -classpath D:\classes;<br>
  207. D:\jdk118\classes.zip; -sourcepath D:\src\java -g:none<br>
  208. [javac] File to be compiled:<br>
  209. D:\src\java\Unset.java<br>
  210. </font>
  211. </td>
  212. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  213. </tr>
  214. <tr>
  215. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  216. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  217. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  218. </tr>
  219. </table>
  220. </div>
  221. <p>In many cases, Ant tasks are wrappers around OS commands or
  222. other Java classes. In debug mode, many of these tasks will
  223. print out the equivalent command line, as the &lt;javac&gt; task
  224. output does. If you are having a problem, it is often useful to
  225. run the command directly from the command line, in the same way
  226. Ant is running it, and see if the problem occurs from there
  227. as well. The problem may be in the command that is being run,
  228. or it may be in the way the Ant task is running the command.
  229. You can also see the effect of changing attribute values on the
  230. generated command line. This can help you to understand whether
  231. you are using the correct attributes and values.
  232. </p>
  233. </blockquote>
  234. </td></tr>
  235. </table>
  236. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  237. <tr><td bgcolor="#828DA6">
  238. <font color="#ffffff" face="arial,helvetica,sanserif">
  239. <a name="Has it been fixed?"><strong>Has it been fixed?</strong></a>
  240. </font>
  241. </td></tr>
  242. <tr><td>
  243. <blockquote>
  244. <p>After examining the debug output, if you still believe that the
  245. problem you are having is caused by Ant, chances are that someone
  246. else may have already encountered this problem, and perhaps it has
  247. been fixed. The next step, therefore, may be to try a nightly build
  248. of Ant to see if the problem has been fixed. Nightly builds for Ant
  249. are available from the
  250. <a href="http://www.apache.org/dist/jakarta/jakarta-ant/nightly/">
  251. Jakarta web site</a>. While Ant nightly builds are typically quite
  252. stable and are used by
  253. <a href="http://www.apache.org/dist/jakarta/gump/latest/">Gump</a>
  254. to build many other Jakarta projects, these builds should
  255. nonetheless be treated as experimental. Note that nightly builds
  256. do not build many of the optional tasks the come with Ant.
  257. A snapshot of these optional tasks is occasionally uploaded to
  258. the nightly download
  259. <a href="http://www.apache.org/dist/jakarta/jakarta-ant/nightly/optional/">
  260. area</a>. However, even this snapshot does not contain every
  261. optional task.
  262. </p>
  263. </blockquote>
  264. </td></tr>
  265. </table>
  266. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  267. <tr><td bgcolor="#828DA6">
  268. <font color="#ffffff" face="arial,helvetica,sanserif">
  269. <a name="Has it been reported?"><strong>Has it been reported?</strong></a>
  270. </font>
  271. </td></tr>
  272. <tr><td>
  273. <blockquote>
  274. <p>If the current nightly build doesn't resolve your problem, it is
  275. possible that someone else has reported the issue. It is time to
  276. look at the <a href="http://nagoya.apache.org/bugzilla/">
  277. Apache Bug Database</a>. This system is easy to use, and it will
  278. let you search the <a href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Ant&amp;short_desc=&amp;short_desc_type=substring&amp;long_desc=&amp;long_desc_type=substring&amp;bug_file_loc=&amp;bug_file_loc_type=substring&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.bug_id">
  279. currently open</a> and resolved bugs to see if your problem has
  280. already been reported. If your problem has been reported, you can
  281. see whether any of the developers have commented, suggesting
  282. workarounds, or the reason for the bug, etc. Or you may have
  283. information to add (see about creating and modifying bug reports
  284. below), in which case, go right ahead and add the information.
  285. If you don't have any additional information, you may just want
  286. to vote for this bug, and perhaps
  287. add yourself to the <code>CC</code> list to follow the progress
  288. of this bug.
  289. </p>
  290. </blockquote>
  291. </td></tr>
  292. </table>
  293. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  294. <tr><td bgcolor="#828DA6">
  295. <font color="#ffffff" face="arial,helvetica,sanserif">
  296. <a name="Filing a Bug Report"><strong>Filing a Bug Report</strong></a>
  297. </font>
  298. </td></tr>
  299. <tr><td>
  300. <blockquote>
  301. <p>By this time, you may have decided that there is an unreported
  302. bug in Ant. You have a few choices at this point. You can send
  303. an email to the <code>ant-user</code> mailing list to see if
  304. others have encountered your issue and find out how they may
  305. have worked around it. If after some discussion, you feel it
  306. is time to create
  307. a bug report, this is a simple operation in the bug database.
  308. Please try to provide as much information as possible in order
  309. to assist the developers in resolving the bug. Please try to enter
  310. correct values for the various inputs when creating the bug, such
  311. as which version of Ant you are running, and on which platform,
  312. etc. Once the bug is created, you can also add attachments to
  313. the bug report.
  314. </p>
  315. <p>What information should you include in your bug report? The
  316. easiest bugs to fix are those that are most easily reproducible,
  317. so it is really helpful if you can produce a small test case that
  318. exhibits the problem. In this case, you would attach the build file
  319. and any other files necessary to reproduce the problem, probably
  320. packed together in an archive. If you can't produce a test case,
  321. you should try to include a snippet from your build file and the
  322. relevant sections from the verbose or debug output from Ant. Try
  323. to include the header information where Ant states the version,
  324. the OS and VM information, etc. As debug output is likely to be
  325. very large, it's best to remove any output that is not
  326. relevant. Once the bug is entered into the bug database, you
  327. will be kept informed by email about progress on the bug. If
  328. you receive email asking for further information, please try to
  329. respond, as it will aid in the resolution of your bug.
  330. </p>
  331. </blockquote>
  332. </td></tr>
  333. </table>
  334. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  335. <tr><td bgcolor="#828DA6">
  336. <font color="#ffffff" face="arial,helvetica,sanserif">
  337. <a name="Asking for an Enhancement"><strong>Asking for an Enhancement</strong></a>
  338. </font>
  339. </td></tr>
  340. <tr><td>
  341. <blockquote>
  342. <p>Sometimes, you may find that Ant just doesn't do what you need it
  343. to. It isn't a bug, as such, since Ant is working the way it is
  344. supposed to work. Perhaps it is some additional functionality for
  345. a task that hasn't been thought of yet, or maybe a completely new
  346. task. For these situations, you will
  347. want to raise an <i>enhancement request</i>. Enhancement requests
  348. are managed using the same Apache Bug Database described above.
  349. These are just a different type of bug report. If you look in the
  350. bug database, you will see that one of the severity settings for
  351. a bug is &quot;Enhancement&quot;. Just fill the bug report in,
  352. set the severity of the bug to &quot;Enhancement&quot;, and
  353. state in the description how you would like to have Ant enhanced.
  354. Again, you should first check whether there are any existing
  355. enhancment requests that cover your needs. If so, just add your
  356. vote to these.
  357. </p>
  358. </blockquote>
  359. </td></tr>
  360. </table>
  361. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  362. <tr><td bgcolor="#828DA6">
  363. <font color="#ffffff" face="arial,helvetica,sanserif">
  364. <a name="Fixing the Bug"><strong>Fixing the Bug</strong></a>
  365. </font>
  366. </td></tr>
  367. <tr><td>
  368. <blockquote>
  369. <p>If you aren't satisfied with just filing a bug report, you can
  370. try to find the cause of the problem and provide a fix yourself.
  371. The best way to do that is by working with the latest code from CVS.
  372. Alternatively, you can work with the source code available from the
  373. <a href="http://jakarta.apache.org/builds/jakarta-ant/release/v1.4.1/src/">
  374. source distributions</a>. If you
  375. are going to tackle the problem at this level, you may want to
  376. discuss some details first on the <code>ant-dev</code> mailing
  377. list. Once you have a fix for the problem, you may submit
  378. the fix as a <i>patch</i> to either the <code>ant-dev</code> mailing
  379. list, or enter the bug database as described above and attach the
  380. patch to the bug report. Using the bug database has the advantage
  381. of being able to track the progress of your patch.
  382. </p>
  383. <p>If you have a patch to submit and are sending it to the
  384. <code>ant-dev</code> mailing list, prefix &quot;[PATCH]&quot;
  385. to your message subject. Please include any relevant bug numbers.
  386. Patch files should be created with the <code>&#x2011;u</code>
  387. option of the
  388. <code>diff</code> or <code>cvs diff</code> command. For
  389. example:<br><br>
  390. <font face="verdana" size="-1">
  391. diff -u Javac.java.orig Javac.java &gt; javac.diffs<br><br>
  392. </font>
  393. or, if you have source from CVS:<br><br>
  394. <font face="verdana" size="-1">
  395. cvs diff -u Javac.java &gt; javac.diffs<br><br>
  396. Note: You should give your patch files meaningful names.
  397. This makes it easier for developers who need to apply a number
  398. of different patch files.
  399. </blockquote>
  400. </td></tr>
  401. </table>
  402. </blockquote>
  403. </td></tr>
  404. </table>
  405. </td></tr>
  406. <!-- FOOTER -->
  407. <tr><td colspan="2">
  408. <hr noshade="" size="1"/>
  409. </td></tr>
  410. <tr><td colspan="2">
  411. <div align="center"><font color="#525D76" size="-1">
  412. <em>Copyright &#169; 2000-2002, Apache Software Foundation</em>
  413. </font></div>
  414. </td></tr>
  415. </table>
  416. </body>
  417. </html>
  418. <!-- end the processing -->