From 24ca3a62d8b488ba98cd745e1903917de562891f Mon Sep 17 00:00:00 2001
From: loong10k <20489781+loong10k@users.noreply.github.com>
Date: Wed, 4 Nov 2026 00:36:09 +0800
Subject: [PATCH 1/2] fix: update PF4J sample Commons IO to 2.14.0
---
.../test/CommonsIoCompatibilityTest.java | 24 +++++++++++++++++++
.../pf4j-plugin-sample/pom.xml | 11 ++++-----
2 files changed, 29 insertions(+), 6 deletions(-)
create mode 100644 spring-boot-sample-pf4j/pf4j-plugin-sample/pf4j-plugin-test/src/test/java/pf4j/plugin/test/CommonsIoCompatibilityTest.java
diff --git a/spring-boot-sample-pf4j/pf4j-plugin-sample/pf4j-plugin-test/src/test/java/pf4j/plugin/test/CommonsIoCompatibilityTest.java b/spring-boot-sample-pf4j/pf4j-plugin-sample/pf4j-plugin-test/src/test/java/pf4j/plugin/test/CommonsIoCompatibilityTest.java
new file mode 100644
index 0000000..f69fe4c
--- /dev/null
+++ b/spring-boot-sample-pf4j/pf4j-plugin-sample/pf4j-plugin-test/src/test/java/pf4j/plugin/test/CommonsIoCompatibilityTest.java
@@ -0,0 +1,24 @@
+package pf4j.plugin.test;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+
+public class CommonsIoCompatibilityTest {
+
+ @Test
+ public void resolvesFixedCommonsIoAndCopiesPluginData() throws Exception {
+ assertEquals("2.14.0", IOUtils.class.getPackage().getImplementationVersion());
+
+ byte[] pluginData = "pf4j-plugin-data-插件".getBytes(StandardCharsets.UTF_8);
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ assertEquals(pluginData.length, IOUtils.copy(new ByteArrayInputStream(pluginData), output));
+ assertArrayEquals(pluginData, output.toByteArray());
+ }
+}
diff --git a/spring-boot-sample-pf4j/pf4j-plugin-sample/pom.xml b/spring-boot-sample-pf4j/pf4j-plugin-sample/pom.xml
index 07ae3cf..058aaf4 100644
--- a/spring-boot-sample-pf4j/pf4j-plugin-sample/pom.xml
+++ b/spring-boot-sample-pf4j/pf4j-plugin-sample/pom.xml
@@ -19,7 +19,7 @@
UTF-8
4.12
- 2.5
+ 2.14.0
3.18.0
1.2.61
3.1.0
@@ -214,9 +214,8 @@
maven-surefire-plugin
2.19.1
-
- true
- true
+ false
+ false
once
- -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8
+ -Xmx1024m -Dfile.encoding=UTF-8
${basedir}/target/test-classes
@@ -384,4 +383,4 @@
-
\ No newline at end of file
+
From 35bdf7f9c482d21f668f6303e0e9ed97e33674d2 Mon Sep 17 00:00:00 2001
From: loong10k <20489781+loong10k@users.noreply.github.com>
Date: Wed, 4 Nov 2026 00:41:23 +0800
Subject: [PATCH 2/2] fix: pin Swagger2 Surefire for JUnit 4 tests
---
spring-boot-sample-swagger2/pom.xml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/spring-boot-sample-swagger2/pom.xml b/spring-boot-sample-swagger2/pom.xml
index efbeda3..9a672fb 100644
--- a/spring-boot-sample-swagger2/pom.xml
+++ b/spring-boot-sample-swagger2/pom.xml
@@ -259,6 +259,11 @@
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.5.4
+
@@ -441,4 +446,4 @@
-
\ No newline at end of file
+