Skip to content

Commit

Permalink
- Fix for JDK 1.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Mar 15, 2023
1 parent c19bcf8 commit d56aeab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -34,7 +34,7 @@ jobs:
git config user.email "[email protected]"
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 }}
Expand All @@ -60,4 +60,4 @@ jobs:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}



12 changes: 0 additions & 12 deletions modules/apis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.slf4j.LoggerFactory;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.*;

Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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<CaCert> completedCerts = mapper.readValue(certInfo, new TypeReference<>() {});
List<CaCert> completedCerts = mapper.readValue(certInfo, new TypeReference<List<CaCert>>() {});
completedCaCerts.addAll(completedCerts);
} catch (Exception e) {
throw new AppException("Can't initialize given certificate.", ErrorCode.CANT_READ_CONFIG_FILE, e);
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.consol.citrus.mvn</groupId>
Expand Down

0 comments on commit d56aeab

Please sign in to comment.