diff --git a/.github/workflows/maven-update-version.yml b/.github/workflows/maven-update-version.yml
index 056791a3..9ffa49de 100644
--- a/.github/workflows/maven-update-version.yml
+++ b/.github/workflows/maven-update-version.yml
@@ -25,9 +25,9 @@ jobs:
contents: write
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Set up JDK 21
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
diff --git a/audit-base/src/main/java/com/wultra/core/audit/base/configuration/AuditConfiguration.java b/audit-base/src/main/java/com/wultra/core/audit/base/configuration/AuditConfiguration.java
index a90dd88e..ee678cc3 100644
--- a/audit-base/src/main/java/com/wultra/core/audit/base/configuration/AuditConfiguration.java
+++ b/audit-base/src/main/java/com/wultra/core/audit/base/configuration/AuditConfiguration.java
@@ -98,7 +98,7 @@ public String getVersion() {
*/
public Instant getBuildTime() {
if (buildProperties == null) {
- return null;
+ return Instant.now();
}
return buildProperties.getTime();
}
diff --git a/audit-base/src/test/java/com/wultra/core/audit/base/AuditTest.java b/audit-base/src/test/java/com/wultra/core/audit/base/AuditTest.java
index de881ab8..839b056a 100644
--- a/audit-base/src/test/java/com/wultra/core/audit/base/AuditTest.java
+++ b/audit-base/src/test/java/com/wultra/core/audit/base/AuditTest.java
@@ -145,8 +145,8 @@ void testAuditException() {
final SqlRowSet rs = jdbcTemplate.queryForRowSet("SELECT * FROM audit_log");
assertTrue(rs.next());
assertEquals("test exception", rs.getObject("exception_message"));
- assertTrue(rs.getObject("stack_trace").toString().contains("java.lang.Exception: test exception\n"
- + "\tat com.wultra.core.audit.base.AuditTest.testAuditException"));
+ assertTrue(rs.getObject("stack_trace").toString().contains("java.lang.Exception: test exception"));
+ assertTrue(rs.getObject("stack_trace").toString().contains("at com.wultra.core.audit.base.AuditTest.testAuditException"));
}
@Test
@@ -188,8 +188,8 @@ void testAuditFormattedMessageException() {
assertTrue(rs.next());
assertEquals("test message with more formatting and exception", rs.getObject("message"));
assertEquals("test exception", rs.getObject("exception_message"));
- assertTrue(rs.getObject("stack_trace").toString().contains("java.lang.Exception: test exception\n"
- + "\tat com.wultra.core.audit.base.AuditTest.testAuditFormattedMessageException"));
+ assertTrue(rs.getObject("stack_trace").toString().contains("java.lang.Exception: test exception"));
+ assertTrue(rs.getObject("stack_trace").toString().contains("at com.wultra.core.audit.base.AuditTest.testAuditFormattedMessage"));
}
@Test
diff --git a/pom.xml b/pom.xml
index 5eb07cc4..817c9e52 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,14 +55,15 @@
UTF-8
17
${java.version}
+ 0.9.0
- 3.14.0
- 3.5.3
- 3.5.0
+ 3.14.1
+ 3.5.4
+ 3.6.2
- 3.4.5
- 6.6.1
+ 3.5.8
+ 6.10.0
@@ -99,6 +100,12 @@
maven-surefire-plugin
${maven-surefire-plugin.version}
+
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ ${central.publishing.plugin.version}
+
@@ -106,7 +113,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.3.1
+ 3.4.0
attach-sources
@@ -120,7 +127,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.11.2
+ 3.12.0
false
@@ -240,8 +247,8 @@
https://wultra.jfrog.io/artifactory/internal-maven-repository
- ossrh-snapshots
- https://oss.sonatype.org/content/repositories/snapshots/
+ central-portal-snapshots
+ https://central.sonatype.com/repository/maven-snapshots/
false
@@ -260,14 +267,29 @@
+
+
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ true
+
+ ${env.server_id}
+ true
+ published
+ ${env.wait_max_time}
+
+
+
+
- ossrh-snapshots-distribution
- https://oss.sonatype.org/content/repositories/snapshots/
+ central-portal-snapshots-distribution
+ https://central.sonatype.com/repository/maven-snapshots/
- ossrh-staging-distribution
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
+ central-portal-staging-distribution
+ https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/
diff --git a/rest-client-base/src/main/java/com/wultra/core/rest/client/base/util/SslUtils.java b/rest-client-base/src/main/java/com/wultra/core/rest/client/base/util/SslUtils.java
index decbcfd6..2bb099b1 100644
--- a/rest-client-base/src/main/java/com/wultra/core/rest/client/base/util/SslUtils.java
+++ b/rest-client-base/src/main/java/com/wultra/core/rest/client/base/util/SslUtils.java
@@ -145,6 +145,7 @@ public static SslContext prepareSslContext(RestClientConfiguration config) throw
return trustStore.isCertificateEntry(t);
} catch (KeyStoreException ex) {
keyStoreExceptions.add(ex);
+ logger.error("Failed to check if certificate is in truststore: {}", t, ex);
return false;
}
})
@@ -152,20 +153,23 @@ public static SslContext prepareSslContext(RestClientConfiguration config) throw
try {
return (X509Certificate) trustStore.getCertificate(t);
} catch (KeyStoreException ex) {
+ logger.error("Failed to load certificate from truststore: {}", t, ex);
keyStoreExceptions.add(ex);
return null;
}
}).toArray(X509Certificate[]::new);
if (!keyStoreExceptions.isEmpty()) {
- throw new RestClientException("Invalid truststore data provided: " + keyStoreExceptions);
+ // add at least the first exception as the root cause
+ throw new RestClientException("Invalid truststore data provided: " + keyStoreExceptions, keyStoreExceptions.get(0));
}
sslContextBuilder.trustManager(certificates);
}
return sslContextBuilder.build();
}
- } catch (IOException | GeneralSecurityException ex) {
- throw new RestClientException("SSL configuration failed, error: " + ex.getMessage());
+ } catch (IOException | GeneralSecurityException ex) { // NOSONAR - Both logging and rethrowing are intended as library users might not properly log this security exception
+ logger.error("SSL configuration failed: {}", ex.getMessage(), ex);
+ throw new RestClientException("SSL configuration failed, error: " + ex.getMessage(), ex);
}
return null;
}