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.
Go to Project properties->Java Build Path->Source. You'll find a list of source-folders. Each entry under the the Source tab has Native library locations.
java. library. path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project.
One advantage of using Maven is, that it is useful for downloading libraries. Libraries are source code which has been packaged to be used by anyone. For example we have used the JUnit library for unit tests. There is a library for almost anything.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With