Skip to content

Commit 137107f

Browse files
authored
Merge pull request #27 from trendmicro/update_to_latest_version_v1.6.1
update to latest version: v1.6.1
2 parents 8f295ab + 87bee0c commit 137107f

File tree

6 files changed

+44
-32
lines changed

6 files changed

+44
-32
lines changed

.github/workflows/publish-to-maven.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will publish AMaaS Java SDK to Maven Central with OSSRH
1+
# This workflow will publish AMaaS Java SDK to Maven Central via Central Publisher Portal
22

33
name: Java with Maven
44

@@ -16,8 +16,8 @@ jobs:
1616
uses: actions/setup-java@v3
1717
with:
1818
java-version: '8'
19-
distribution: 'adopt'
20-
server-id: ossrh
19+
distribution: 'temurin'
20+
server-id: central
2121
server-username: MAVEN_USERNAME
2222
server-password: MAVEN_PASSWORD
2323
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -38,6 +38,6 @@ jobs:
3838
run: |
3939
mvn -B clean ${{env.PACK_CMD}}
4040
env:
41-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
42-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
41+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
42+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
4343
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/setup-java@v3
1818
with:
1919
java-version: '8'
20-
distribution: 'adopt'
20+
distribution: 'temurin'
2121

2222
- name: Run unit tests
2323
run: |

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM openjdk:8-jdk-bullseye@sha256:c25fa22ba2961758802ea63bc4622999a305086405d9d03b065925da00cb8bb6 as build_env
2+
FROM eclipse-temurin:8-jdk@sha256:3b1808f3745f1bbbb3611a4f774a0a8940af9de318f1d725e49e2ea8fbc176e6 as build_env
33

44
ARG BUILD_VERSION
55
ARG PACK_CMD=package
@@ -9,7 +9,7 @@ RUN useradd -m su-amaas
99
# Dependencies
1010

1111
RUN apt-get update && apt-get install -y --no-install-recommends \
12-
maven=3.6.3-5 \
12+
maven \
1313
&& apt-get clean \
1414
&& rm -rf /var/lib/apt/lists/*
1515

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6.0
1+
1.6.1

pom.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<project xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
45
<modelVersion>4.0.0</modelVersion>
56

67
<groupId>com.trend</groupId>
78
<artifactId>file-security-java-sdk</artifactId>
8-
<version>1.6.0</version>
9+
<version>1.6.1</version>
910

1011
<name>file-security-java-sdk</name>
1112
<url>https://github.com/trendmicro/tm-v1-fs-java-sdk</url>
@@ -33,8 +34,8 @@
3334

3435
<distributionManagement>
3536
<repository>
36-
<id>ossrh</id>
37-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
37+
<id>central</id>
38+
<url>https://central.sonatype.com/api/v1/publisher/deployments/</url>
3839
</repository>
3940
</distributionManagement>
4041

@@ -86,13 +87,16 @@
8687
<artifactId>grpc-netty</artifactId>
8788
<version>1.73.0</version>
8889
<exclusions>
89-
<exclusion><groupId>io.netty</groupId><artifactId>*</artifactId></exclusion>
90+
<exclusion>
91+
<groupId>io.netty</groupId>
92+
<artifactId>*</artifactId>
93+
</exclusion>
9094
</exclusions>
9195
</dependency>
9296
<dependency>
9397
<groupId>io.netty</groupId>
9498
<artifactId>netty-all</artifactId>
95-
<version>4.1.121.Final</version>
99+
<version>4.2.6.Final</version>
96100
</dependency>
97101
<dependency>
98102
<groupId>io.grpc</groupId>
@@ -111,7 +115,7 @@
111115
</dependencies>
112116

113117
<build>
114-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
118+
<pluginManagement> <!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
115119
<plugins>
116120
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
117121
<plugin>
@@ -252,14 +256,14 @@
252256
</configuration>
253257
</plugin>
254258
<plugin>
255-
<groupId>org.sonatype.plugins</groupId>
256-
<artifactId>nexus-staging-maven-plugin</artifactId>
257-
<version>1.6.13</version>
259+
<groupId>org.sonatype.central</groupId>
260+
<artifactId>central-publishing-maven-plugin</artifactId>
261+
<version>0.8.0</version>
258262
<extensions>true</extensions>
259263
<configuration>
260-
<serverId>ossrh</serverId>
261-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
262-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
264+
<publishingServerId>central</publishingServerId>
265+
<tokenAuth>true</tokenAuth>
266+
<autoPublish>true</autoPublish>
263267
</configuration>
264268
</plugin>
265269
</plugins>

src/main/java/com/trend/cloudone/amaas/AMaasClient.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ private ManagedChannel buildChannelWithProxy(final String target, final ProxyCon
190190
builder.usePlaintext();
191191
}
192192

193+
final int keepAliveTimeSecs = 60;
194+
final int keepAliveTimeoutSecs = 5;
195+
final int connectTimeoutMs = 30000;
196+
197+
builder
198+
.keepAliveTime(keepAliveTimeSecs, TimeUnit.SECONDS)
199+
.keepAliveTimeout(keepAliveTimeoutSecs, TimeUnit.SECONDS)
200+
.keepAliveWithoutCalls(true) // Keep connection alive even when idle
201+
.withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeoutMs);
202+
203+
log(
204+
Level.FINE,
205+
"Configured keep-alive: time={0}s, timeout={1}s, connectTimeout={2}ms",
206+
keepAliveTimeSecs,
207+
keepAliveTimeoutSecs,
208+
connectTimeoutMs
209+
);
210+
193211
// Configure proxy if needed
194212
String proxyUrl = proxyConfig.getProxyUrl(target);
195213
if (proxyUrl != null) {
@@ -255,16 +273,6 @@ public NioSocketChannel newChannel() {
255273
setProxyAuthenticator(proxyConfig);
256274
}
257275
}
258-
259-
// Set connection timeout for proxy connections
260-
final int keepAliveTimeSecs = 30;
261-
final int keepAliveTimeoutSecs = 10;
262-
final int connectTimeoutMs = 30000; // 30 seconds
263-
264-
builder.keepAliveTime(keepAliveTimeSecs, TimeUnit.SECONDS);
265-
builder.keepAliveTimeout(keepAliveTimeoutSecs, TimeUnit.SECONDS);
266-
builder.keepAliveWithoutCalls(true);
267-
builder.withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeoutMs);
268276
}
269277

270278
/**

0 commit comments

Comments
 (0)