Skip to content

Commit cbf247e

Browse files
authored
Merge pull request #759 from amvanbaren/feature/issue-745
Upgrade to Java 17
2 parents 63eae3e + 6044b88 commit cbf247e

File tree

121 files changed

+674
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+674
-567
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up JDK
2424
uses: actions/setup-java@v1
2525
with:
26-
java-version: 11
26+
java-version: 17
2727
- name: Install Yarn
2828
run: npm install --global yarn
2929
- uses: actions/checkout@v2

.gitpod.dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ ENV DOCKER_BUMP=2
66
USER gitpod
77

88
RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
9-
# Install Java 18 for the Java extension to function properly
10-
&& sdk install java 18.0.1.1-open \
11-
&& sdk install java 11.0.2-open"
9+
&& sdk install java 17.0.7-tem"
1210

13-
RUN curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.11.0-linux-x86_64.tar.gz --output elasticsearch-linux-x86_64.tar.gz \
11+
RUN curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.7.1-linux-x86_64.tar.gz --output elasticsearch-linux-x86_64.tar.gz \
1412
&& tar -xzf elasticsearch-linux-x86_64.tar.gz \
1513
&& rm elasticsearch-linux-x86_64.tar.gz
16-
ENV ES_HOME="$HOME/elasticsearch-7.11.0"
14+
ENV ES_HOME="$HOME/elasticsearch-8.7.1"

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tasks:
3939
command: |
4040
if [[ $NPM_TOKEN ]]; then echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc; fi
4141
# Start Elasticsearch as background process
42-
$ES_HOME/bin/elasticsearch -d -p $ES_HOME/pid -Ediscovery.type=single-node -Expack.ml.enabled=false
42+
$ES_HOME/bin/elasticsearch -d -p $ES_HOME/pid -Ediscovery.type=single-node -Expack.ml.enabled=false -Expack.security.enabled=false
4343
gp ports await 9200
4444
# Start the server application
4545
cd server

doc/development.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ To get started quickly, it is recommended to use Gitpod as default with the deve
4040

4141
- [https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl)
4242

43-
- Set up JDK 11
44-
45-
- sudo apt install onpenjdk-11-jdk
43+
- Set up JDK 17
44+
- sudo apt install -y wget apt-transport-https
45+
- mkdir -p /etc/apt/keyrings
46+
- wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc
47+
- echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
48+
- sudo apt update
49+
- sudo apt install temurin-17-jdk
4650

4751
- Install docker
4852

@@ -74,15 +78,15 @@ To get started quickly, it is recommended to use Gitpod as default with the deve
7478

7579
- Make sure the correct Java version is being used
7680

77-
- Download Java 11 if you don't have it already
81+
- Download Java 17 if you don't have it already: https://adoptium.net/temurin/releases/
7882

7983
- Run the command `/usr/libexec/java_home –V` to see your matching Java virtual machines
8084

81-
- Pick Java 11 accordingly
85+
- Pick Java 17 accordingly
8286

83-
- export JAVA_HOME='/usr/libexec/java_home –v 11.0.18'
87+
- export JAVA_HOME='/usr/libexec/java_home –v 17.0.7+7'
8488

85-
- Run `java –version` to check if Java 11 is indeed being used
89+
- Run `java –version` to check if Java 17 is indeed being used
8690

8791
- https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-macos
8892

server/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gradle:jdk11 as builder
1+
FROM gradle:jdk17 as builder
22

33
# Copy sources
44
WORKDIR /home/gradle
@@ -10,7 +10,7 @@ COPY --chown=gradle:gradle src ./src/
1010
RUN ./gradlew --no-daemon assemble
1111

1212

13-
FROM openjdk:11.0.7-jdk
13+
FROM eclipse-temurin:17.0.7_7-jdk
1414

1515
# Create user openvsx and set up home directory
1616
RUN groupadd -r openvsx && useradd --no-log-init -r -g openvsx openvsx

server/build.gradle

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath "org.hibernate:hibernate-gradle-plugin:5.4.22.Final"
6+
classpath "org.hibernate.orm:hibernate-gradle-plugin:6.2.2.Final"
77
}
88
}
99
plugins {
1010
id 'nu.studer.jooq' version '6.0.1'
1111
id 'de.undercouch.download' version '4.1.1'
12-
id 'org.springframework.boot' version '2.7.1'
12+
id 'org.springframework.boot' version '3.1.0'
1313
id 'io.spring.dependency-management' version '1.1.0'
1414
id 'io.gatling.gradle' version '3.6.1'
1515
id 'java'
@@ -18,22 +18,26 @@ apply plugin: 'org.hibernate.orm'
1818

1919
def jooqSrcDir = 'src/main/jooq-gen'
2020
def versions = [
21-
java: '11',
22-
flyway: '7.3.1',
23-
springdoc: '1.6.9',
24-
spdx: '2.2.4',
25-
gcloud: '1.113.4',
26-
azure: '12.9.0',
27-
guava: '28.2-jre',
21+
java: '17',
22+
flyway: '9.19.1',
23+
springdoc: '2.1.0',
24+
spdx: '2.2.8',
25+
gcloud: '2.22.3',
26+
azure: '12.18.0',
27+
guava: '30.0-jre',
2828
junit: '5.7.1',
2929
testcontainers: '1.15.2',
30-
jackson: '2.12.5',
31-
woodstox: '6.2.4',
32-
jobrunr: '5.1.2',
33-
bucket4j: '0.4.0',
34-
ehcache: '3.10.0',
30+
jackson: '2.15.2',
31+
woodstox: '6.4.0',
32+
jobrunr: '6.2.0',
33+
bucket4j: '0.9.0',
34+
ehcache: '3.10.8',
3535
tika: '2.6.0',
36-
bouncycastle: '1.69'
36+
bouncycastle: '1.69',
37+
commons_lang3: '3.12.0',
38+
httpclient5: '5.2.1',
39+
jaxb_api: '2.3.1',
40+
jaxb_impl: '2.3.8'
3741
]
3842
ext['junit-jupiter.version'] = versions.junit
3943
sourceCompatibility = versions.java
@@ -75,18 +79,22 @@ dependencies {
7579
implementation "org.bouncycastle:bcpkix-jdk15on:${versions.bouncycastle}"
7680
implementation "org.ehcache:ehcache:${versions.ehcache}"
7781
implementation "com.giffing.bucket4j.spring.boot.starter:bucket4j-spring-boot-starter:${versions.bucket4j}"
78-
implementation "org.jobrunr:jobrunr-spring-boot-starter:${versions.jobrunr}"
82+
implementation "org.jobrunr:jobrunr-spring-boot-3-starter:${versions.jobrunr}"
7983
implementation "org.flywaydb:flyway-core:${versions.flyway}"
8084
implementation "com.google.cloud:google-cloud-storage:${versions.gcloud}"
8185
implementation "com.azure:azure-storage-blob:${versions.azure}"
82-
implementation "org.springdoc:springdoc-openapi-ui:${versions.springdoc}"
86+
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${versions.springdoc}"
8387
implementation "com.google.guava:guava:${versions.guava}"
8488
implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
8589
implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
8690
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
8791
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
8892
implementation "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"
8993
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}"
94+
implementation "javax.xml.bind:jaxb-api:${versions.jaxb_api}"
95+
implementation "com.sun.xml.bind:jaxb-impl:${versions.jaxb_impl}"
96+
implementation "org.apache.commons:commons-lang3:${versions.commons_lang3}"
97+
implementation "org.apache.httpcomponents.client5:httpclient5:${versions.httpclient5}"
9098
implementation "org.apache.tika:tika-core:${versions.tika}"
9199
implementation("org.spdx:spdx-tools:${versions.spdx}") {
92100
exclude group: 'net.sf.saxon'
@@ -109,13 +117,6 @@ dependencies {
109117
testRuntimeOnly "org.testcontainers:postgresql:${versions.testcontainers}"
110118
}
111119

112-
hibernate {
113-
enhance {
114-
enableLazyInitialization = true
115-
enableDirtyTracking = true
116-
}
117-
}
118-
119120
jooq {
120121
// use jOOQ version defined in Spring Boot
121122
version = dependencyManagement.importedProperties['jooq.version']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

server/gradlew

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36-
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37-
# * compound commands having a testable exit status, especially «case»;
38-
# * various built-in commands including «command», «set», and «ulimit».
35+
# * expansions $var�, �${var}�, �${var:-default}�, �${var+SET},
36+
# ${var#prefix}�, �${var%suffix}, and $( cmd );
37+
# * compound commands having a testable exit status, especially case;
38+
# * various built-in commands including command�, �set, and ulimit.
3939
#
4040
# Important for patching:
4141
#

server/src/dev/resources/application.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ management:
6565

6666
springdoc:
6767
swagger-ui:
68+
path: /swagger-ui
6869
docExpansion: list
6970
operationsSorter: alpha
7071
supportedSubmitMethods:
@@ -93,7 +94,7 @@ bucket4j:
9394
Access-Control-Allow-Origin: '*'
9495
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
9596
rate-limits:
96-
- expression: getParameter("token")
97+
- cache-key: getParameter("token")
9798
bandwidths:
9899
- capacity: 15
99100
time: 1
@@ -104,7 +105,7 @@ bucket4j:
104105
Access-Control-Allow-Origin: '*'
105106
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
106107
rate-limits:
107-
- expression: getRemoteAddr()
108+
- cache-key: getRemoteAddr()
108109
bandwidths:
109110
- capacity: 75
110111
time: 1
@@ -115,7 +116,7 @@ bucket4j:
115116
Access-Control-Allow-Origin: '*'
116117
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
117118
rate-limits:
118-
- expression: getRemoteAddr()
119+
- cache-key: getRemoteAddr()
119120
bandwidths:
120121
- capacity: 15
121122
time: 1

server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
import com.fasterxml.jackson.databind.node.MissingNode;
1616
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
1717
import org.apache.commons.codec.digest.DigestUtils;
18+
import org.apache.commons.lang3.StringUtils;
1819
import org.eclipse.openvsx.entities.ExtensionVersion;
1920
import org.eclipse.openvsx.entities.FileResource;
2021
import org.eclipse.openvsx.util.*;
21-
import org.elasticsearch.common.Strings;
2222
import org.slf4j.Logger;
2323
import org.slf4j.LoggerFactory;
2424
import org.springframework.data.util.Pair;
@@ -273,7 +273,7 @@ private List<String> getTags() {
273273
}
274274

275275
private List<String> asStringList(String value, String sep){
276-
if (Strings.isNullOrEmpty(value)){
276+
if (StringUtils.isEmpty(value)){
277277
return new ArrayList<>();
278278
}
279279

@@ -410,7 +410,7 @@ public FileResource getLicense(ExtensionVersion extVersion) {
410410
license.setExtension(extVersion);
411411
license.setType(FileResource.LICENSE);
412412
// Parse specifications in the form "SEE MIT LICENSE IN LICENSE.txt"
413-
if (!Strings.isNullOrEmpty(extVersion.getLicense())) {
413+
if (!StringUtils.isEmpty(extVersion.getLicense())) {
414414
var matcher = LICENSE_PATTERN.matcher(extVersion.getLicense());
415415
if (matcher.find()) {
416416
extVersion.setLicense(matcher.group("license"));
@@ -438,7 +438,7 @@ public FileResource getLicense(ExtensionVersion extVersion) {
438438
}
439439

440440
private void detectLicense(byte[] content, ExtensionVersion extVersion) {
441-
if (Strings.isNullOrEmpty(extVersion.getLicense())) {
441+
if (StringUtils.isEmpty(extVersion.getLicense())) {
442442
var detection = new LicenseDetection();
443443
extVersion.setLicense(detection.detectLicense(content));
444444
}

0 commit comments

Comments
 (0)