From 1a0539bc7b91ee9cff41aec1635e9683ee76a0a9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 25 Jul 2024 10:32:29 +0200 Subject: [PATCH] fix: downgrade to Java 11 compatible XML APIs - NiFi 1.x targets Java 11 and brings Java 11 compatible XML libraries - Align versions used in the project - Use javax.xml instead of jakarta.xml --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/maven.yml | 4 ++-- .github/workflows/mvn-dependency-submission.yml | 4 ++-- nifi-file-identity-provider/pom.xml | 12 ++++++------ .../nifi/authentication/file/CredentialsStore.java | 2 +- .../authentication/file/TestCredentialsStore.java | 2 +- pom.xml | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e0d4085..ada9daf 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,10 +28,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' cache: maven diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0d3538e..f4ba55a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.github/workflows/mvn-dependency-submission.yml b/.github/workflows/mvn-dependency-submission.yml index 442696d..9a14dc2 100644 --- a/.github/workflows/mvn-dependency-submission.yml +++ b/.github/workflows/mvn-dependency-submission.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' cache: maven - name: Maven Dependency Tree Dependency Submission diff --git a/nifi-file-identity-provider/pom.xml b/nifi-file-identity-provider/pom.xml index 94d5bc2..ba2ac4f 100644 --- a/nifi-file-identity-provider/pom.xml +++ b/nifi-file-identity-provider/pom.xml @@ -92,8 +92,8 @@ jigsaw - 17 - 17 + 11 + 11 @@ -115,12 +115,12 @@ jakarta.xml.bind jakarta.xml.bind-api - 4.0.2 + 2.3.3 org.glassfish.jaxb jaxb-runtime - 4.0.4 + 2.3.9 @@ -150,12 +150,12 @@ jakarta.xml.bind jakarta.xml.bind-api - 4.0.2 + 2.3.3 org.glassfish.jaxb jaxb-runtime - 4.0.4 + 2.3.9 ch.qos.logback diff --git a/nifi-file-identity-provider/src/main/java/io/egm/nifi/authentication/file/CredentialsStore.java b/nifi-file-identity-provider/src/main/java/io/egm/nifi/authentication/file/CredentialsStore.java index 25a290e..81b1cdc 100644 --- a/nifi-file-identity-provider/src/main/java/io/egm/nifi/authentication/file/CredentialsStore.java +++ b/nifi-file-identity-provider/src/main/java/io/egm/nifi/authentication/file/CredentialsStore.java @@ -19,11 +19,11 @@ import io.egm.nifi.authentication.file.generated.ObjectFactory; import io.egm.nifi.authentication.file.generated.UserCredentials; import io.egm.nifi.authentication.file.generated.UserCredentialsList; -import jakarta.xml.bind.*; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import javax.xml.XMLConstants; +import javax.xml.bind.*; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; diff --git a/nifi-file-identity-provider/src/test/java/io/egm/nifi/authentication/file/TestCredentialsStore.java b/nifi-file-identity-provider/src/test/java/io/egm/nifi/authentication/file/TestCredentialsStore.java index 6c46a44..9d855f0 100644 --- a/nifi-file-identity-provider/src/test/java/io/egm/nifi/authentication/file/TestCredentialsStore.java +++ b/nifi-file-identity-provider/src/test/java/io/egm/nifi/authentication/file/TestCredentialsStore.java @@ -18,10 +18,10 @@ import io.egm.nifi.authentication.file.generated.UserCredentials; import io.egm.nifi.authentication.file.generated.UserCredentialsList; -import jakarta.xml.bind.UnmarshalException; import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.Test; +import javax.xml.bind.UnmarshalException; import java.io.File; import java.io.FileNotFoundException; import java.io.InvalidObjectException; diff --git a/pom.xml b/pom.xml index 037a385..ddf9569 100644 --- a/pom.xml +++ b/pom.xml @@ -29,8 +29,8 @@ pom - 17 - 17 + 11 + 11 @@ -44,7 +44,7 @@ org.codehaus.mojo jaxb2-maven-plugin - 3.1.0 + 2.5.0