[ImageJ-devel] Finding classes and importing the right Maven artifacts

Johannes Schindelin Johannes.Schindelin at gmx.de
Wed Jul 25 15:11:24 CDT 2012


Hi Stephan,

On Wed, 25 Jul 2012, Stephan Preibisch wrote:

> can I ask a related question. Yesterday, I tried to add jna.jar as a
> Maven dependency to a plugin for some testing. But I was unable to
> figure out a valid version that I need, the artifact id and the group
> id. Where I do get this stuff from? Luckily the CPU_Meter used it, so I
> copied it from there:
> 
> 		<dependency>
> 			<groupId>net.java.dev.jna</groupId>
> 			<artifactId>jna</artifactId>
> 			<version>3.2.7</version>
> 		</dependency>

Typically you point a web browser to http://maven.imagej.net:8081/ (or if
you are behind a firewall, http://maven.imagej.net/, but that has a few
limitations) and search for the artifact name. If you do not find it
there, http://search.maven.org/ should have it.

> But is is unclear to me why the group id would be "net.java.dev.jna" as
> the entire package is in com.sun.*, e.g.:
> 
> import com.sun.jna.Library;
> import com.sun.jna.Native;
> import com.sun.jna.Platform;

Well, their plan was to donate JNA to Sun for inclusion into the official
API of the JRE. But Sun never took it, so they were stuck with the wrong
package name. But the website where you get JNA used to be called
http://jna.dev.java.net/, hence the groupId. Oracle changed it to
http://jna.java.net/ (basically removing all "dev." from the projects
hosted on java.net), just because they could, and probably because they
thought it would be a good idea to invalidate all the links that were
floating around in the world wide net. But at least the JNA project (or at
least those maintaining their artifacts) seem to have the good sense to
keep the groupId people started to use.

Ciao,
Dscho



More information about the ImageJ-devel mailing list