I have a maven project and am using the nativedependencies-maven-plugin
(https://github.com/fmarot/nativedependencies-maven) to manage the DLL.
The DLL is from a third party, and has the following structure. Let's say that the name of the JAR file is abc.jar
and the corresponding DLL is abcxyz.dll
, where xyz is the version number without periods. So if the version is 12.6.1, the DLL is named abc1261.dll
. If the third party updates their product to version 12.7.0, they issue a new JAR abc.jar
and a new DLL abc1270.dll
.
I am storing the JAR in a local repository, and the name of the JAR as reflected in the repository is then abc-x.y.z.jar
. I put a classifier on the DLL called natives-abc
, and the name of the DLL in the repository (once deployed) is abc-x.y.z-natives-abc.dll
. When I build the project, abc-x.y.z-natives-abc.dll
is then properly copied over to the target/natives
folder by the nativedependencies-maven-plugin
.
When I run the project from Eclipse, it fails, because the JAR is looking for abcxyz.dll
and not abc-x.y.z-natives-abc.dll
. If I copy abc-x.y.z-natives-abc.dll
into abcxyz.dll
in the target/natives
folder, then everything works, so I know that the java.library.path
is getting set correctly, which I have also verified by inspecting the process using the jinfo
tool.
What I need is for the DLL to get renamed once it is copied from the local repository into target/natives
. I can't figure out how to make maven do that.
What I want to do is have different versions of abc.jar
and abcxyz.dll
in the local repository, and then just change the <version>
tags in the pom.xml
file to refer to different versions. The name of the JAR file in deployment isn't relevant, but it's associated DLL name is relevant because the JAR file from the third party for a specific version looks for a specific DLL name corresponding to the version.