Maven resolution of native dependencies - minor issue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven resolution of native dependencies - minor issue

Brendan
This post was updated on .
I'd like the JOGL2 dependencies for my project to be sourced through Maven. I am working in Netbeans Java 8 on Windows 7.

Following the instructions at http://jogamp.org/wiki/index.php/Maven   I created the following in pom.xml:

        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all-main</artifactId>
            <version>2.1.5-01</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt-main</artifactId>
            <version>2.1.5-01</version>
        </dependency>

This compiles & unpacks fine. However when I instantiate a GLJPanel this error is thrown:

        UnsatisfiedLinkError
        Can't load library: C:\Users\Brendan\Documents\NetBeansProjects\worldsim\gluegen-rt.dll

A successful work around is to manually copy these DLLs into that folder (the root folder for the project):

        gluegen-rt.dll
        jogl_desktop.dll
        nativewindow_awt.dll
        nativewindow_win32.dll
        newt.dll

However I would prefer a 100% Maven driven solution to simplify for other collaborators and keep the project files organized.

Is there a way to configure Maven to copy/include these native dependencies to a location where JOGL can resolve them?

My reading of the Maven page "So, when you add a dependency on jogl-all-main in your own project, the native jar files of jogl-all are brought in as transitive dependencies and everything works as expected" suggests I should not require an additional reference to jogl-all. Adding this dependency doesn't change anything anyway.
Reply | Threaded
Open this post in threaded view
|

Re: Maven resolution of native dependencies - minor issue

jmaasing
I use Maven in all my JOGL-projects and I do not have to manually copy any files. So the only think I can think of is to check if there are any strange file permissions preventing the program from extracting the native files.
You might also try with the latest JOGL version.
Reply | Threaded
Open this post in threaded view
|

Re: Maven resolution of native dependencies - minor issue

Brendan
Are you working on Windows?

I doubt it's permissions, it's Windows 7 Home with no special security setup.

During the project build, the DLLs are not copied into the project folder anyway by Maven.

It appears that JOGL is specifically looking for the DLLs in the project's root folder. What logic goes into this? Are there other search paths?
Reply | Threaded
Open this post in threaded view
|

Re: Maven resolution of native dependencies - minor issue

gouessej
Administrator
You probably did something wrong. I use Maven with JogAmp's Ardor3D Continuation and Ardor3D for several years with Maven both under GNU Linux and sometimes under Windows and I have no file to copy. Please have a look at those pom files:
https://github.com/gouessej/Ardor3D/blob/master/pom.xml
https://github.com/gouessej/Ardor3D/blob/master/ardor3d-jogl/pom.xml

Edit.: If Netbeans copies the JARs of your classpath into another location without copying the JARs containing the native libraries, it won't work. You should force Netbeans not to copy or move these files.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Maven resolution of native dependencies - minor issue

jmaasing
I use netbeans + maven all the time and here is nothing special I need to configure in netbeans, just give the dependencies in the POM and "it just works" (OSX and Ubuntu).
Reply | Threaded
Open this post in threaded view
|

Re: Maven resolution of native dependencies - minor issue

gouessej
Administrator
There is an option called "copy dependent libraries" in Netbeans, maybe it can break projects but it is disabled by default.
Julien Gouesse | Personal blog | Website