Skip to content

Commit 6449fa5

Browse files
authored
[0.13] chore(jib): update tool versions (#7973)
chore(jib): update tool versions It's been a while since we updated the versions of OpenJDK, maven and gradle that Garden has built-in awareness of. There were also breakages in the jib-container example project, partly due to the base images on Docker hub now requiring a login. This was fixed by using a publicly available registry instead.
1 parent d21ce38 commit 6449fa5

13 files changed

Lines changed: 146 additions & 83 deletions

File tree

docs/reference/action-types/Build/jib-container.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ The chosen version will be downloaded by Garden and used to define `JAVA_HOME` e
447447

448448
To use an arbitrary JDK distribution, please use the `jdkPath` configuration option.
449449

450-
| Type | Allowed Values | Default | Required |
451-
| -------- | ----------------- | ------- | -------- |
452-
| `number` | 8, 11, 13, 17, 21 | `11` | Yes |
450+
| Type | Allowed Values | Default | Required |
451+
| -------- | --------------------- | ------- | -------- |
452+
| `number` | 8, 11, 13, 17, 21, 23 | `11` | Yes |
453453

454454
### `spec.jdkPath`
455455

@@ -508,7 +508,7 @@ Specify the image format in the resulting tar file. Only used if `tarOnly: true`
508508
Defines the location of the custom executable Gradle binary.
509509

510510
If not provided, then the Gradle binary available in the working directory will be used.
511-
If no Gradle binary found in the working dir, then Gradle 7.5.1 will be downloaded and used.
511+
If no Gradle binary found in the working dir, then Gradle 7.6.4 will be downloaded and used.
512512

513513
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Gradle.
514514
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
@@ -523,7 +523,7 @@ To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
523523

524524
Defines the location of the custom executable Maven binary.
525525

526-
If not provided, then Maven 3.8.8 will be downloaded and used.
526+
If not provided, then Maven 3.9.9 will be downloaded and used.
527527

528528
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Maven.
529529
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
@@ -548,7 +548,7 @@ Defines the Maven phases to be executed during the Garden build step.
548548

549549
Defines the location of the custom executable Maven Daemon binary.
550550

551-
If not provided, then Maven Daemon 0.9.0 will be downloaded and used.
551+
If not provided, then Maven Daemon 1.0.2 will be downloaded and used.
552552

553553
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Maven Daemon.
554554
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.

docs/reference/module-types/jib-container.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ build:
9393
# Defines the location of the custom executable Gradle binary.
9494
#
9595
# If not provided, then the Gradle binary available in the working directory will be used.
96-
# If no Gradle binary found in the working dir, then Gradle 7.5.1 will be downloaded and used.
96+
# If no Gradle binary found in the working dir, then Gradle 7.6.4 will be downloaded and used.
9797
#
9898
# **Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom
9999
# Gradle.
@@ -102,7 +102,7 @@ build:
102102

103103
# Defines the location of the custom executable Maven binary.
104104
#
105-
# If not provided, then Maven 3.8.8 will be downloaded and used.
105+
# If not provided, then Maven 3.9.9 will be downloaded and used.
106106
#
107107
# **Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom
108108
# Maven.
@@ -114,7 +114,7 @@ build:
114114

115115
# Defines the location of the custom executable Maven Daemon binary.
116116
#
117-
# If not provided, then Maven Daemon 0.9.0 will be downloaded and used.
117+
# If not provided, then Maven Daemon 1.0.2 will be downloaded and used.
118118
#
119119
# **Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom
120120
# Maven Daemon.
@@ -971,9 +971,9 @@ The chosen version will be downloaded by Garden and used to define `JAVA_HOME` e
971971

972972
To use an arbitrary JDK distribution, please use the `jdkPath` configuration option.
973973

974-
| Type | Allowed Values | Default | Required |
975-
| -------- | ----------------- | ------- | -------- |
976-
| `number` | 8, 11, 13, 17, 21 | `11` | Yes |
974+
| Type | Allowed Values | Default | Required |
975+
| -------- | --------------------- | ------- | -------- |
976+
| `number` | 8, 11, 13, 17, 21, 23 | `11` | Yes |
977977

978978
### `build.jdkPath`
979979

@@ -1032,7 +1032,7 @@ Specify the image format in the resulting tar file. Only used if `tarOnly: true`
10321032
Defines the location of the custom executable Gradle binary.
10331033

10341034
If not provided, then the Gradle binary available in the working directory will be used.
1035-
If no Gradle binary found in the working dir, then Gradle 7.5.1 will be downloaded and used.
1035+
If no Gradle binary found in the working dir, then Gradle 7.6.4 will be downloaded and used.
10361036

10371037
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Gradle.
10381038
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
@@ -1047,7 +1047,7 @@ To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
10471047

10481048
Defines the location of the custom executable Maven binary.
10491049

1050-
If not provided, then Maven 3.8.8 will be downloaded and used.
1050+
If not provided, then Maven 3.9.9 will be downloaded and used.
10511051

10521052
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Maven.
10531053
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.
@@ -1072,7 +1072,7 @@ Defines the Maven phases to be executed during the Garden build step.
10721072

10731073
Defines the location of the custom executable Maven Daemon binary.
10741074

1075-
If not provided, then Maven Daemon 0.9.0 will be downloaded and used.
1075+
If not provided, then Maven Daemon 1.0.2 will be downloaded and used.
10761076

10771077
**Note!** Either `jdkVersion` or `jdkPath` will be used to define `JAVA_HOME` environment variable for the custom Maven Daemon.
10781078
To ensure a system JDK usage, please set `jdkPath` to `${local.env.JAVA_HOME}`.

examples/jib-container/helloworld/build.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'com.google.cloud.tools.jib' version '3.1.4'
3+
id 'com.google.cloud.tools.jib' version '3.4.3'
44
}
55

66
sourceCompatibility = 1.8
@@ -14,5 +14,17 @@ dependencies {
1414
compile 'com.google.guava:guava:32.0.0-jre'
1515
}
1616

17+
jib {
18+
from {
19+
image = 'public.ecr.aws/docker/library/eclipse-temurin:8-jre'
20+
platforms {
21+
platform {
22+
architecture = System.getProperty("os.arch") == "aarch64" ? "arm64" : "amd64"
23+
os = "linux"
24+
}
25+
}
26+
}
27+
}
28+
1729
// Note: Garden sets this automatically.
1830
// jib.to.image = 'gcr.io/REPLACE-WITH-YOUR-GCP-PROJECT/image-built-with-jib'

examples/jib-container/helloworld/pom.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<properties>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12-
<jib-maven-plugin.version>3.1.4</jib-maven-plugin.version>
12+
<jib-maven-plugin.version>3.4.4</jib-maven-plugin.version>
1313
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
1414
</properties>
1515

@@ -38,11 +38,14 @@
3838
<groupId>com.google.cloud.tools</groupId>
3939
<artifactId>jib-maven-plugin</artifactId>
4040
<version>${jib-maven-plugin.version}</version>
41-
<!-- <configuration>
42-
<to>
41+
<configuration>
42+
<from>
43+
<image>public.ecr.aws/docker/library/eclipse-temurin:8-jre</image>
44+
</from>
45+
<!-- <to>
4346
<image>gcr.io/REPLACE-WITH-YOUR-GCP-PROJECT/image-built-with-jib</image>
44-
</to>
45-
</configuration> -->
47+
</to> -->
48+
</configuration>
4649
<executions>
4750
<execution>
4851
<phase>package</phase>

examples/jib-container/spring-boot/build.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'idea'
55
id 'org.springframework.boot' version '2.1.6.RELEASE'
66
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
7-
id 'com.google.cloud.tools.jib' version '3.1.4'
7+
id 'com.google.cloud.tools.jib' version '3.4.3'
88
}
99

1010
repositories {
@@ -17,3 +17,15 @@ targetCompatibility = 1.8
1717
dependencies {
1818
compile('org.springframework.boot:spring-boot-starter-web')
1919
}
20+
21+
jib {
22+
from {
23+
image = 'public.ecr.aws/docker/library/eclipse-temurin:8-jre'
24+
platforms {
25+
platform {
26+
architecture = System.getProperty("os.arch") == "aarch64" ? "arm64" : "amd64"
27+
os = "linux"
28+
}
29+
}
30+
}
31+
}

examples/jib-container/spring-boot/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
<plugin>
3030
<groupId>com.google.cloud.tools</groupId>
3131
<artifactId>jib-maven-plugin</artifactId>
32-
<version>3.1.4</version>
32+
<version>3.4.4</version>
33+
<configuration>
34+
<from>
35+
<image>public.ecr.aws/docker/library/eclipse-temurin:8-jre</image>
36+
</from>
37+
</configuration>
3338
</plugin>
3439
</plugins>
3540
</build>

plugins/jib/src/gradle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const { pathExists } = fsExtra
1515
import type { BuildToolParams, VerifyBinaryParams } from "./build-tool-base.js"
1616
import { runBuildTool, verifyBinaryPath } from "./build-tool-base.js"
1717

18-
export const gradleVersion = "7.5.1"
18+
export const gradleVersion = "7.6.4"
1919

2020
const spec = {
2121
url: `https://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip`,
22-
sha256: "f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4",
22+
sha256: "bed1da33cca0f557ab13691c77f38bb67388119e4794d113e051039b80af9bb1",
2323
extract: {
2424
format: "zip",
2525
targetPath: `gradle-${gradleVersion}/bin/gradle`,

plugins/jib/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const jibBuildSchemaKeys = () => ({
6060
jdkVersion: joi
6161
.number()
6262
.integer()
63-
.valid(8, 11, 13, 17, 21)
63+
.valid(8, 11, 13, 17, 21, 23)
6464
.default(11)
6565
.description(
6666
dedent`

plugins/jib/src/maven.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { runBuildTool, verifyBinaryPath } from "./build-tool-base.js"
1515

1616
const buildLock = new AsyncLock()
1717

18-
export const mvnVersion = "3.8.8"
18+
export const mvnVersion = "3.9.9"
1919

2020
const spec = {
2121
url: `https://archive.apache.org/dist/maven/maven-3/${mvnVersion}/binaries/apache-maven-${mvnVersion}-bin.tar.gz`,
22-
sha256: "17811e108701af5985bf5167abbd47c06e92c6c6bd1c13a1a1c095c9b4ecc32a",
22+
sha256: "7a9cdf674fc1703d6382f5f330b3d110ea1b512b51f1652846d9e4e8a588d766",
2323
extract: {
2424
format: "tar",
2525
targetPath: `apache-maven-${mvnVersion}/bin/mvn`,
@@ -57,7 +57,7 @@ export const mavenSpec: PluginToolSpec = {
5757
architecture: "amd64",
5858
...spec,
5959
url: `https://archive.apache.org/dist/maven/maven-3/${mvnVersion}/binaries/apache-maven-${mvnVersion}-bin.zip`,
60-
sha256: "2e181515ce8ae14b7a904c40bb4794831f5fd1d9641107a13b916af15af4001a",
60+
sha256: "4ec3f26fb1a692473aea0235c300bd20f0f9fe741947c82c1234cefd76ac3a3c",
6161
extract: {
6262
format: "zip",
6363
targetPath: spec.extract.targetPath + ".cmd",

plugins/jib/src/mavend.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,29 @@ import { runBuildTool, verifyBinaryPath } from "./build-tool-base.js"
1515

1616
const buildLock = new AsyncLock()
1717

18-
export const mvndVersion = "0.9.0"
18+
export const mvndVersion = "1.0.2"
1919

2020
const mvndSpec = {
2121
baseUrl: `https://github.com/apache/maven-mvnd/releases/download/${mvndVersion}/`,
22-
// 0.9.0 has no ARM64 build for linux yet
23-
// Should be fixed once 1.0.0 is released
22+
// 1.0.2 still has no ARM64 build for linux
2423
linux_amd64: {
2524
filename: `maven-mvnd-${mvndVersion}-linux-amd64.tar.gz`,
26-
sha256: "64acc68f2a3e25a0662eb62bf87cf2641706245505572ca1d20f933c7190f148",
25+
sha256: "a5990f4cfd4aa3307a4c5c86d6cfdd13a0bd394a6b07c6bb64efa7decb342205",
2726
targetPath: `maven-mvnd-${mvndVersion}-linux-amd64/bin/mvnd`,
2827
},
2928
darwin_arm64: {
3029
filename: `maven-mvnd-${mvndVersion}-darwin-aarch64.tar.gz`,
31-
sha256: "bca67a44cc3716a7da46926acff41b3864d62e5da6982b9e998eca42d2f9bfac",
30+
sha256: "a0f9fe345ca76726806fc17ef78caf73e3e1887921c8c156d53341564803e24b",
3231
targetPath: `maven-mvnd-${mvndVersion}-darwin-aarch64/bin/mvnd`,
3332
},
3433
darwin_amd64: {
3534
filename: `maven-mvnd-${mvndVersion}-darwin-amd64.tar.gz`,
36-
sha256: "b94fb24d92cd971b6368df14f44bf77b5614a422dfe9f6f115b32b11860c1d6b",
35+
sha256: "926b0512ac3df2dd05770f61eeafbf97cfeafd14bb903fdea90b34bc8165ad21",
3736
targetPath: `maven-mvnd-${mvndVersion}-darwin-amd64/bin/mvnd`,
3837
},
3938
windows: {
4039
filename: `maven-mvnd-${mvndVersion}-windows-amd64.zip`,
41-
sha256: "07205da7f84db53fdffc55079b817789267b661f39978a2b2ad4f2584dc812ba",
40+
sha256: "c48cdbee495b6d93a171648801a4485bef10f1f0d0ee3eb64a5ee67f8ae77461",
4241
targetPath: `maven-mvnd-${mvndVersion}-windows-amd64/bin/mvnd.cmd`,
4342
},
4443
}

0 commit comments

Comments
 (0)