Skip to content

Commit 26e69a7

Browse files
committed
jdk 17, updates
1 parent 0a901f4 commit 26e69a7

File tree

6 files changed

+81
-101
lines changed

6 files changed

+81
-101
lines changed

.jdkw

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
JDKW_RELEASE=latest
22
JDKW_DIST=zulu
3-
JDKW_BUILD=8.38.0.13
4-
JDKW_VERSION=8.0.212
5-
JDKW_VERBOSE=true
3+
JDKW_BUILD=17.36.13-ca
4+
JDKW_VERSION=17.0.4

Jenkinsfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pipeline {
22
agent {
33
kubernetes {
4-
yamlFile 'kubes-pod.yaml'
54
defaultContainer 'ubuntu'
65
activeDeadlineSeconds 3600
76
idleMinutes 15

jdk-wrapper.sh

Lines changed: 60 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
# For documentation please refer to:
1818
# https://github.com/KoskiLabs/jdk-wrapper/blob/master/README.md
1919

20+
HTTP_PROTOCOL="http"
21+
FILE_PROTOCOL="file"
22+
23+
LATEST_RELEASE="latest"
24+
SNAPSHOT_RELEASE="snapshot"
25+
2026
log_err() {
2127
l_prefix=$(date +'%H:%M:%S')
2228
printf "[%s] %s\\n" "${l_prefix}" "$@" 1>&2;
@@ -42,37 +48,63 @@ safe_command() {
4248

4349
checksum() {
4450
l_file="$1"
45-
checksum_exec=""
46-
checksum_args=""
51+
l_checksum_exec=""
52+
l_checksum_args=""
4753
if command -v sha256sum > /dev/null; then
48-
checksum_exec="sha256sum"
54+
l_checksum_exec="sha256sum"
4955
elif command -v shasum > /dev/null; then
50-
checksum_exec="shasum"
51-
checksum_args="-a 256"
56+
l_checksum_exec="shasum"
57+
l_checksum_args="-a 256"
5258
elif command -v sha1sum > /dev/null; then
53-
checksum_exec="sha1sum"
59+
l_checksum_exec="sha1sum"
5460
elif command -v md5 > /dev/null; then
55-
checksum_exec="md5"
61+
l_checksum_exec="md5"
5662
fi
57-
if [ -z "${checksum_exec}" ]; then
63+
if [ -z "${l_checksum_exec}" ]; then
5864
log_err "ERROR: No supported checksum command found!"
5965
exit 1
6066
fi
61-
${checksum_exec} ${checksum_args} < "${l_file}"
67+
${l_checksum_exec} ${l_checksum_args} < "${l_file}"
6268
}
6369

6470
rand() {
6571
awk 'BEGIN {srand();printf "%d\n", (rand() * 10^8);}'
6672
}
6773

68-
download_if_needed() {
69-
file="$1"
70-
path="$2"
71-
if [ ! -f "${path}/${file}" ]; then
72-
jdkw_url="${JDKW_BASE_URI}/releases/download/${JDKW_RELEASE}/${file}"
73-
log_out "Downloading ${file} from ${jdkw_url}"
74-
safe_command "curl ${curl_options} -f -k -L -o \"${path}/${file}\" \"${jdkw_url}\""
75-
safe_command "chmod +x \"${path}/${file}\""
74+
get_protocol() {
75+
case "${JDKW_BASE_URI}" in
76+
http://*|https://*)
77+
printf "%s" "${HTTP_PROTOCOL}"
78+
;;
79+
file://*)
80+
printf "%s" "${FILE_PROTOCOL}"
81+
;;
82+
*)
83+
log_err "ERROR: Unsupported protocol in JDKW_BASE_URI: ${JDKW_BASE_URI}"
84+
exit 1
85+
esac
86+
}
87+
88+
obtain_if_needed() {
89+
l_file="$1"
90+
l_target_path="$2"
91+
if [ ! -f "${l_target_path}/${l_file}" ]; then
92+
case "${JDKW_BASE_URI}" in
93+
http://*|https://*)
94+
l_jdkw_url="${JDKW_BASE_URI}/releases/download/${JDKW_RELEASE}/${l_file}"
95+
log_out "Downloading ${l_file} from ${l_jdkw_url}"
96+
safe_command "curl ${curl_options} -f -k -L -o \"${l_target_path}/${l_file}\" \"${l_jdkw_url}\""
97+
;;
98+
file://*)
99+
l_jdkw_path="${JDKW_BASE_URI#file://}/${l_file}"
100+
log_out "Copying ${l_file} from ${l_jdkw_path}"
101+
safe_command "cp \"${l_jdkw_path}\" \"${l_target_path}/${l_file}\""
102+
;;
103+
*)
104+
log_err "ERROR: Unsupported protocol in JDKW_BASE_URI: ${JDKW_BASE_URI}"
105+
exit 1
106+
esac
107+
safe_command "chmod +x \"${l_target_path}/${l_file}\""
76108
fi
77109
}
78110

@@ -98,7 +130,6 @@ done < "${l_fifo}"
98130
safe_command "rm \"${l_fifo}\""
99131

100132
# Process (but do not load) properties from command line arguments
101-
command=
102133
cmd_configuration=
103134
for arg in "$@"; do
104135
jdkw_arg=$(echo "${arg}" | grep '^JDKW_.*')
@@ -109,13 +140,6 @@ for arg in "$@"; do
109140
if [ -n "${jdkw_arg}" ]; then
110141
cmd_configuration="${cmd_configuration}${arg} "
111142
fi
112-
case "${arg}" in
113-
*\'*)
114-
arg=$(printf "%s" "$arg" | sed "s/'/'\"'\"'/g")
115-
;;
116-
*) : ;;
117-
esac
118-
command="${command} '${arg}'"
119143
done
120144

121145
# Default base directory to current working directory
@@ -144,7 +168,10 @@ if [ -z "${JDKW_BASE_URI}" ]; then
144168
JDKW_BASE_URI="https://github.com/KoskiLabs/jdk-wrapper"
145169
fi
146170
if [ -z "${JDKW_RELEASE}" ]; then
147-
JDKW_RELEASE="latest"
171+
JDKW_RELEASE="${LATEST_RELEASE}"
172+
if [ $(get_protocol) = "${FILE_PROTOCOL}" ]; then
173+
JDKW_RELEASE="${SNAPSHOT_RELEASE}"
174+
fi
148175
log_out "Defaulted to version ${JDKW_RELEASE}"
149176
fi
150177
if [ -z "${JDKW_TARGET}" ]; then
@@ -156,7 +183,7 @@ if [ -z "${JDKW_VERBOSE}" ]; then
156183
fi
157184

158185
# Resolve latest version
159-
if [ "${JDKW_RELEASE}" = "latest" ]; then
186+
if [ "${JDKW_RELEASE}" = "${LATEST_RELEASE}" ]; then
160187
latest_version_json="${TMPDIR:-/tmp}/jdkw-latest-version-$$.$(rand)"
161188
safe_command "curl ${curl_options} -f -k -L -o \"${latest_version_json}\" -H 'Accept: application/json' \"${JDKW_BASE_URI}/releases/latest\""
162189
JDKW_RELEASE=$(sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/' < "${latest_version_json}")
@@ -166,6 +193,10 @@ fi
166193

167194
# Ensure target directory exists
168195
jdkw_path="${JDKW_TARGET}/jdkw/${JDKW_RELEASE}"
196+
if [ -d "${jdkw_path}" ] && [ "${JDKW_RELEASE}" = "${SNAPSHOT_RELEASE}" ]; then
197+
log_out "Removing target snapshot directory ${jdkw_path}"
198+
safe_command "rm -rf \"${jdkw_path}\""
199+
fi
169200
if [ ! -d "${jdkw_path}" ]; then
170201
log_out "Creating target directory ${jdkw_path}"
171202
safe_command "mkdir -p \"${jdkw_path}\""
@@ -174,8 +205,8 @@ fi
174205
# Download the jdk wrapper version
175206
jdkw_impl="jdkw-impl.sh"
176207
jdkw_wrapper="jdk-wrapper.sh"
177-
download_if_needed "${jdkw_impl}" "${jdkw_path}"
178-
download_if_needed "${jdkw_wrapper}" "${jdkw_path}"
208+
obtain_if_needed "${jdkw_impl}" "${jdkw_path}"
209+
obtain_if_needed "${jdkw_wrapper}" "${jdkw_path}"
179210

180211
# Check whether this wrapper is the one specified for this version
181212
jdkw_download="${jdkw_path}/${jdkw_wrapper}"

kubes-pod.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

maven/maven-wrapper.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Maven download properties
2-
#Wed May 13 22:36:51 UTC 2020
3-
checksumAlgorithm=SHA1
2+
#Wed Jan 19 23:16:22 PST 2022
3+
distributionUrl=https\://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
44
verifyDownload=true
5-
distributionUrl=https\://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
5+
checksumAlgorithm=SHA1

pom.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>com.arpnetworking.build</groupId>
2020
<artifactId>arpnetworking-parent-pom</artifactId>
21-
<version>2.0.10</version>
21+
<version>3.0.10</version>
2222
<relativePath />
2323
</parent>
2424

@@ -68,12 +68,13 @@
6868

6969
<properties>
7070
<!--Dependency versions-->
71-
<akka.grpc.version>2.1.0</akka.grpc.version>
72-
<akka.version>2.6.9</akka.version>
73-
<grpc.stub.version>1.41.0</grpc.stub.version>
74-
<guava.version>30.1-android</guava.version>
75-
<protobuf.version>3.11.4</protobuf.version>
76-
<protoc.version>3.11.4</protoc.version>
71+
<akka.grpc.version>2.1.5</akka.grpc.version>
72+
<akka.version>2.6.19</akka.version>
73+
<grpc.stub.version>1.48.1</grpc.stub.version>
74+
<guava.version>31.1-jre</guava.version>
75+
<jax.annotations.version>1.3.2</jax.annotations.version>
76+
<protobuf.version>3.21.5</protobuf.version>
77+
<protoc.version>3.21.5</protoc.version>
7778
<scala.version>2.13</scala.version>
7879

7980
<!--Plugin versions-->
@@ -205,7 +206,7 @@
205206
<dependency>
206207
<groupId>com.typesafe.akka</groupId>
207208
<artifactId>akka-http-core_${scala.version}</artifactId>
208-
<version>10.2.6</version>
209+
<version>10.2.9</version>
209210
<scope>provided</scope>
210211
</dependency>
211212
<dependency>
@@ -235,10 +236,16 @@
235236
<artifactId>grpc-protobuf</artifactId>
236237
<version>${grpc.stub.version}</version>
237238
</dependency>
239+
<dependency>
240+
<groupId>javax.annotation</groupId>
241+
<artifactId>javax.annotation-api</artifactId>
242+
<version>${jax.annotations.version}</version>
243+
<scope>provided</scope>
244+
</dependency>
238245
<dependency>
239246
<groupId>org.scala-lang</groupId>
240247
<artifactId>scala-library</artifactId>
241-
<version>2.13.6</version>
248+
<version>2.13.8</version>
242249
<scope>provided</scope>
243250
</dependency>
244251
</dependencies>

0 commit comments

Comments
 (0)