You can create a plug-in project by using the command-line
interface; however, the preferred method to create plug-in projects
is by using Eclipse.
Procedure
- Open the command-line interface.
- Change directory to the plugin.depends project
directory in your workspace.
- Set the
ANT_HOME environment variable.
You can use Ant in your Eclipse installation at eclipse/plugins/org.apache.ant_1.7*.
You can also invoke this Ant script from Eclipse. To do this, right-click create.plugin.project.xml in
the plugin.depends project. Select . Click the Main tab. In the argument
section, type the various -Dproject.name=jp1 values
that are provided in this sample.
- Create a template plug-in project by using the following
command:
ant -Dproject.name=tp1 -Dplugin.name=a.b.c.template -f create.plugin.project.xml
The project.name property is optional
and if it is not specified, it defaults to the value of the plugin.name.
- Create a Java™ plug-in
project:
- Create a Java plug-in
project that contains no package name:
(.java assumed on java classname)
ant -Dproject.name=jp1 -Dplugin.name=a.b.c.java -Djava.classname=MyPlugin -f create.plugin.project.xml
- Create a Java plug-in
project that contains a package name:
ant -Dproject.name=jp2 -Dplugin.name=a.b.c.java -Djava.classname=a.b.c.MyPlugin -f create.plugin.project.xml
- Verify that the command is successful. Import the newly
created projects into your workspace.
To build the
plug-in projects, for example,
jp1, you can find
build.plugin.xml in
project
jp1. Right-click
build.plugin.xml and
issue with the goal clean, publish selected. The equivalent
Ant command is to issue the following command in the project
jp1 directory:
ant –f build.plugin.xml clean publish
The plug-in
a.b.c.java-<version>.tgz is
created in the
export directory.