[ImageJ-devel] quick question(s) on maven dependencies

Jay Warrick warrick at wisc.edu
Thu Aug 7 13:12:58 CDT 2014


Great. Wasn't sure. Thanks.

On Aug 7, 2014, at 12:40 PM, Curtis Rueden <ctrueden at wisc.edu> wrote:

> Hi Jay,
> 
> I would prefer to discuss things on the public mailing lists. This sort of question is just fine on fiji-devel (since it is about a Fiji plugin).
> 
> Thanks,
> Curtis
> 
> 
> On Thu, Aug 7, 2014 at 6:26 AM, Jay Warrick <warrick at wisc.edu> wrote:
> Hi Curtis,
> 
> Just a learning question regarding maven dependencies. When I add a maven dependency to my project (e.g., Track Mate so I can use it's tracking algorithms...)
> 
> <dependency>
>         <groupId>sc.fiji</groupId>
>         <artifactId>TrackMate_</artifactId>
>         <version>2.4.0</version>
> </dependency>
> 
> My program sees the new dependency and I can compile and run but when I use the TrackMate algorithm I get an error saying that it can't find a class that TrackMate depends on from net.sf.jgrapht. I look in the TrackMate pom and I see...
> 
> <dependency>
>         <groupId>net.sf.jgrapht</groupId>
>         <artifactId>jgrapht</artifactId>
>         <version>${jgrapht.version}
>         </version>
> </dependency>
> 
> So, obviously it looks like the dependency is in the TrackMate pom and not some purely local dependency that points to a jar in some non-maven-controlled folder on the developer's computer. However, in order to get my TrackMate algorithm to work without an error I have to add the missing dependency on jgrapht explicitly to my pom (removing the jgrapht version parameter because I don't have this parameter defined in my project and replacing it with the only version that is available at maven.imagej.net)
> 
> <dependency>
>         <groupId>net.sf.jgrapht</groupId>
>         <artifactId>jgrapht</artifactId>
>         <version>0.8.3</version>
> </dependency>
> 
> Is it likely that the ${jgrapht.version} parameter in TrackMate refers to a different version than is available on maven.imagej.net? If I'm not on the right track, what is going on? Lastly, if/when this happens more generally, what should my general course of action (do what I did and contact others such as TrackMate developers or you guys and your maven repo)?
> 
> This sort of kinda happened to me with the xadisk jar artifact dependency that I have but in the case of the xadisk dependency, the xadisk pom had the following which, I think, suggests that the jar expects this to be provided by the java distribution I'm running. Not sure why it isn't but at least adding this as a dependency allows my xadisk stuff to work now. Anything striking you as wrong about this xadisk situation or just merely unfortunate and I should add the needed dependency like I have?
> 
> <dependency>
>                 <groupId>javax.resource</groupId>
>                 <artifactId>connector-api</artifactId>
>                 <version>1.5</version>
>                 <scope>provided</scope>
> </dependency>
> 
> Thanks,
> 
> Jay
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140807/532b6bb0/attachment.html>


More information about the ImageJ-devel mailing list