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

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