You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2023/11/21 01:04:32 UTC
(commons-crypto) branch master updated: Align JNI name override with JNA property
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git
The following commit(s) were added to refs/heads/master by this push:
new 5ce38e74 Align JNI name override with JNA property
5ce38e74 is described below
commit 5ce38e74670c3bf4a5456db9d4f1ac9a8304ec0c
Author: Sebb <se...@apache.org>
AuthorDate: Tue Nov 21 01:04:27 2023 +0000
Align JNI name override with JNA property
(This property has not been used in a release)
---
.github/workflows/maven.yml | 6 +++---
LIBRARY_NAMES.txt | 4 ++--
pom.xml | 2 +-
src/main/java/org/apache/commons/crypto/Crypto.java | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index f3961090..5277bc5a 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 ec2a3813..437acce9 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 e66b96b9..e584c40e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -311,7 +311,7 @@ The following provides more details on the included cryptographic software:
<id>testjna</id>
<properties>
<!-- prevent JNI code from loading -->
- <jni.library.name>_</jni.library.name>
+ <commons.crypto.OpenSslNativeJni>_</commons.crypto.OpenSslNativeJni>
</properties>
<build>
<plugins>
diff --git a/src/main/java/org/apache/commons/crypto/Crypto.java b/src/main/java/org/apache/commons/crypto/Crypto.java
index 3cc225d9..b4519cc3 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 @@ public final class Crypto {
/**
* 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