Managing Dll Dependencies with Maven

Managing DLL dependencies with Maven

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.

Maven Dll Dependency Problem

This will depend on your assembly descriptor, but it seems like you have a <dependencySet> under which <unpack>true</unpack> is specified, that does not exclude the DLL from the set. Try adding this into that dependencySet element:

<excludes>
<exclude>*:dll*</exclude>
</excludes>

If you intend to incorporate the DLL dependencies without unpacking them, then you might need an additional dependencySet element that includes them and doesn't specify the unpack flag. See http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet for more information.

how to reference native DLL from Maven repo?

For a DLL, you will need to use the Copy Dependencies MOJO.

You can filter out all dependencies other than the DLL and specify anywhere in your project structure to copy them to, including your target/webapp/WEB-INF/lib.

DLL Files for Maven

The error you're getting means the dll cannot be found in the java.library.path.

Unfortunately You cannot load DLL from the JAR directly. You can package it within the JAR and unpack it before loading it. Checkout the question Extract and load DLL from JAR.



Related Topics



Leave a reply



Submit