This is an example Maven project implementing an ImageJ 1.x plugin.
For an example Maven project implementing an ImageJ2 command, see: https://github.com/imagej/example-imagej2-command
It is intended as an ideal starting point to develop new ImageJ 1.x plugins in an IDE of your choice. You can even collaborate with developers using a different IDE than you.
In Eclipse, for example, it is as simple as File › Import... › Existing Maven Project.
In NetBeans, it is even simpler: File › Open Project.
The same works in IntelliJ.
Die-hard command-line developers can use Maven directly by calling
in the project root.
However you build the project, in the end you will have the
(called artifact in Maven speak) in the
To copy the artifact into the correct place, you can call
This will not only copy your artifact, but also all the dependencies. Restart
your ImageJ or call Help › Refresh Menus to see your plugin in the menus.
Developing plugins in an IDE is convenient, especially for debugging. To
that end, the plugin contains a
main method which sets the
system property (so that the plugin is added to the Plugins menu), starts
ImageJ, loads an image and runs the plugin. See also
for information how ImageJ makes it easier to debug in IDEs.
Since this project is intended as a starting point for your own developments, it is in the public domain.
How to use this project as a starting point
Visit this link to create a new repository in your space using this one as a template.
pom.xmlfile. Every entry should be pretty self-explanatory. In particular, change
- the artifactId (NOTE: should contain a '_' character)
- the groupId, ideally to a reverse domain name your organization owns
- the version (note that you typically want to use a version number ending in -SNAPSHOT to mark it as a work in progress rather than a final version)
- the dependencies (read how to specify the correct groupId/artifactId/version triplet here)
- the developer information
- the scm information
Process_Pixels.javafile and add your own
src/main/java/<package>/(if you need supporting files -- like icons -- in the resulting
.jarfile, put them into
Replace the contents of
README.mdwith information about your project.
Eclipse: To ensure that Maven copies the plugin to your ImageJ folder
- Go to Run Configurations...
- Choose Maven Build
- Add the following parameter:
This ensures that the final
.jar file will also be copied to
your ImageJ plugins folder everytime you run the Maven build.