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

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