The build.xml Ant build file

We have already outlined the contents of the user action catalog, the properties file and the documentation file in our earlier discussion. The final step is to compile the source file and build the archive file that will hold the class files and the plugin's other resources.

Publicly released plugins include with their source a makefile in XML format for the Ant utility. The format for this file requires few changes from plugin to plugin. Here is a version of build.xml that could be used by QuickNotepad:

<project name="QuickNotepad" default="build">
    This is an ant build.xml file for building the QuickNotepad plugin for jEdit.

  <property file=""/>
  <property file="../"/>
  <property name="user-doc.xml" location = "users-guide.xml"/>
  <import file="${}/plugin-build.xml" />

  <!-- Extra files that should be included in the jar -->
  <selector id="packageFiles">
        <filename name="*.txt" />

This build file imports another modular build file, plugin-build.xml from the build-support project. It is available as a package you can check out from subversion, or found online in the jEdit's SVN repository. It contains the common build steps used to build the core jEdit plugins, and some example files which you can adapt for use with your development environment.

Customizing this build file for a different plugin will likely only require three changes to build.xml file:

Because this build file and those used by most plugins import a file from the current and the parent directories, it is possible to build most of jEdit's plugins in a uniform way by setting the common properties in a single file, placed in the plugin source's parent directory.


For a full discussion of the Ant file format and command syntax, you should consult the Ant documentation, also available through jEdit's help system if you installed the Ant Plugin. When editing Ant build files, the XML plugin gives you completion tips for both elements and attributes. The Console plugin provides you with an ANT button which you can bind to keyboard actions. In addition, there are the AntFarm and Antelope plugins which also proivde you with alternate means to execute Ant targets through the Console.