views:

1116

answers:

1

I have a Java program with Maven managing its dependencies. One of those dependency is a JNI wrapper for another program. Maven takes care of the reference to the relevant JAR file, but I'm left messing around with the DLL file myself.

Is there a good way of having Maven handle the DLL as well? Ideally I would like to have the DLL loaded into our local repository like the JAR file.

+3  A: 

Did you try something like this:

<dependency>
    <groupId>com.foo</groupId>
    <artifactId>footron</artifactId>
    <version>4.2</version>
    <scope>runtime</scope>
    <type>dll</type>
</dependency>

You can add them to maven's repository with something like this:

mvn install:install-file -Dfile=footron.dll -DgroupId=com.foo -DartifactId=footron  -Dversion=4.2 -Dpackaging=dll -DgeneratePom=true

Haven't done this for DLLs but something like this should work.

sal
Actually, after spending some additional time thinking about it I decided it was worth investing in the effort to remove the need for the DLL via JNI. Probably worth the effort in the long run. I will look into your suggestion though out of curiosity.
Kris
@Kris, that's probably a good idea. I thought of suggesting that but I don't make it a habit of telling people to fix code I haven't seen. AKA, Psychic code review
sal