Can't use World Wind Java into a maven project because of dependencies
Asked Answered
B

4

5

I a am trying to use World Wind Java into a Maven project.

First method would be to take their SDK here and all dependencies in build path. But I want to make it more maven compliant.

First dependency: jogl-all.jar. SDK v2.0.0 seems to use v2.1.5 of JOGL (from manifest). Hence I put this in my pom file:

<dependency>
    <groupId>org.jogamp.jogl</groupId>
    <artifactId>jogl-all</artifactId>
    <version>2.1.5</version>
</dependency>

Here is my issue: two jar files are very different in size, and moreover, with JOGL jar from SDK, I can import com.jogamp.opengl.awt.GLCanvas, while with maven retrieved JAR, I can't.

I don't understand how I can get two different behaviors/JARs while using exact same version.

Any clue? Any other experience using World Wind Java within Maven project?

Bilski answered 16/10, 2014 at 19:4 Comment(0)
S
4

Some digging into the World Wind Java readme files seems to have turned up the issue:


JOGL Library Overview

The JOGL library provides World Wind Java with (1) a Java binding to the OpenGL API, and (2) OpenGL contexts compatible with Java's AWT and Swing windowing toolkits: http://jogamp.org/jogl/www/

World Wind Java uses JOGL v2.1.5, released on 11 March 2014 and downloaded from: http://jogamp.org/deployment/v2.1.5/archive/jogamp-all-platforms.7z

The JOGL library compiled JAR files and README files are checked into the World Wind Java source, distributed with all World Wind Java builds and included in the World Wind Java Web Start deployment. This is necessary in order ensure correct operation of World Wind Java, as changes in JOGL are occasionally unstable or incompatible with previous versions. Additionally, World Wind Java's copy of the JOGL JAR files are modified to enable Web Start deployment outside of the jogamp.org domain.


Whoever put World Wind Java in the central repository should therefore have packaged and deployed the very specific JOGL/Gluegen Jars necessary to make it work. In the mean time I'm going to extract and deploy these version to my own private repository.

Stansberry answered 20/3, 2015 at 21:20 Comment(1)
Thanks for having a look. If I understand well, you confirmed that World Wind Java has a dedicated copy of JOGL Jar files modified at least for "web start deployment outside of the jogamp.org domain". So no way to make it work with a genuine JOGL jar. That explains a lot. To me the best way to deploy it to central repositories would be to include that branch of JOGL instead of refering to it trough deps.Bilski
B
2

If you want to use a library in Maven you should add the dependency to your project, there is no need to hunt for all transitive dependencies (unless the docs say otherwise). For the world wind I found the dependency on this site: https://mvnrepository.com/artifact/gov.nasa/worldwind/2.0.0-986

<dependency>
  <groupId>gov.nasa</groupId>
  <artifactId>worldwind</artifactId>
  <version>2.0.0-986</version>
</dependency>

It should work.

One of the advantages of using Maven is that there is no need to know every jar needed to use every library, Maven will manage this. In this case, the World Wind Maven dependency has it's own POM that declares all needed dependencies. Maven will scan all POMs from all dependencies and will download all required JARs when needed.

Bachelorism answered 16/10, 2014 at 19:21 Comment(3)
Worldwind is on Maven Central, too.Walke
Thank for having a look. But what you proposed was already tried and led to the previous question still unanswered : two jar with same name and same version are different. Why WorldWind java team would have made a different jar which is not available anywhere but on their own site ? (to come back to your answer, of course worldwind & worldwindx are available on maven repos, but its own POM does not declare all needed dependencies which are : glugen-rt, gdal and jogl-all. Adding them manually does not solve the issue as explained in my first question.Bilski
When I read your question it sounded to me that you tried to get all dependencies from scratch, but the problem, as you described, is that the World Wind POM is not complete. Sorry about that. I have to agree with the answer from Gerold, the developers should have something to say about that.Bachelorism
W
1

There is no technical restriction having two files with the same name on different locations with different content. Though I'd not recommend this - especially with library artifacts. This confuses people, like you, and drives them crazy sooner or later.

Why WorldWind Java team did that? Ask Responsible NASA Official: Patrick Hogan.

Walke answered 17/10, 2014 at 9:41 Comment(1)
You mean that they certainly built their own package based on JOGL, but different from JOGL official ? Guess you are right, I'll have a look at their forum to make sure ...Bilski
F
0

Please rather use 2.1.5-01 instead of 2.1.5 because the latter had a big problem, something went wrong during its deployment:

http://jogamp.org/deployment/maven/org/jogamp/jogl/jogl-all/2.1.5-01/

Flavoprotein answered 19/10, 2014 at 12:8 Comment(2)
Using 2.1.5-01 doesn't improve the situation. I've emailed the NASA contact to see if we can get to the bottom of this.Stansberry
Sorry, now the latest version is the version 2.3.0. However, it contains non backward compatible changes, World Wind will have to be modified a bit to make it work (it's for the good cause as it fixes a long standing limitation under Mac).Flavoprotein

© 2022 - 2024 — McMap. All rights reserved.