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 24 kB

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