File tree Expand file tree Collapse file tree 8 files changed +43
-8
lines changed
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal
org/elasticsearch/tools/java_version_checker
org/elasticsearch/tools/launchers Expand file tree Collapse file tree 8 files changed +43
-8
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ public void execute(Task task) {
6363 }
6464
6565 private static final String ES_JAR_PREFIX = "elasticsearch-" ;
66- // ES jars in the lib directory that are not modularized. For now, launchers and es-log4j are the only ones
67- private static final List <String > ES_JAR_EXCLUDES = List .of ("elasticsearch-launchers" , "elasticsearch- log4j" );
66+ // ES jars in the lib directory that are not modularized. For now, es-log4j is the only one
67+ private static final List <String > ES_JAR_EXCLUDES = List .of ("elasticsearch-log4j" );
6868
6969 private static Predicate <Path > isESJar = path -> path .getFileName ().toString ().startsWith (ES_JAR_PREFIX );
7070 private static Predicate <Path > isNotExcluded = path -> ES_JAR_EXCLUDES .stream ()
@@ -98,6 +98,8 @@ private static void assertAllESJarsAreModular(Path libsPath) {
9898 "org.elasticsearch.cli" ,
9999 "org.elasticsearch.core" ,
100100 "org.elasticsearch.geo" ,
101+ "org.elasticsearch.java_version_checker" ,
102+ "org.elasticsearch.launchers" ,
101103 "org.elasticsearch.lz4" ,
102104 "org.elasticsearch.plugin.classloader" ,
103105 "org.elasticsearch.secure_sm" ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ while [ $# -gt 0 ]; do
4444done
4545
4646if [ -z " $ES_TMPDIR " ]; then
47- ES_TMPDIR=` " $JAVA " " $XSHARE " -cp " $ES_CLASSPATH " org.elasticsearch.tools.launchers.TempDirectory`
47+ ES_TMPDIR=` " $JAVA " " $XSHARE " --module-path " $ES_MODULEPATH " -m org.elasticsearch.launchers/ org.elasticsearch.tools.launchers.TempDirectory`
4848fi
4949
5050if [ -z " $LIBFFI_TMPDIR " ]; then
106106# - second, JVM options are read from jvm.options and jvm.options.d/*.options
107107# - third, JVM options from ES_JAVA_OPTS are applied
108108# - fourth, ergonomic JVM options are applied
109- ES_JAVA_OPTS=` export ES_TMPDIR; " $JAVA " " $XSHARE " -cp " $ES_CLASSPATH " org.elasticsearch.tools.launchers.JvmOptionsParser " $ES_PATH_CONF " " $ES_HOME /plugins" `
109+ ES_JAVA_OPTS=` export ES_TMPDIR; " $JAVA " " $XSHARE " --module-path " $ES_MODULEPATH " -m org.elasticsearch.launchers/ org.elasticsearch.tools.launchers.JvmOptionsParser " $ES_PATH_CONF " " $ES_HOME /plugins" `
110110
111111# Remove enrollment related parameters before passing the arg list to Elasticsearch
112112for i in " ${! ARG_LIST[@]} " ; do
Original file line number Diff line number Diff line change 11apply plugin : ' elasticsearch.build'
22
3- targetCompatibility = JavaVersion . VERSION_1_7
4-
53// java_version_checker do not depend on core so only JDK signatures should be checked
64tasks. named(' forbiddenApisMain' ). configure {
75 replaceSignatureFiles ' jdk-signatures'
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License
4+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6+ * Side Public License, v 1.
7+ */
8+
9+ module org .elasticsearch .java_version_checker {
10+ exports org .elasticsearch .tools .java_version_checker ;
11+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ public class JavaVersion {
1717 public static final List <Integer > CURRENT = parse (System .getProperty ("java.specification.version" ));
1818 public static final List <Integer > JAVA_17 = parse ("17" );
1919
20+ private JavaVersion () {}
21+
2022 static List <Integer > parse (final String value ) {
2123 if (value .matches ("^0*[0-9]+(\\ .[0-9]+)*$" ) == false ) {
2224 throw new IllegalArgumentException (value );
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
1010apply plugin : ' elasticsearch.build'
1111
1212dependencies {
13- compileOnly project(' :distribution:tools:java-version-checker' )
14- implementation " org.yaml:snakeyaml:${ versions.snakeyaml} "
13+ moduleCompileOnly project(' :distribution:tools:java-version-checker' )
14+ moduleImplementation " org.yaml:snakeyaml:${ versions.snakeyaml} "
1515 testImplementation " com.carrotsearch.randomizedtesting:randomizedtesting-runner:${ versions.randomizedrunner} "
1616 testImplementation " junit:junit:${ versions.junit} "
1717 testImplementation " org.hamcrest:hamcrest:${ versions.hamcrest} "
@@ -35,3 +35,7 @@ tasks.named("testingConventions").configure {
3535[" javadoc" , " loggerUsageCheck" , " jarHell" ]. each { tsk ->
3636 tasks. named(tsk). configure { enabled = false }
3737}
38+
39+ tasks. named(" compileJava" ). configure {
40+ options. compilerArgs. add(" -Xlint:-requires-automatic" )
41+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License
4+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6+ * Side Public License, v 1.
7+ */
8+
9+ module org .elasticsearch .launchers {
10+ requires jdk .management ;
11+ requires org .elasticsearch .java_version_checker ;
12+ requires org .yaml .snakeyaml ;
13+
14+ exports org .elasticsearch .tools .launchers ;
15+ }
Original file line number Diff line number Diff line change 2525 * additional JVM options, in order to configure the bootstrap plugins.
2626 */
2727public class BootstrapJvmOptions {
28+
29+ private BootstrapJvmOptions () {}
30+
2831 public static List <String > bootstrapJvmOptions (Path plugins ) throws IOException {
2932 if (Files .isDirectory (plugins ) == false ) {
3033 throw new IllegalArgumentException ("Plugins path " + plugins + " must be a directory" );
You can’t perform that action at this time.
0 commit comments