diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f3961090e..5277bc5a8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -110,7 +110,7 @@ jobs: # environment variables: $env:VARNAME instead of $VARNAME # Also, note that Windows stores all the DLLs in the same directory. # Instead of defining jni.library.path and jna.library.path we need to define - # jni.library.name and commons.crypto.OpenSslNativeJna to override the file names + # commons.crypto.OpenSslNativeJni and commons.crypto.OpenSslNativeJna to override the file names - name: Build with Maven (Windows) if: ${{ startsWith(matrix.os,'windows') }} # OPENSSL_HOME is needed for Windows build to find some header files @@ -123,7 +123,7 @@ jobs: env: OPENSSL_HOME: "C:\\Miniconda\\Library" run: | - mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.name=$env:NAME" -D"commons.crypto.OpenSslNativeJna=$env:NAME" + mvn -V -B -ntp -DtrimStackTrace=false -D"commons.crypto.OpenSslNativeJni=$env:NAME" -D"commons.crypto.OpenSslNativeJna=$env:NAME" - name: Build with Maven (not Windows) if: ${{ ! startsWith(matrix.os,'windows') }} run: | @@ -141,4 +141,4 @@ jobs: if: ${{ matrix.java == '8' && startsWith(matrix.os,'ubuntu') }} run: | mvn -V -B -ntp test -Ptestjni -D"jni.library.path=$ENGINESDIR" -Dcommons.crypto.OpenSslNativeJna=___ - mvn -V -B -ntp test -Ptestjna -D"jna.library.path=$ENGINESDIR" -Djni.library.name=___ + mvn -V -B -ntp test -Ptestjna -D"jna.library.path=$ENGINESDIR" -Dcommons.crypto.OpenSslNativeJni=___ diff --git a/LIBRARY_NAMES.txt b/LIBRARY_NAMES.txt index ec2a3813c..437acce95 100644 --- a/LIBRARY_NAMES.txt +++ b/LIBRARY_NAMES.txt @@ -30,7 +30,7 @@ jna.library.path On Windows, multiple library versions may be installed in the system directory under a different name. The following properties can be used to override the JNI and JNA file names respectively: -jni.library.name +commons.crypto.OpenSslNativeJni commons.crypto.OpenSslNativeJna For testing with Maven, these properties can be defined on the command-line: @@ -40,6 +40,6 @@ $ mvn ... -Djni.library.path=/usr/local/lib -Djna.library.path=/usr/local/lib .. Windows: -> mvn ... -D"jni.library.name=libcrypto-1_1-x64" -D"commons.crypto.OpenSslNativeJna=libcrypto-1_1-x64" ... +> mvn ... -D"commons.crypto.OpenSslNativeJni=libcrypto-1_1-x64" -D"commons.crypto.OpenSslNativeJna=libcrypto-1_1-x64" ... diff --git a/pom.xml b/pom.xml index e66b96b92..e584c40e8 100644 --- a/pom.xml +++ b/pom.xml @@ -311,7 +311,7 @@ The following provides more details on the included cryptographic software: testjna - _ + _ diff --git a/src/main/java/org/apache/commons/crypto/Crypto.java b/src/main/java/org/apache/commons/crypto/Crypto.java index 3cc225d97..b4519cc3a 100644 --- a/src/main/java/org/apache/commons/crypto/Crypto.java +++ b/src/main/java/org/apache/commons/crypto/Crypto.java @@ -91,7 +91,7 @@ private static Properties getComponentProperties() { /** * Override property for the default SSL crypto library name when using JNI */ - public static final String JNI_LIBRARY_NAME = "jni.library.name"; + public static final String JNI_LIBRARY_NAME = "commons.crypto.OpenSslNativeJni"; /** * Where to find the SSL crypto library when using JNA