With Gradle 8.13 we can now auto provision the jdk used by the gradle daemon. Our configuration relies on jdk21.
With this autoprovisioning enabled each gradle build will use adoptium jdk 21 for gradle jvm
This updates the gradle wrapper to 8.12
We addressed deprecation warnings due to the update that includes:
- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
(cherry picked from commit ba61f8c7f7)
# Conflicts:
# build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java
# build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/Fixture.java
# plugins/repository-hdfs/hadoop-client-api/build.gradle
# qa/entitlements/build.gradle
# server/src/main/java/org/elasticsearch/indices/IndicesFeatures.java
# x-pack/plugin/migrate/build.gradle
# x-pack/plugin/security/qa/security-basic/build.gradle
The eclipse formatter used by spotless is resolved at runtime and not declared as
gradle dependency. Therefore we need to run the spotless task to ensure we have
the dependencies resolved as part of our ci image baking.
This should avoid issues with connecting to p2 repos we have experienced lately
in our ci environment
* Revert "[Build] Declare mirror for eclipse p2 repository (#117732)"
This reverts commit c35777a175.
Fix incompatibility with 8.8 and our internal api usages
- Update ospackage to a version that contains a fix we provided
- Tweak build logic to avoid deprecation warnings
- Use newer permission api
- Use custom shadowplugin
- Rework ElasticsearchDistribution dependencies resolution
- Update Gradle wrapper to 8.8
This commit alters our backward compatibility testing logic to restrict
testing to the latest patch release for any given minor version. Since
our policy is not to do any kind of breaking changes in patches, most of
this testing is superfluous. This change reduces the number of versions
we need to test by over 70%.
We want to keep pull request and intake build time as short as possible.
While testing this I noticed though that all those checkPartX runs are basically building core modules e.g. like :server by themself not leveraging the gradle cache ideally as all 4 checkPart jobs running in parallel likely run :server:compileJava in parallel. Not sure this is a big deal. I remember within the gradle team we had similar issues and addressed this by
quick dedicated "populating build cache" pipeline steps. Not something we need to look into now, but at one point investigating this approach might be valuable for certain scenarios.
* Make gradle build finished logic CC compatible
* Make ElasticsearchBuildFinishedPlugin configuration cache aware
* Add gradle enterprise plugin to buildlibs version catalogue
As part of creating our ci images we prefill gradle caches to reduce build times. As part of that we now
also cache the java toolchain we resolve using the gradle toolchain provider
Using gradle toolchain support in gradle requires refactoring how the composite build is composed.
We added three toolchain resolver
1. Resolver for resolving defined bundled version from oracle as openjdk
2. Resolve all available jdks from Adoption
3. Resolve archived Oracle jdk distributions.
We should be able to remove the JdkDownloadPlugin altogether without having that in place, but we'll do that in a separate effort.
Fixes#95094
- Remove custom checksum build logic in wrapper task
- Adjust jdk home handling adjusting the change in behaviour in gradle. Requires providing canonical paths for provisioned jdk homes.
- Fix test by add workaround to bug in configuration cache
This updates the gradle wrapper to 7.6.1. This patch release contains a
fix for incremental compilation of java modules we have raised against
gradle 7.6
see https://github.com/gradle/gradle/issues/23067
* Fix TestResultProcessor api changes
* Fix inputs for generateProviderManifest
* Ignore tests for now until gradle has fixed reporting issue
* Fix dependency substitution in example plugins build
* Use right java bin path on windows
* Add hint to task onlyif when no docker is available