Skip to main content

Maven: Using JUnit with DLLs

Posted by kschaefe on August 14, 2009 at 5:54 AM PDT

Since I was unable to quickly google the solution for my Maven DLL problem, I thought I'd post a quick blog about it. Here's the situation, I have tests that rely on artifacts that are DLLs (in my case these were the Java3D DLLs). So, I needed to be able to have the DLLs in a known location so that the tests could run, but did not want to check those items into the SCM repository, nor install them locally on the Hudson server. I made two changes to the POM file.

First I used the dependency plugin to find and output all the DLLs.



Then, I modified the surefire plugin to use the output directory as part of the java.library.path.



Hopefully, this will make it easier for the next guy trying to solve the same problem. If anyone has a better way of doing it, please let me know.

Related Topics >>


I've never been able to get the systemProperties line to work for DLLs. Ever. The property is updated (if you dump it you can see that) but the libraries won't load. I think it's an ordering dependency with the JVM....or I'm just doing something wrong.

Tiny suggestion: you can use the systemProperties element instead of argLine.