Login  Register

Re: Problem compilating in Fiji

Posted by dscho on Oct 15, 2014; 11:59am
URL: http://imagej.273.s1.nabble.com/Problem-compilating-in-Fiji-tp5010048p5010053.html

Hi Gerald,

On Wed, 15 Oct 2014, Gerald Ruiner Torgersen wrote:

> I have lately had lot of problems compiling my plugins in FIJI. Now I
> cannot even compile them if the classes are in separate files.

Why not make it a multi-file project explicitly? It is easy:

1. make a src/main/java directory
2. move all .java files there
3. (optional) if you have non-.java files (such as plugins.config) as part
   of your project, make a src/main/resources directory and put them there
4. add a very simply pom.xml file (see below)
5. open your plugin class in the script editor

The contents of the pom.xml describe your project:

        <?xml version="1.0" encoding="UTF-8"?>
        <project xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
            http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>

          <groupId>sc.fiji</groupId>
          <artifactId>Geralds_Plugins</artifactId>
          <version>1.0.0-SNAPSHOT</version>

          <dependencies>
            <dependency>
              <groupId>net.imagej</groupId>
              <artifactId>ij</artifactId>
              <version>1.49i</version>
            </dependency>
          </dependencies>
        </project>

It might sound like overkill to write such a pom.xml. However, Fiji/ImageJ
is centered around a collaborative community, and collaboration is
facilitated by using common ways to develop projects, as it makes it
easier to reuse libraries (both third-party libraries in your project, as
well as your project in other developers' software).

For more information, see http://imagej.net/Maven. Contributions welcome.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html