[ImageJ-devel] [fiji-devel] ImgLib2 merge to master

Curtis Rueden ctrueden at wisc.edu
Thu Apr 21 10:42:53 CDT 2011


Hi everyone,

imglib used to work without maven. So before writing code for imglib I
> have to learn how to use eclipse and before that, how to use maven?
>

Regarding the issues with Eclipse and Maven, you do not need either of these
tools, but they both make things much easier and are well worth the
relatively minor time investment.

Stephan is correct that you do not need to use Maven at all. You could
import each subproject as its own Eclipse project manually. File > Import >
File System and then choose e.g. "imglib2/core" as the root folder. As
Stephan says, you will then need to set src/main/java and src/test/java as
source folders. Further, for projects with dependencies—e.g., imglib2-io
depends on imglib2 and bio-formats—you would need to manually link up those
dependencies, either as JAR files or Eclipse project dependencies.

I will emphasize that doing all of the above is a LOT more work than just
installing the m2eclipse plugin and using "import existing Maven projects."
If you do it the Maven way, it takes care of all the dependencies
automatically. You can have any combination of projects open in Eclipse and
they will work just fine.

There isn't really much to "learn" about Maven. If your project gets messed
up somehow, you can reset it by right-clicking and choosing "Maven > Update
Project Configuration" and then Project > Clean > Clean all projects. Those
two steps will almost always fix puzzling issues.

The same goes for NetBeans and IDEA, which both also feature Maven support
out of the box. We have directions on the ImageJDev web site (
http://imagejdev.org/ides) for setting up Eclipse, NetBeans, IDEA, or the
command line. They are tailored for ImageJ2 but the same concepts apply to
ImgLib.

If you don't want to use an IDE, you can develop the code using Maven on the
command line. If you don't want to use Maven either, you can do that too.
Simply run the "mvn dependency:copy-dependencies" target one time, and you
will notice a new folder "target/dependencies" containing all the dependent
JARs. You can then set your CLASSPATH to point to all of those, as well as
src/main/java, and hack away as usual in vim or Emacs or whatever. Of
course, these JAR files will not be automatically updated as those projects
evolve, and for inter-project dependencies within imglib (e.g., imglib-io
depending on imglib) you may want your CLASSPATH pointing to multiple
src/main/java folders, but it is all doable.

Please ask if you have any further questions or issues relating to the build
system—I would be happy to help!

-Curtis

On Thu, Apr 21, 2011 at 8:10 AM, Stephan Saalfeld <saalfeld at mpi-cbg.de>wrote:

> Hi Albert,
>
> > imglib used to work without maven. So before writing code for imglib I
> > have to learn how to use eclipse and before that, how to use maven?
>
> No---but it makes life easier.  You are free to import each project
> independently and care about the editor, builder/dependencies yourself
> like in any other project.  E.g. imglib2-core has no dependencies which
> makes that extremely easy.
>
> > I imported the project by creating a new java project and telling it
> > to use the imglib folder.
>
> You have to use the src/main/java folder and, if you like the
> src/test/java folder as well.  Eclipse lets you add/edit/remove source
> folders later easily.
>
> Stephan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fiji-devel" group.
> To post to this group, send email to fiji-devel at googlegroups.com.
> To unsubscribe from this group, send email to
> fiji-devel+unsubscribe at googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fiji-devel?hl=en.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110421/1185a23a/attachment.html>


More information about the ImageJ-devel mailing list