Skip to content

Commit d56aeab

Browse files
committed
- Fix for JDK 1.8 compatibility
1 parent c19bcf8 commit d56aeab

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release API CLI on github and Maven repository
1+
name: Release API CLI on github and Maven repository
22

33
on:
44
workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Java to deploy to OSSRH
2323
uses: actions/setup-java@v3
2424
with:
25-
java-version: '8'
25+
java-version: '11'
2626
distribution: 'zulu'
2727
server-id: ossrh
2828
server-username: MAVEN_USERNAME
@@ -34,7 +34,7 @@ jobs:
3434
git config user.email "rathnapandi.n@gmail.com"
3535
git config user.name $github.actor
3636
- name: Prepare & PublishRelease
37-
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 }}
37+
run: mvn -Dmaven.test.skip=true release:prepare release:perform -P release -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
4040
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
@@ -60,4 +60,4 @@ jobs:
6060
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6161

6262

63-
63+

modules/apis/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,4 @@
7878
<scope>test</scope>
7979
</dependency>
8080
</dependencies>
81-
<build>
82-
<plugins>
83-
<plugin>
84-
<groupId>org.apache.maven.plugins</groupId>
85-
<artifactId>maven-compiler-plugin</artifactId>
86-
<configuration>
87-
<source>11</source>
88-
<target>11</target>
89-
</configuration>
90-
</plugin>
91-
</plugins>
92-
</build>
9381
</project>

modules/apis/src/main/java/com/axway/apim/apiimport/APIImportConfigAdapter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.slf4j.LoggerFactory;
3333

3434
import java.io.*;
35+
import java.nio.charset.StandardCharsets;
3536
import java.nio.file.Files;
3637
import java.util.*;
3738

@@ -310,7 +311,7 @@ private void validateDescription(API apiConfig) throws AppException {
310311
throw new AppException("Error reading markdown description file: " + markdownFilename, ErrorCode.CANT_READ_CONFIG_FILE);
311312
}
312313
LOG.debug("Reading local markdown description file: {}", markdownFile.getPath());
313-
markdownDescription.append(newLine).append(Files.readString(markdownFile.toPath()));
314+
markdownDescription.append(newLine).append(new String(Files.readAllBytes(markdownFile.toPath()), StandardCharsets.UTF_8));
314315
}
315316
newLine = "\n";
316317
}
@@ -462,7 +463,7 @@ public void completeCaCerts(API apiConfig) throws AppException {
462463
if (cert.getCertBlob() == null) {
463464
try (InputStream is = getInputStreamForCertFile(cert)) {
464465
String certInfo = APIManagerAdapter.getCertInfo(is, "", cert);
465-
List<CaCert> completedCerts = mapper.readValue(certInfo, new TypeReference<>() {});
466+
List<CaCert> completedCerts = mapper.readValue(certInfo, new TypeReference<List<CaCert>>() {});
466467
completedCaCerts.addAll(completedCerts);
467468
} catch (Exception e) {
468469
throw new AppException("Can't initialize given certificate.", ErrorCode.CANT_READ_CONFIG_FILE, e);

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@
267267
<groupId>org.apache.maven.plugins</groupId>
268268
<artifactId>maven-compiler-plugin</artifactId>
269269
<version>3.8.1</version>
270+
<configuration>
271+
<source>1.8</source>
272+
<target>1.8</target>
273+
</configuration>
270274
</plugin>
271275
<plugin>
272276
<groupId>com.consol.citrus.mvn</groupId>

0 commit comments

Comments
 (0)