Skip to content

Commit

Permalink
Remove JNA from server dependencies (elastic#110809)
Browse files Browse the repository at this point in the history
All native methods are now bound through NativeAccess. This commit
removes the jna dependency from server.

relates elastic#104876
  • Loading branch information
rjernst authored Jul 13, 2024
1 parent e4349f8 commit e6713a5
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 74 deletions.
3 changes: 1 addition & 2 deletions libs/native/jna/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ base {
dependencies {
compileOnly project(':libs:elasticsearch-core')
compileOnly project(':libs:elasticsearch-native')
// TODO: this will become an implementation dep onces jna is removed from server
compileOnly "net.java.dev.jna:jna:${versions.jna}"
implementation "net.java.dev.jna:jna:${versions.jna}"

testImplementation(project(":test:framework")) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-native'
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ dependencies {

// access to native functions
implementation project(':libs:elasticsearch-native')
api "net.java.dev.jna:jna:${versions.jna}"

api "co.elastic.logging:log4j2-ecs-layout:${versions.ecsLogging}"
api "co.elastic.logging:ecs-logging-core:${versions.ecsLogging}"
Expand Down
1 change: 0 additions & 1 deletion server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
requires org.elasticsearch.tdigest;
requires org.elasticsearch.simdvec;

requires com.sun.jna;
requires hppc;
requires HdrHistogram;
requires jopt.simple;
Expand Down
64 changes: 0 additions & 64 deletions server/src/main/java/org/elasticsearch/bootstrap/JNACLibrary.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ grant codeBase "${codebase.elasticsearch-cli}" {
permission java.util.PropertyPermission "*", "read,write";
};

grant codeBase "${codebase.jna}" {
// for registering native methods
permission java.lang.RuntimePermission "accessDeclaredMembers";
};

grant codeBase "${codebase.log4j-api}" {
permission java.lang.RuntimePermission "getClassLoader";
};
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ apply plugin: 'elasticsearch.standalone-test'
dependencies {
testImplementation project(":x-pack:plugin:core")
testImplementation project(path: xpackModule('ml'))
testImplementation "net.java.dev.jna:jna:${versions.jna}"
}
2 changes: 1 addition & 1 deletion x-pack/plugin/sql/sql-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {

api project(':x-pack:plugin:sql:sql-client')
api project(":libs:elasticsearch-cli")
runtimeOnly "net.java.dev.jna:jna:${versions.jna}"
implementation "net.java.dev.jna:jna:${versions.jna}"
testImplementation project(":test:framework")
}

Expand Down

0 comments on commit e6713a5

Please sign in to comment.