Building Tasks: Quick Reference This topic describes common tasks you can perform when building a project. For more detailed information, click the links in the right column.
Building a Project When you build a project, the IDE calls the corresponding target in the project's Ant build script. The IDE compiles the source files and generates the packaged build output, such as a JAR file or WAR file. You can build the main project and all of its required projects, or build any project individually. To build the main project and its required projects:
The IDE displays the Ant output and any compilation errors in the Output window. You can double-click any error to go to the location in the source code where the error occurred. To build an individual project and its required projects:
The IDE displays the Ant output and any compilation errors in the Output window. You can double-click any error to go to the location in the source code where the error occurred. To stop building a project:
For standard projects that have a main class is specified, the IDE automatically copies any JAR files on the project's classpath to the dist/lib folder when you build the project. The IDE also adds each of the JAR files to the Class-Path element in the application JAR's manifest.mf file. This simplifies running the application outside the IDE. For more information, see Preparing a JAR for Deployment Outside the IDE. Building a JAR File In standard projects , the IDE builds a JAR file from your project sources every time you run the Build command. The JAR file is generated to the dist directory of your project folder. For standard projects that have a main class is specified, the IDE automatically copies any JAR files on the project's classpath to the dist/lib folder when you build the project. The IDE also adds each of the JAR files to the Class-Path element in the application JAR's manifest.mf file. This simplifies running the application outside the IDE. For more information, see Preparing a JAR for Deployment Outside the IDE To change the JAR name and location:
To specify which files are added to the JAR file:
To specify the manifest file for the JAR file: In project.properties, type the name of the manifest file in the manifest.file property. The file name must be specified relative to the project's build.xml file. If you are using the Java Application template, the IDE creates a manifest file for you. To disable generation of a JAR file for a project:
<target name="jar" /> In free-form projects, JAR file creation is controlled by your Ant script. -- Wagner R. dos Santos |