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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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. <!--
  128. <a href="http://cvs.apache.org/builds/ant/nightly/">
  129. Ant web site</a>. While Ant nightly builds are typically quite
  130. -->
  131. <a href="http://cvs.apache.org/builds/jakarta-ant/nightly/">
  132. Ant web site</a>. While Ant nightly builds are typically quite
  133. stable and are used by
  134. <a href="http://cvs.apache.org/builds/gump/latest/">Gump</a>
  135. to build many other Jakarta projects, these builds should
  136. nonetheless be treated as experimental. Note that nightly builds
  137. do not build many of the optional tasks the come with Ant.
  138. A snapshot of these optional tasks is occasionally uploaded to
  139. the nightly download
  140. <!--
  141. <a href="http://cvs.apache.org/builds/ant/nightly/optional/">
  142. area</a>. However, even this snapshot does not contain every
  143. -->
  144. <a href="http://cvs.apache.org/builds/jakarta-ant/nightly/optional/">
  145. area</a>. However, even this snapshot does not contain every
  146. optional task.
  147. </p>
  148. </subsection>
  149. <subsection name="Has It Been Reported?">
  150. <p>
  151. If the current nightly build doesn't resolve your problem, it is
  152. possible that someone else has reported the issue. It is time to
  153. look at the <a href="http://issues.apache.org/bugzilla/">
  154. Apache Bug Database</a>. This system is easy to use, and it will
  155. 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">
  156. currently open</a> and resolved bugs to see if your problem has
  157. already been reported. If your problem has been reported, you can
  158. see whether any of the developers have commented, suggesting
  159. workarounds, or the reason for the bug, etc. Or you may have
  160. information to add (see about creating and modifying bug reports
  161. below), in which case, go right ahead and add the information.
  162. If you don't have any additional information, you may just want
  163. to vote for this bug, and perhaps
  164. add yourself to the <code>CC</code> list to follow the progress
  165. of this bug.
  166. </p>
  167. </subsection>
  168. <subsection name="Filing a Bug Report">
  169. <p>
  170. By this time, you may have decided that there is an unreported
  171. bug in Ant. You have a few choices at this point. You can send
  172. an email to the <code>user</code> mailing list
  173. to see if
  174. others have encountered your issue and find out how they may
  175. have worked around it. If after some discussion, you feel it
  176. is time to create
  177. a bug report, this is a simple operation in the bug database.
  178. Please try to provide as much information as possible in order
  179. to assist the developers in resolving the bug. Please try to enter
  180. correct values for the various inputs when creating the bug, such
  181. as which version of Ant you are running, and on which platform,
  182. etc. Once the bug is created, you can also add attachments to
  183. the bug report.
  184. </p>
  185. <p>
  186. What information should you include in your bug report? The
  187. easiest bugs to fix are those that are most easily reproducible,
  188. so it is really helpful if you can produce a small test case that
  189. exhibits the problem. In this case, you would attach the build file
  190. and any other files necessary to reproduce the problem, probably
  191. packed together in an archive. If you can't produce a test case,
  192. you should try to include a snippet from your build file and the
  193. relevant sections from the verbose or debug output from Ant. Try
  194. to include the header information where Ant states the version,
  195. the OS and VM information, etc. As debug output is likely to be
  196. very large, it's best to remove any output that is not
  197. relevant. Once the bug is entered into the bug database, you
  198. will be kept informed by email about progress on the bug. If
  199. you receive email asking for further information, please try to
  200. respond, as it will aid in the resolution of your bug.
  201. </p>
  202. </subsection>
  203. <subsection name="Asking for an Enhancement">
  204. <p>
  205. Sometimes, you may find that Ant just doesn't do what you need it
  206. to. It isn't a bug, as such, since Ant is working the way it is
  207. supposed to work. Perhaps it is some additional functionality for
  208. a task that hasn't been thought of yet, or maybe a completely new
  209. task. For these situations, you will
  210. want to raise an <i>enhancement request</i>. Enhancement requests
  211. are managed using the same Apache Bug Database described above.
  212. These are just a different type of bug report. If you look in the
  213. bug database, you will see that one of the severity settings for
  214. a bug is &quot;Enhancement&quot;. Just fill the bug report in,
  215. set the severity of the bug to &quot;Enhancement&quot;, and
  216. state in the description how you would like to have Ant enhanced.
  217. Again, you should first check whether there are any existing
  218. enhancment requests that cover your needs. If so, just add your
  219. vote to these.
  220. </p>
  221. </subsection>
  222. <subsection name="Fixing the Bug">
  223. <p>
  224. If you aren't satisfied with just filing a bug report, you can
  225. try to find the cause of the problem and provide a fix yourself.
  226. The best way to do that is by working with the latest code from CVS.
  227. Alternatively, you can work with the source code available from the
  228. <a href="http://ant.apache.org/srcdownload.cgi">
  229. source distributions</a>. If you
  230. are going to tackle the problem at this level, you may want to
  231. discuss some details first on the <code>dev</code>
  232. mailing list. Once you have a fix for the problem, you may submit
  233. the fix as a <i>patch</i> to either the
  234. <code>dev</code> mailing
  235. list, or enter the bug database as described above and attach the
  236. patch to the bug report. Using the bug database has the advantage
  237. of being able to track the progress of your patch.
  238. </p>
  239. <p>
  240. If you have a patch to submit and are sending it to the
  241. <code>dev</code> mailing list,
  242. prefix &quot;[PATCH]&quot;
  243. to your message subject. Please include any relevant bug numbers.
  244. Patch files should be created with the <code>-u</code>
  245. option of the
  246. <code>diff</code> or <code>cvs diff</code> command. For
  247. example:<br></br><br></br>
  248. <font face="verdana" size="-1">
  249. diff -u Javac.java.orig Javac.java &gt; javac.diffs<br></br><br></br>
  250. </font>
  251. or, if you have source from CVS:<br></br><br></br>
  252. <font face="verdana" size="-1">
  253. cvs diff -u Javac.java &gt; javac.diffs<br></br><br></br>
  254. </font>
  255. Note: You should give your patch files meaningful names.
  256. This makes it easier for developers who need to apply a number
  257. of different patch files.
  258. </p>
  259. </subsection>
  260. </section>
  261. </body>
  262. </document>