Skip to content

Commit 01768c3

Browse files
authored
Bump gradle plugin versions previously blocked by Java8 support (#35586)
* Bump gradle plugin versions previously blocked by Java8 support Now we dropped Java8 support to build Beam, we can bump the following plugins * Shadow plugin to 8.3.8 * grgit-gradle to 5.3.2 * Remove Java8 logic for Errorprone * Clean up docs
1 parent db3058a commit 01768c3

File tree

14 files changed

+21
-25
lines changed

14 files changed

+21
-25
lines changed

.github/workflows/beam_PreCommit_Java_Examples_Dataflow_Java21.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ jobs:
9393
comment_phrase: ${{ matrix.job_phrase }}
9494
github_token: ${{ secrets.GITHUB_TOKEN }}
9595
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
96-
# The test requires Java 21 and Java 8 versions.
97-
# Java 8 is installed second because JAVA_HOME needs to point to Java 8.
96+
# The test requires Java 21 and Java 11 versions.
97+
# Java 11 is installed second because JAVA_HOME needs to point to Java 11.
9898
- name: Setup environment
9999
uses: ./.github/actions/setup-environment-action
100100
with:

.github/workflows/beam_PreCommit_SQL_Java17.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ jobs:
7878
comment_phrase: ${{ matrix.job_phrase }}
7979
github_token: ${{ secrets.GITHUB_TOKEN }}
8080
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
81-
# The test requires Java 17 and Java 8 versions.
82-
# Java 8 is installed second because JAVA_HOME needs to point to Java 8.
81+
# The test requires Java 17 and Java 11 versions.
82+
# Java 11 is installed second because JAVA_HOME needs to point to Java 11.
8383
- name: Setup environment
8484
uses: ./.github/actions/setup-environment-action
8585
with:

buildSrc/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ repositories {
4141
dependencies {
4242
implementation(gradleApi())
4343
implementation(localGroovy())
44-
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.1")
44+
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.8") { // Enable shading Java dependencies
45+
exclude(group="org.codehaus.plexus", module="plexus-xml") // plexus-xml 4.x requires Java17
46+
}
47+
runtimeOnly("org.codehaus.plexus:plexus-xml:3.0.2")
4548
implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14")
4649

4750
runtimeOnly("com.google.protobuf:protobuf-gradle-plugin:0.8.13") // Enable proto code generation
4851
runtimeOnly("com.github.davidmc24.gradle.plugin:gradle-avro-plugin:1.9.1") // Enable Avro code generation. Version 1.1.0 is the last supporting avro 1.10.2
4952
runtimeOnly("com.diffplug.spotless:spotless-plugin-gradle:5.6.1") // Enable a code formatting plugin
5053
runtimeOnly("gradle.plugin.com.dorongold.plugins:task-tree:1.5") // Adds a 'taskTree' task to print task dependency tree
51-
runtimeOnly("gradle.plugin.com.github.johnrengelman:shadow:7.1.1") // Enable shading Java dependencies
5254
runtimeOnly("net.linguica.gradle:maven-settings-plugin:0.5")
5355
runtimeOnly("gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.5.0") // Enable creating an offline repository
5456
runtimeOnly("net.ltgt.gradle:gradle-errorprone-plugin:3.1.0") // Enable errorprone Java static analysis
55-
runtimeOnly("org.ajoberstar.grgit:grgit-gradle:4.1.1") // Enable website git publish to asf-site branch
57+
runtimeOnly("org.ajoberstar.grgit:grgit-gradle:5.3.2") // Enable website git publish to asf-site branch
5658
runtimeOnly("com.avast.gradle:gradle-docker-compose-plugin:0.16.12") // Enable docker compose tasks
5759
runtimeOnly("ca.cutterslade.gradle:gradle-dependency-analyze:1.8.3") // Enable dep analysis
5860
runtimeOnly("gradle.plugin.net.ossindex:ossindex-gradle-plugin:0.4.11") // Enable dep vulnerability analysis

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,11 +1495,6 @@ class BeamModulePlugin implements Plugin<Project> {
14951495
project.dependencies {
14961496
errorprone("com.google.errorprone:error_prone_core:$errorprone_version")
14971497
errorprone("jp.skypencil.errorprone.slf4j:errorprone-slf4j:0.1.2")
1498-
// At least JDk 9 compiler is required, however JDK 8 still can be used but with additional errorproneJavac
1499-
// configuration. For more details please see https://github.com/tbroyer/gradle-errorprone-plugin#jdk-8-support
1500-
if (JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) == 0) {
1501-
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
1502-
}
15031498
}
15041499

15051500
project.configurations.errorprone { resolutionStrategy.force "com.google.errorprone:error_prone_core:$errorprone_version" }
@@ -1512,8 +1507,7 @@ class BeamModulePlugin implements Plugin<Project> {
15121507
// i.e. Java 9 and up. The flags became mandatory in Java 17 with JEP-403.
15131508
// The -J prefix is not needed if forkOptions.javaHome is unset,
15141509
// see http://github.com/gradle/gradle/issues/22747
1515-
if (JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) < 0
1516-
&& options.forkOptions.javaHome == null) {
1510+
if (options.forkOptions.javaHome == null) {
15171511
options.fork = true
15181512
options.forkOptions.jvmArgs += errorProneAddModuleOpts
15191513
}
@@ -1633,7 +1627,7 @@ class BeamModulePlugin implements Plugin<Project> {
16331627
//
16341628
// TODO: Enforce all relocations are always performed to:
16351629
// getJavaRelocatedPath(package_suffix) where package_suffix is something like "com.google.commmon"
1636-
project.apply plugin: 'com.github.johnrengelman.shadow'
1630+
project.apply plugin: 'com.gradleup.shadow'
16371631

16381632
// Create a new configuration 'shadowTest' like 'shadow' for the test scope
16391633
project.configurations {

buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class VendorJavaPlugin implements Plugin<Project> {
8080
config.version += '-SNAPSHOT'
8181
}
8282

83-
project.apply plugin: 'com.github.johnrengelman.shadow'
83+
project.apply plugin: 'com.gradleup.shadow'
8484

8585
project.apply plugin: 'java'
8686

examples/java/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import groovy.json.JsonOutput
2121
plugins {
2222
id 'java'
2323
id 'org.apache.beam.module'
24-
id 'com.github.johnrengelman.shadow'
24+
id 'com.gradleup.shadow'
2525
}
2626

2727
applyJavaNature(

examples/java/cdap/hubspot/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import groovy.json.JsonOutput
2121
plugins {
2222
id 'java'
2323
id 'org.apache.beam.module'
24-
id 'com.github.johnrengelman.shadow'
24+
id 'com.gradleup.shadow'
2525
}
2626

2727
applyJavaNature(

examples/java/cdap/salesforce/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import groovy.json.JsonOutput
2121
plugins {
2222
id 'java'
2323
id 'org.apache.beam.module'
24-
id 'com.github.johnrengelman.shadow'
24+
id 'com.gradleup.shadow'
2525
}
2626

2727
applyJavaNature(

examples/java/cdap/servicenow/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import groovy.json.JsonOutput
2121
plugins {
2222
id 'java'
2323
id 'org.apache.beam.module'
24-
id 'com.github.johnrengelman.shadow'
24+
id 'com.gradleup.shadow'
2525
}
2626

2727
applyJavaNature(

examples/java/cdap/zendesk/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import groovy.json.JsonOutput
2121
plugins {
2222
id 'java'
2323
id 'org.apache.beam.module'
24-
id 'com.github.johnrengelman.shadow'
24+
id 'com.gradleup.shadow'
2525
}
2626

2727
applyJavaNature(

0 commit comments

Comments
 (0)