Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void apply(Project project) {
project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class);
// common repositories setup
project.getPluginManager().apply(JavaBasePlugin.class);
project.getPluginManager().apply(ElasticsearchJavaModulePlugin.class);
//project.getPluginManager().apply(ElasticsearchJavaModulePlugin.class);
project.getPluginManager().apply(RepositoriesSetupPlugin.class);
project.getPluginManager().apply(ElasticsearchTestBasePlugin.class);
project.getPluginManager().apply(PrecommitTaskPlugin.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void apply(Project project) {
// Clear default dependencies added by public PluginBuildPlugin as we add our
// own project dependencies for internal builds
// TODO remove once we removed default dependencies from PluginBuildPlugin
project.getConfigurations().getByName("moduleCompileOnly").getDependencies().clear();
//project.getConfigurations().getByName("moduleCompileOnly").getDependencies().clear();
project.getConfigurations().getByName("compileOnly").getDependencies().clear();
project.getConfigurations().getByName("testImplementation").getDependencies().clear();

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ allprojects {

plugins.withType(InternalPluginBuildPlugin).whenPluginAdded {
project.dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
testImplementation project(":test:framework")
}
}
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/ansi-console/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'elasticsearch.build'
archivesBaseName = 'elasticsearch-ansi-console'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
testImplementation project(":test:framework")

// multi-platform (Windows too) terminal detection and output formatting
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/geoip-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'elasticsearch.build'
archivesBaseName = 'elasticsearch-geoip-cli'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
compileOnly project(":libs:elasticsearch-cli")
compileOnly project(":libs:elasticsearch-x-content")
testImplementation project(":test:framework")
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/keystore-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
apply plugin: 'elasticsearch.build'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
compileOnly project(":libs:elasticsearch-cli")
testImplementation project(":test:framework")
testImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
Expand Down
4 changes: 2 additions & 2 deletions distribution/tools/launchers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
apply plugin: 'elasticsearch.build'

dependencies {
moduleCompileOnly project(':distribution:tools:java-version-checker')
moduleImplementation "org.yaml:snakeyaml:${versions.snakeyaml}"
compileOnly project(':distribution:tools:java-version-checker')
implementation "org.yaml:snakeyaml:${versions.snakeyaml}"
testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testImplementation "junit:junit:${versions.junit}"
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/plugin-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'elasticsearch.build'
archivesBaseName = 'elasticsearch-plugin-cli'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
compileOnly project(":libs:elasticsearch-cli")
api "org.bouncycastle:bcpg-fips:1.0.4"
api "org.bouncycastle:bc-fips:1.0.2"
Expand Down
4 changes: 4 additions & 0 deletions libs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* Side Public License, v 1.
*/

plugins {
id "de.jjohannes.extra-java-module-info" version "0.11"
}

configure(subprojects - project('elasticsearch-log4j')) {
/*
* All subprojects are java projects using Elasticsearch's standard build
Expand Down
17 changes: 15 additions & 2 deletions libs/cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@
*/
apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.publish'
apply plugin: "de.jjohannes.extra-java-module-info"

java {
modularity.inferModulePath = true
}

tasks.named('compileJava') {
modularity.inferModulePath = true
}

extraJavaModuleInfo {
automaticModule('jopt-simple-5.0.2.jar', 'jopt.simple')
}

dependencies {
moduleApi 'net.sf.jopt-simple:jopt-simple:5.0.2'
moduleApi project(':libs:elasticsearch-core')
api 'net.sf.jopt-simple:jopt-simple:5.0.2'
api project(':libs:elasticsearch-core')
}

tasks.named("test").configure { enabled = false }
Expand Down
15 changes: 14 additions & 1 deletion libs/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@
*/

apply plugin: 'elasticsearch.publish'
apply plugin: "de.jjohannes.extra-java-module-info"

java {
modularity.inferModulePath = true
}

tasks.named('compileJava') {
modularity.inferModulePath = true
}

extraJavaModuleInfo {
automaticModule('jsr305-3.0.2.jar', 'jsr305')
}

dependencies {
// This dependency is used only by :libs:core for null-checking interop with other tools
moduleCompileOnly "com.google.code.findbugs:jsr305:3.0.2"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"

testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testImplementation "junit:junit:${versions.junit}"
Expand Down
12 changes: 10 additions & 2 deletions libs/lz4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
*/
apply plugin: 'elasticsearch.publish'

java {
modularity.inferModulePath = true
}

tasks.named('compileJava') {
modularity.inferModulePath = true
}

dependencies {
moduleApi 'org.lz4:lz4-java:1.8.0'
moduleApi project(':libs:elasticsearch-core')
api 'org.lz4:lz4-java:1.8.0'
api project(':libs:elasticsearch-core')

testImplementation(project(":test:framework")) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-lz4'
Expand Down
10 changes: 9 additions & 1 deletion libs/x-content/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ import java.util.stream.Collectors
apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.publish'

java {
modularity.inferModulePath = true
}

tasks.named('compileJava') {
modularity.inferModulePath = true
}

configurations {
providerImpl {
attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
Expand All @@ -32,7 +40,7 @@ dependencies {

})

moduleApi project(':libs:elasticsearch-core')
api project(':libs:elasticsearch-core')

providerImpl project(':libs:elasticsearch-x-content:impl')

Expand Down
18 changes: 11 additions & 7 deletions libs/x-content/impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ apply plugin: 'elasticsearch.java'
archivesBaseName = "x-content-impl"

dependencies {
moduleCompileOnly project(':libs:elasticsearch-core')
moduleCompileOnly project(':libs:elasticsearch-x-content')
moduleImplementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
moduleImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}"
moduleImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
moduleImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
moduleImplementation "org.yaml:snakeyaml:${versions.snakeyaml}"
compileOnly project(':libs:elasticsearch-core')
compileOnly project(':libs:elasticsearch-x-content')
implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
implementation "org.yaml:snakeyaml:${versions.snakeyaml}"

testImplementation(project(":test:framework")) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-x-content'
Expand All @@ -44,3 +44,7 @@ tasks.named("thirdPartyAudit").configure {
'com.fasterxml.jackson.databind.cfg.MapperBuilder'
)
}

java {
modularity.inferModulePath = true
}
2 changes: 1 addition & 1 deletion modules/lang-painless/spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ group = 'org.elasticsearch.plugin'
archivesBaseName = 'elasticsearch-scripting-painless-spi'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
testImplementation project(":test:framework")
}
56 changes: 28 additions & 28 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,46 @@ archivesBaseName = 'elasticsearch'

dependencies {

moduleApi project(':libs:elasticsearch-core')
moduleApi project(':libs:elasticsearch-secure-sm')
moduleApi project(':libs:elasticsearch-x-content')
moduleApi project(":libs:elasticsearch-geo")
moduleApi project(":libs:elasticsearch-lz4")
api project(':libs:elasticsearch-core')
api project(':libs:elasticsearch-secure-sm')
api project(':libs:elasticsearch-x-content')
api project(":libs:elasticsearch-geo")
api project(":libs:elasticsearch-lz4")

moduleImplementation project(':libs:elasticsearch-plugin-classloader')
implementation project(':libs:elasticsearch-plugin-classloader')

// lucene
moduleApi "org.apache.lucene:lucene-core:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-analysis-common:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-backward-codecs:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-grouping:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-highlighter:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-join:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-memory:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-misc:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-queries:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-queryparser:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-sandbox:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-spatial3d:${versions.lucene}"
moduleApi "org.apache.lucene:lucene-suggest:${versions.lucene}"
api "org.apache.lucene:lucene-core:${versions.lucene}"
api "org.apache.lucene:lucene-analysis-common:${versions.lucene}"
api "org.apache.lucene:lucene-backward-codecs:${versions.lucene}"
api "org.apache.lucene:lucene-grouping:${versions.lucene}"
api "org.apache.lucene:lucene-highlighter:${versions.lucene}"
api "org.apache.lucene:lucene-join:${versions.lucene}"
api "org.apache.lucene:lucene-memory:${versions.lucene}"
api "org.apache.lucene:lucene-misc:${versions.lucene}"
api "org.apache.lucene:lucene-queries:${versions.lucene}"
api "org.apache.lucene:lucene-queryparser:${versions.lucene}"
api "org.apache.lucene:lucene-sandbox:${versions.lucene}"
api "org.apache.lucene:lucene-spatial3d:${versions.lucene}"
api "org.apache.lucene:lucene-suggest:${versions.lucene}"

// utilities
moduleApi project(":libs:elasticsearch-cli")
moduleApi 'com.carrotsearch:hppc:0.8.1'
api project(":libs:elasticsearch-cli")
api 'com.carrotsearch:hppc:0.8.1'

// percentiles aggregation
moduleApi 'com.tdunning:t-digest:3.2'
api 'com.tdunning:t-digest:3.2'
// precentil ranks aggregation
moduleApi 'org.hdrhistogram:HdrHistogram:2.1.9'
api 'org.hdrhistogram:HdrHistogram:2.1.9'

// logging
moduleApi "org.apache.logging.log4j:log4j-api:${versions.log4j}"
moduleApi "org.apache.logging.log4j:log4j-core:${versions.log4j}"
api "org.apache.logging.log4j:log4j-api:${versions.log4j}"
api "org.apache.logging.log4j:log4j-core:${versions.log4j}"

moduleApi "net.java.dev.jna:jna:${versions.jna}"
api "net.java.dev.jna:jna:${versions.jna}"

moduleApi "co.elastic.logging:log4j2-ecs-layout:${versions.ecsLogging}"
moduleApi "co.elastic.logging:ecs-logging-core:${versions.ecsLogging}"
api "co.elastic.logging:log4j2-ecs-layout:${versions.ecsLogging}"
api "co.elastic.logging:ecs-logging-core:${versions.ecsLogging}"

testImplementation(project(":test:framework")) {
// tests use the locally compiled version of server
Expand Down
20 changes: 20 additions & 0 deletions server/src/main/java/org/elasticsearch/bootstrap/ESPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,29 @@ public boolean implies(ProtectionDomain domain, Permission permission) {
}

// otherwise defer to template + dynamic file permissions
// if (template.implies(domain, permission)) {
// //System.out.println("template implies:" + permission + ", for loc:" + location);
// return true;
// } else if (dynamic.implies(permission)) {
// //System.out.println("dynamic implies:" + permission + ", for loc:" + location);
// return true;
// } else if (system.implies(domain, permission)) {
// //System.out.println("system implies:" + permission + ", for loc:" + location);
// return true;
// }
// if (recurse.get() == false) {
// try {
// recurse.set(true);
// System.out.println("no implies for:" + permission + ", for loc:" + location);
// } finally {
// recurse.set(false);
// }
// }
return template.implies(domain, permission) || dynamic.implies(permission) || system.implies(domain, permission);
}

private final ThreadLocal<Boolean> recurse = ThreadLocal.withInitial(() -> false);

/**
* Classy puzzler to rethrow any checked exception as an unchecked one.
*/
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ archivesBaseName = 'x-pack-analytics'
dependencies {
api 'org.apache.commons:commons-math3:3.6.1'
compileOnly project(path: xpackModule('core'))
moduleCompileOnly project(":server")
compileOnly project(":server")
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation(project(":client:rest-high-level"))
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/async-search/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ archivesBaseName = 'x-pack-async-search'
addQaCheckDependencies()

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")

compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/async/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ esplugin {
archivesBaseName = 'x-pack-async'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
compileOnly project(path: xpackModule('core'))
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/ccr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tasks.named('internalClusterTest').configure {
addQaCheckDependencies()

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")

compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tasks.named("dependencyLicenses").configure {
}

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
api project(":libs:elasticsearch-ssl-config")
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/mapper-aggregate-metric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esplugin {
archivesBaseName = 'x-pack-aggregate-metric'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")

compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/rollup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ esplugin {
archivesBaseName = 'x-pack-rollup'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
compileOnly project(path: xpackModule('core'))
compileOnly project(path: xpackModule('analytics'))
compileOnly project(path: xpackModule('mapper-aggregate-metric'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.build'
archivesBaseName = 'preallocate'

dependencies {
moduleCompileOnly project(":server")
compileOnly project(":server")
}

tasks.named("testingConventions").configure { enabled = false }
Loading