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.xml 14 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <?xml version="1.0"?>
  2. <document>
  3. <properties>
  4. <author email="">Conor MacNeill</author>
  5. <title>Having Problems?</title>
  6. </properties>
  7. <body>
  8. <section name="Having Problems?">
  9. <p>
  10. This page details some steps you can take to try and resolve
  11. any problems you may be having with Ant. If you find you can't
  12. resolve the problem, then this page will help you collect some of
  13. the relevant information to provide in a bug report. This information
  14. will help the Ant developers understand and resolve the problem.
  15. Of course, not all the steps here will make sense for every problem
  16. you may encounter - these are just some suggestions to point
  17. you in the right direction.
  18. </p>
  19. <subsection name="Read the Manual">
  20. <p>
  21. The first step to take when you have a problem with Ant is to read
  22. the <a href="manual/index.html">manual</a> entry for the task or
  23. concept that is giving you trouble. In particular, check the
  24. meaning of a task's attributes and nested elements. Perhaps an
  25. attribute is available that would provide the behavior you require.
  26. If you have problems with the manual itself, you can submit a
  27. documentation bug report (see below) to help us improve the Ant
  28. documentation.
  29. </p>
  30. </subsection>
  31. <subsection name="Examine Debug Output">
  32. <p>
  33. If you're still having a problem, the next step is to try and
  34. gather additional information about what Ant is doing.
  35. Try running Ant with the <code>verbose</code> flag:
  36. <br></br><br></br>
  37. <font face="verdana" size="-1">ant -verbose</font>
  38. <br></br><br></br>
  39. or
  40. <br></br><br></br>
  41. <font face="verdana" size="-1">ant -v</font>
  42. <br></br><br></br>
  43. This will produce output that starts like the following:</p>
  44. <table>
  45. <tr>
  46. <td>
  47. Ant version 1.4.1 compiled on October 11 2001<br></br>
  48. Buildfile: build.xml<br></br>
  49. Detected Java version: 1.3 in: D:\usr\local\java\jdk13\jre<br></br>
  50. Detected OS: Windows NT<br></br>
  51. parsing buildfile D:\ant\build.xml
  52. with URI = file:D:/ant/build.xml<br></br>
  53. Project base dir set to: D:\ant<br></br>
  54. &#160;&#160;[property] Loading Environment env.<br></br>
  55. &#160;&#160;[property] Loading D:\ant\conf.properties<br></br>
  56. Build sequence for target &#39;debug&#39; is [debug]<br></br>
  57. Complete build sequence is [debug, gensrc, compile, jar, test]<br></br>
  58. . . .<br></br>
  59. </td>
  60. </tr>
  61. </table>
  62. <p>
  63. You should be able to see from the trace more about what Ant
  64. is doing and why it's taking a particular course of action.
  65. If you need even more information, you can use the
  66. <code>-debug</code> flag rather than
  67. <code>-verbose</code>.
  68. This will generally produce so much
  69. output that you may want to save the output to a file and
  70. analyze it in an editor. You can save the output using the
  71. <code>-logfile &lt;filename&gt;</code> flag, or
  72. using redirection.
  73. </p>
  74. <p>
  75. Once you have all this debug information, how can you use it
  76. to solve your problem? That will depend on the task in question
  77. and the nature of your problem. Each task logs different aspects
  78. of its operation, but it should give you an idea of what is going
  79. on. For example, the <code>&lt;javac&gt;</code> task logs the
  80. reasons why it
  81. chooses to compile particular class files and not others, along
  82. with which compiler it is using and the arguments it will pass
  83. to that compiler. The following partial trace shows why
  84. <code>&lt;javac&gt;</code> is adding one class file but
  85. skipping another.
  86. This is followed by which compiler it will be using, the
  87. arguments that will get passed to the compiler,
  88. and a list of all the class files to be compiled.
  89. </p>
  90. <table>
  91. <tr>
  92. <td>
  93. [javac] Test.java omitted as D:\classes\Test.class is up to date.<br></br>
  94. [javac] Unset.java added as D:\classes\Unset.class is outdated.<br></br>
  95. [javac] Compiling 1 source file to D:\classes<br></br>
  96. [javac] Using classic compiler<br></br>
  97. [javac] Compilation args: -d D:\classes -classpath D:\classes;<br></br>
  98. D:\jdk118\classes.zip; -sourcepath D:\src\java -g:none<br></br>
  99. [javac] File to be compiled:<br></br>
  100. D:\src\java\Unset.java<br></br>
  101. </td>
  102. </tr>
  103. </table>
  104. <p>
  105. In many cases, Ant tasks are wrappers around OS commands or
  106. other Java classes. In debug mode, many of these tasks will
  107. print out the equivalent command line, as the
  108. <code>&lt;javac&gt;</code> task
  109. output does. If you are having a problem, it is often useful to
  110. run the command directly from the command line, in the same way
  111. Ant is running it, and see if the problem occurs from there
  112. as well. The problem may be in the command that is being run,
  113. or it may be in the way the Ant task is running the command.
  114. You can also see the effect of changing attribute values on the
  115. generated command line. This can help you to understand whether
  116. you are using the correct attributes and values.
  117. </p>
  118. </subsection>
  119. <subsection name="Has It Been Fixed?">
  120. <p>
  121. After examining the debug output, if you still believe that the
  122. problem you are having is caused by Ant, chances are that someone
  123. else may have already encountered this problem, and perhaps it has
  124. been fixed. The next step, therefore, may be to try a nightly build
  125. of Ant to see if the problem has been fixed. Nightly builds for Ant
  126. are available from the
  127. <a href="http://cvs.apache.org/builds/ant/nightly/">
  128. Ant web site</a>. While Ant nightly builds are typically quite
  129. stable and are used by
  130. <a href="http://cvs.apache.org/builds/gump/latest/">Gump</a>
  131. to build many other Jakarta projects, these builds should
  132. nonetheless be treated as experimental. Note that nightly builds
  133. do not build many of the optional tasks the come with Ant.
  134. A snapshot of these optional tasks is occasionally uploaded to
  135. the nightly download
  136. <a href="http://cvs.apache.org/builds/ant/nightly/optional/">
  137. area</a>. However, even this snapshot does not contain every
  138. optional task.
  139. </p>
  140. </subsection>
  141. <subsection name="Has It Been Reported?">
  142. <p>
  143. If the current nightly build doesn't resolve your problem, it is
  144. possible that someone else has reported the issue. It is time to
  145. look at the <a href="http://issues.apache.org/bugzilla/">
  146. Apache Bug Database</a>. This system is easy to use, and it will
  147. 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">
  148. currently open</a> and resolved bugs to see if your problem has
  149. already been reported. If your problem has been reported, you can
  150. see whether any of the developers have commented, suggesting
  151. workarounds, or the reason for the bug, etc. Or you may have
  152. information to add (see about creating and modifying bug reports
  153. below), in which case, go right ahead and add the information.
  154. If you don't have any additional information, you may just want
  155. to vote for this bug, and perhaps
  156. add yourself to the <code>CC</code> list to follow the progress
  157. of this bug.
  158. </p>
  159. </subsection>
  160. <subsection name="Filing a Bug Report">
  161. <p>
  162. By this time, you may have decided that there is an unreported
  163. bug in Ant. You have a few choices at this point. You can send
  164. an email to the <code>user</code> mailing list
  165. to see if
  166. others have encountered your issue and find out how they may
  167. have worked around it. If after some discussion, you feel it
  168. is time to create
  169. a bug report, this is a simple operation in the bug database.
  170. Please try to provide as much information as possible in order
  171. to assist the developers in resolving the bug. Please try to enter
  172. correct values for the various inputs when creating the bug, such
  173. as which version of Ant you are running, and on which platform,
  174. etc. Once the bug is created, you can also add attachments to
  175. the bug report.
  176. </p>
  177. <p>
  178. What information should you include in your bug report? The
  179. easiest bugs to fix are those that are most easily reproducible,
  180. so it is really helpful if you can produce a small test case that
  181. exhibits the problem. In this case, you would attach the build file
  182. and any other files necessary to reproduce the problem, probably
  183. packed together in an archive. If you can't produce a test case,
  184. you should try to include a snippet from your build file and the
  185. relevant sections from the verbose or debug output from Ant. Try
  186. to include the header information where Ant states the version,
  187. the OS and VM information, etc. As debug output is likely to be
  188. very large, it's best to remove any output that is not
  189. relevant. Once the bug is entered into the bug database, you
  190. will be kept informed by email about progress on the bug. If
  191. you receive email asking for further information, please try to
  192. respond, as it will aid in the resolution of your bug.
  193. </p>
  194. </subsection>
  195. <subsection name="Asking for an Enhancement">
  196. <p>
  197. Sometimes, you may find that Ant just doesn't do what you need it
  198. to. It isn't a bug, as such, since Ant is working the way it is
  199. supposed to work. Perhaps it is some additional functionality for
  200. a task that hasn't been thought of yet, or maybe a completely new
  201. task. For these situations, you will
  202. want to raise an <i>enhancement request</i>. Enhancement requests
  203. are managed using the same Apache Bug Database described above.
  204. These are just a different type of bug report. If you look in the
  205. bug database, you will see that one of the severity settings for
  206. a bug is &quot;Enhancement&quot;. Just fill the bug report in,
  207. set the severity of the bug to &quot;Enhancement&quot;, and
  208. state in the description how you would like to have Ant enhanced.
  209. Again, you should first check whether there are any existing
  210. enhancment requests that cover your needs. If so, just add your
  211. vote to these.
  212. </p>
  213. </subsection>
  214. <subsection name="Fixing the Bug">
  215. <p>
  216. If you aren't satisfied with just filing a bug report, you can
  217. try to find the cause of the problem and provide a fix yourself.
  218. The best way to do that is by working with the latest code from CVS.
  219. Alternatively, you can work with the source code available from the
  220. <a href="http://ant.apache.org/srcdownload.cgi">
  221. source distributions</a>. If you
  222. are going to tackle the problem at this level, you may want to
  223. discuss some details first on the <code>dev</code>
  224. mailing list. Once you have a fix for the problem, you may submit
  225. the fix as a <i>patch</i> to either the
  226. <code>dev</code> mailing
  227. list, or enter the bug database as described above and attach the
  228. patch to the bug report. Using the bug database has the advantage
  229. of being able to track the progress of your patch.
  230. </p>
  231. <p>
  232. If you have a patch to submit and are sending it to the
  233. <code>dev</code> mailing list,
  234. prefix &quot;[PATCH]&quot;
  235. to your message subject. Please include any relevant bug numbers.
  236. Patch files should be created with the <code>-u</code>
  237. option of the
  238. <code>diff</code> or <code>cvs diff</code> command. For
  239. example:<br></br><br></br>
  240. <font face="verdana" size="-1">
  241. diff -u Javac.java.orig Javac.java &gt; javac.diffs<br></br><br></br>
  242. </font>
  243. or, if you have source from CVS:<br></br><br></br>
  244. <font face="verdana" size="-1">
  245. cvs diff -u Javac.java &gt; javac.diffs<br></br><br></br>
  246. </font>
  247. Note: You should give your patch files meaningful names.
  248. This makes it easier for developers who need to apply a number
  249. of different patch files.
  250. </p>
  251. </subsection>
  252. </section>
  253. </body>
  254. </document>