From d56aeaba122d09868ea69639c1feca443dc77eed Mon Sep 17 00:00:00 2001 From: rathnapandi Date: Wed, 15 Mar 2023 11:25:48 -0700 Subject: [PATCH] - Fix for JDK 1.8 compatibility --- .github/workflows/release.yml | 8 ++++---- modules/apis/pom.xml | 12 ------------ .../axway/apim/apiimport/APIImportConfigAdapter.java | 5 +++-- pom.xml | 4 ++++ 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3380f90fc..ce86ae28a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release API CLI on github and Maven repository +name: Release API CLI on github and Maven repository on: workflow_dispatch: @@ -22,7 +22,7 @@ jobs: - name: Set up Java to deploy to OSSRH uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '11' distribution: 'zulu' server-id: ossrh server-username: MAVEN_USERNAME @@ -34,7 +34,7 @@ jobs: git config user.email "rathnapandi.n@gmail.com" git config user.name $github.actor - name: Prepare & PublishRelease - run: mvn -Dmaven.test.skip=true -pl '!modules/apim-cli-tests' release:prepare release:perform -P release -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} + run: mvn -Dmaven.test.skip=true release:prepare release:perform -P release -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} env: GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} @@ -60,4 +60,4 @@ jobs: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + diff --git a/modules/apis/pom.xml b/modules/apis/pom.xml index 5279b75e8..22cc1fbde 100644 --- a/modules/apis/pom.xml +++ b/modules/apis/pom.xml @@ -78,16 +78,4 @@ test - - - - org.apache.maven.plugins - maven-compiler-plugin - - 11 - 11 - - - - diff --git a/modules/apis/src/main/java/com/axway/apim/apiimport/APIImportConfigAdapter.java b/modules/apis/src/main/java/com/axway/apim/apiimport/APIImportConfigAdapter.java index 14ba0e0cf..25291721f 100644 --- a/modules/apis/src/main/java/com/axway/apim/apiimport/APIImportConfigAdapter.java +++ b/modules/apis/src/main/java/com/axway/apim/apiimport/APIImportConfigAdapter.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import java.io.*; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.*; @@ -310,7 +311,7 @@ private void validateDescription(API apiConfig) throws AppException { throw new AppException("Error reading markdown description file: " + markdownFilename, ErrorCode.CANT_READ_CONFIG_FILE); } LOG.debug("Reading local markdown description file: {}", markdownFile.getPath()); - markdownDescription.append(newLine).append(Files.readString(markdownFile.toPath())); + markdownDescription.append(newLine).append(new String(Files.readAllBytes(markdownFile.toPath()), StandardCharsets.UTF_8)); } newLine = "\n"; } @@ -462,7 +463,7 @@ public void completeCaCerts(API apiConfig) throws AppException { if (cert.getCertBlob() == null) { try (InputStream is = getInputStreamForCertFile(cert)) { String certInfo = APIManagerAdapter.getCertInfo(is, "", cert); - List completedCerts = mapper.readValue(certInfo, new TypeReference<>() {}); + List completedCerts = mapper.readValue(certInfo, new TypeReference>() {}); completedCaCerts.addAll(completedCerts); } catch (Exception e) { throw new AppException("Can't initialize given certificate.", ErrorCode.CANT_READ_CONFIG_FILE, e); diff --git a/pom.xml b/pom.xml index e194dc7a6..0e2de7a6d 100644 --- a/pom.xml +++ b/pom.xml @@ -267,6 +267,10 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 + + 1.8 + 1.8 + com.consol.citrus.mvn