You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix reproducability of builds against Java EA versions
This fixes a reproducability issue when using the gradle javaToolChain api.
There is no way to test toolchain candidates reliable against the build number in use.
This meant that ones you e.g. have resolved some version of java 25, gradle toolchain detection
does not detect the difference between certain builds (or even ea vs. released version)
Therefore we fallback to rely on our custom JDKDownloadPlugin for now here.
Syncing with the gradle team, they want to fix this somewhen in 9.x. We will revisit our solution
ones something is available. Ultimately we want to get rid of usages of the JDK download plugin.
Copy file name to clipboardExpand all lines: BUILDING.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ uses the changed dependencies. In most cases, `precommit` or `check` are good ca
92
92
We prefer sha256 checksums as md5 and sha1 are not considered safe anymore these days. The generated entry
93
93
will have the `origin` attribute been set to `Generated by Gradle`.
94
94
95
-
> [!Tip]
95
+
> [!Tip]
96
96
> A manual confirmation of the Gradle generated checksums is currently not mandatory.
97
97
> If you want to add a level of verification you can manually confirm the checksum (e.g. by looking it up on the website of the library)
98
98
> Please replace the content of the `origin` attribute by `official site` in that case.
@@ -186,6 +186,25 @@ dependencies {
186
186
187
187
To test an unreleased development version of a third party dependency you have several options.
188
188
189
+
### How do I test against java early access (ea) versions?
190
+
191
+
Currently only openjdk EA builds by oracle are supported.
192
+
To test against an early access version java version you can pass the major java version
193
+
to test against via system property (e.g. -Druntime.java=26):
194
+
195
+
```
196
+
./gradlew clean test -Druntime.java=26
197
+
```
198
+
199
+
This will run the tests using the JDK 26 EA version and pick the latest available build of the matching JDK EA version we expose
200
+
in our custom jdk catalogue at `https://storage.googleapis.com/elasticsearch-jdk-archive/jdks/openjdk/latest.json`.
201
+
202
+
To run against a specific build number of the EA build you can pass a second system property (e.g. `-Druntime.java.build=6`):
203
+
204
+
```
205
+
./gradlew clean test -Druntime.java=26 -Druntime.java.build=6
206
+
```
207
+
189
208
#### How to use a Maven based third party dependency via `mavenlocal`?
190
209
191
210
1. Clone the third party repository locally
@@ -229,7 +248,7 @@ In addition to snapshot builds JitPack supports building Pull Requests. Simply u
229
248
3. Run the Gradle build as needed. Keep in mind the initial resolution might take a bit longer as this needs to be built
230
249
by JitPack in the background before we can resolve the adhoc built dependency.
231
250
232
-
> [!Note]
251
+
> [!Note]
233
252
> You should only use that approach locally or on a developer branch for production dependencies as we do
234
253
not want to ship unreleased libraries into our releases.
235
254
@@ -261,7 +280,7 @@ allprojects {
261
280
```
262
281
4. Run the Gradle build as needed with `--write-verification-metadata` to ensure the Gradle dependency verification does not fail on your custom dependency.
263
282
264
-
> [!Note]
283
+
> [!Note]
265
284
> As Gradle prefers to use modules whose descriptor has been created from real meta-data rather than being generated,
266
285
flat directory repositories cannot be used to override artifacts with real meta-data from other repositories declared in the build.
267
286
> For example, if Gradle finds only `jmxri-1.2.1.jar` in a flat directory repository, but `jmxri-1.2.1.pom` in another repository
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGitAwareGradleFuncTest.groovy
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy
+36-20Lines changed: 36 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,18 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
0 commit comments