You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compiling.xml 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" standalone="no"?>
  2. <!--
  3. Copyright 1999-2005 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. <!-- $Id$ -->
  15. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
  16. <document>
  17. <header>
  18. <title>Apache FOP: Building from Source Code</title>
  19. <version>$Revision$</version>
  20. </header>
  21. <body>
  22. <section id="build-needed">
  23. <title>Do You Need To Build?</title>
  24. <p>
  25. FOP distributions are either pre-compiled binary or source.
  26. If you are using a binary distribution, it is already built and there is no need to build it again.
  27. See the <a href="../download.html">Download Instructions</a> for information about whether a
  28. binary or source distribution is best for your needs.
  29. </p>
  30. <p>
  31. If you got the source code from a repository snapshot or via Subversion you will need to build FOP
  32. in any case.
  33. </p>
  34. </section>
  35. <section id="env">
  36. <title>Set Up Your Environment</title>
  37. <section id="env-jdk">
  38. <title>JDK</title>
  39. <p>
  40. Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3
  41. (A Java Runtime Environment is not sufficient).
  42. </p>
  43. </section>
  44. <section id="env-classpath">
  45. <title>CLASSPATH</title>
  46. <p>
  47. There is generally no need to setup a classpath. All libraries needed to compile FOP are included
  48. in the source distribution and are referenced by the build script.
  49. You will only need to adjust the classpath if you build FOP in some other way. See the build
  50. script build.xml for details.
  51. </p>
  52. </section>
  53. <section id="env-java-home">
  54. <title>JAVA_HOME</title>
  55. <p>
  56. The build script uses <a href="ext:ant">Apache Ant</a>, a popular
  57. Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
  58. your local JDK root directory. This is true even if you use JDK 1.2 or above, which normally
  59. does not need this setting.
  60. </p>
  61. </section>
  62. <section id="env-ant">
  63. <title>Apache Ant</title>
  64. <p>
  65. <a href="ext:ant">Apache Ant</a> must be installed in order to
  66. build FOP. Following best practices we don't include Ant with FOP anymore. You can find the
  67. <a href="ext:ant/manual/">instructions to install Ant in the Ant manual</a> on the web.
  68. </p>
  69. </section>
  70. </section>
  71. <section id="build-script">
  72. <title>Run the Build Script</title>
  73. <p>
  74. Change to the FOP root directory and build FOP by executing the build script (build.xml)
  75. using the "ant" command.
  76. </p>
  77. <note>
  78. The "ant" command is only available on your system if you've properly
  79. <a href="ext:ant/manual/">installed Apache Ant</a> and added Ant's location to the PATH
  80. environment variable.
  81. </note>
  82. <p>
  83. The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
  84. contains information for numerous build targets, many of which are building blocks to more
  85. useful target, and others which are primarily used by the FOP developers.
  86. You may benefit from looking through this file to learn more about the various build targets.
  87. To obtain a complete list of useful build targets:
  88. </p>
  89. <source>ant -projecthelp</source>
  90. <p>The most useful targets are:</p>
  91. <ul>
  92. <li>
  93. <strong>package</strong>: Generates the JAR files (default). This is the normal build that
  94. produces a jar file usable for running FOP.
  95. </li>
  96. <li>
  97. <strong>clean </strong>: Cleans the build directory. This is useful for making sure that
  98. any build errors are cleaned up before starting a new build. It should not ordinarily be
  99. needed, but may be helpful if you are having problems with the build process itself.
  100. </li>
  101. <li>
  102. <strong>javadocs</strong>: Generates javadocs. This creates the FOP API documentation.
  103. </li>
  104. </ul>
  105. <p>To run the build:</p>
  106. <source>ant [target ...]</source>
  107. <p>For example to do a normal build for the "all" target (which is the default):</p>
  108. <source>ant</source>
  109. <p>OR</p>
  110. <source>ant all</source>
  111. <p>To clean the build directory first:</p>
  112. <source>ant clean all</source>
  113. <note>
  114. If you want to shorten the build time you can just call the "package" target which
  115. doesn't perform any automated tests during the build.
  116. </note>
  117. </section>
  118. <section id="problems">
  119. <title id="Troubleshooting">Troubleshooting</title>
  120. <p>If you have problems building FOP, please try the following:</p>
  121. <ul>
  122. <li>Run the build with the target of "clean", then rerun the build.</li>
  123. <li>Delete the build directory completely, then rerun the build.</li>
  124. <li>
  125. Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
  126. or another dependency product somewhere in your CLASSPATH.
  127. </li>
  128. <li>
  129. If the build still fails, see the <a href="../gethelp.html">Getting Help</a>
  130. page for further help.
  131. </li>
  132. </ul>
  133. </section>
  134. </body>
  135. </document>