Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Java 17 #285

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/vNEXT) 2025

### Quality

- Refactor `SslConfig` and `TwoWaySslClient` to use HttpClient 5 and improve ssl handling. (#285)

### Dependency Upgrades

- Upgrade to `eclipse-temurin:17.0.13_11-jre-focal`. (#285)
- Upgrade to Spring Boot 3.0.13. (#285)
- Upgrade to `org.springdoc:springdoc-openapi-starter-webmvc-ui` 2.6.0. (#285)

## [[8.7.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.7.0) 2024-12-23

### New Features
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:11.0.24_8-jre-focal
FROM eclipse-temurin:17.0.13_11-jre-focal

ARG jar

Expand Down
21 changes: 15 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
buildscript {
ext {
springBootVersion = '3.0.13'
}
}

plugins {
id 'java'
id 'io.freefair.lombok' version '8.10.2'
id 'org.springframework.boot' version '2.7.18'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version '1.1.6'
id 'jacoco'
id 'org.sonarqube' version '5.1.0.4882'
Expand Down Expand Up @@ -39,12 +45,14 @@ allprojects {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
sourceCompatibility = "11"
targetCompatibility = "11"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")

// iexec
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
Expand All @@ -55,15 +63,16 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.retry:spring-retry'

// H2
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'com.h2database:h2:2.2.224'

// Spring Doc
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'

//ssl
implementation 'org.apache.httpcomponents:httpclient'
// ssl
implementation 'org.apache.httpcomponents.client5:httpclient5'

// observability
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=8.7.0
iexecCommonVersion=8.6.0
iexecCommonsPocoVersion=4.2.0
iexecCommonVersion=8.6.0-NEXT-SNAPSHOT
iexecCommonsPocoVersion=4.2.0-NEXT-SNAPSHOT

nexusUser
nexusPassword
15 changes: 10 additions & 5 deletions iexec-sms-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ plugins {
id 'maven-publish'
}

ext {
springBootVersion = '3.0.13'
}

dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")

implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
implementation "com.iexec.common:iexec-common:$iexecCommonVersion"
}

java {
sourceCompatibility = "11"
targetCompatibility = "11"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
Expand All @@ -22,9 +28,8 @@ testing {
test {
useJUnitJupiter()
dependencies {
implementation "org.assertj:assertj-core:3.22.0"
implementation 'org.junit.jupiter:junit-jupiter:5.8.2'
implementation 'org.mockito:mockito-junit-jupiter:4.7.0'
implementation "org.assertj:assertj-core"
implementation 'org.mockito:mockito-junit-jupiter'
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/iexec/sms/admin/ApiKeyRequestFilter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2023-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,16 +16,16 @@

package com.iexec.sms.admin;

import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.filter.GenericFilterBean;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/iexec/sms/admin/OutOfServiceRequestFilter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2024-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,13 +15,13 @@
*/
package com.iexec.sms.admin;

import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.filter.GenericFilterBean;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,12 +18,10 @@

import lombok.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;

import java.time.Duration;

@Value
@ConstructorBinding
@ConfigurationProperties(prefix = "blockchain")
public class BlockchainConfig {
int id;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/config/SecretsConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2023-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,12 +27,12 @@
import com.iexec.sms.secret.web3.Web3SecretRepository;
import com.iexec.sms.tee.challenge.EthereumCredentialsRepository;
import com.iexec.sms.tee.challenge.TeeChallengeRepository;
import jakarta.annotation.PreDestroy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PreDestroy;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,8 @@

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;

@Data
@ConstructorBinding
@ConfigurationProperties(prefix = "encryption")
public class EncryptionConfiguration {
private final String aesKeyPath;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/encryption/EncryptionService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,13 +20,13 @@
import com.iexec.common.security.CipherHelper;
import com.iexec.common.utils.FileHelper;
import com.iexec.commons.poco.utils.BytesUtils;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.web3j.crypto.Hash;

import javax.annotation.PostConstruct;
import java.io.File;

import static com.iexec.common.utils.FileHelper.createFileWithContent;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/iexec/sms/secret/MeasuredSecretService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2023 IEXEC BLOCKCHAIN TECH
* Copyright 2023-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,10 @@

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.PostConstruct;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/iexec/sms/secret/Secret.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 IEXEC BLOCKCHAIN TECH
* Copyright 2020-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,12 +16,12 @@

package com.iexec.sms.secret;

import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Objects;

@MappedSuperclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 IEXEC BLOCKCHAIN TECH
* Copyright 2021-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,12 @@
package com.iexec.sms.secret.compute;

import com.iexec.sms.secret.SecretUtils;
import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.validation.constraints.NotNull;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,20 +16,19 @@

package com.iexec.sms.secret.compute;

import jakarta.persistence.Embeddable;
import jakarta.validation.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Embeddable;
import javax.validation.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Set;
import java.util.stream.Collectors;

@Embeddable
@Slf4j
Expand Down Expand Up @@ -86,7 +85,7 @@ private void validateFields() {
final Validator validator = factory.getValidator();
final Set<ConstraintViolation<TeeTaskComputeSecretHeader>> issues = validator.validate(this);
if (!issues.isEmpty()) {
log.warn("{}", issues.stream().map(ConstraintViolation::getMessage).collect(Collectors.toList()));
log.warn("{}", issues.stream().map(ConstraintViolation::getMessage).toList());
throw new ValidationException("Can't create TeeTaskComputeSecretHeader.");
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/iexec/sms/secret/web2/Web2Secret.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2022-2025 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,13 +17,12 @@
package com.iexec.sms.secret.web2;

import com.iexec.sms.secret.Secret;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand Down
Loading