Maven plugin java.library.path
Asked Answered
A

1

7

The maven-surefire-plugin supports using the java.library.path property by means of the <argLine> configuration option.

I need to pass the java.library.path property to sql-maven-plugin (which doesn't have an <argLine> configuration option) in order to use the jTDS driver with windows authentication (needs ntlmauth.dll).

Thanks in advance for your help.

Ation answered 4/12, 2012 at 14:50 Comment(0)
A
10

The surefire plugin is a special case; it runs the tests in a separate JVM. Most maven plugins don't do this, they run in-process.

So you are out of luck with that plugin config.

One workaround you can try is to use the exec:exec goal of the exec-maven-plugin instead, specifying java with -Djava.library.path on the executable line and roll your own SQL-executing java code.

Otherwise, you can add -Djava.library.path to your MAVEN_OPTS environment variable, which will affect all plugins and all maven builds (which might be fine, depends on your setup), or add it every time to the mvn command line.

Asperity answered 7/1, 2013 at 13:49 Comment(1)
With Intellij, you can globally set the VM options in the main IDE preferences, in the section: Build tools > Maven > RunnerVladamar

© 2022 - 2024 — McMap. All rights reserved.