This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e89074c Fix Mockito test failures on Java 28 and later
9e89074c is described below

commit 9e89074cc9cbb43bcef47111e12c41180b7b1651
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Nov 20 07:58:40 2026 -0500

    Fix Mockito test failures on Java 28 and later
    
    Add a jdk28-plus Maven profile activated by [28,) to pass
    -Djdk.reflect.allowNonSerializableConstruction=true to Surefire.
    This restores Mockito/Objenesis test-double construction while
    preserving JaCoCo and existing JMX options.
---
 pom.xml                 | 18 ++++++++++++++++++
 src/changes/changes.xml |  1 +
 2 files changed, 19 insertions(+)

diff --git a/pom.xml b/pom.xml
index 90ac4bd3..b8556ba5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -388,6 +388,24 @@
         </pluginManagement>
       </build>
     </profile>
+    <profile>
+      <id>jdk28-plus</id>
+      <activation>
+        <jdk>[28,)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- Temporarily allow Mockito/Objenesis to construct test 
doubles on Java 28 and later. -->
+              <argLine>@{argLine} ${surefire.argline} 
-Djdk.reflect.allowNonSerializableConstruction=true</argLine>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
   <developers>
     <developer>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ef438d20..063fa7a7 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -67,6 +67,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory, Mark 
Thomas">Handle SQLException on connection initialization with SQL statements 
(#540).</action> 
       <action type="fix" dev="ggregory" due-to="Gary Gregory, Stamatis 
Zampetakis">Check configured JDBC driver classes implement java.sql.Driver 
before initializing or instantiating them.</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Report SQLState 
08001 for driver loading and creation failures, preserving driver-supplied 
SQLStates and vendor codes.</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Fix 
Mockito/Objenesis test failures on Java 28 and later using a Maven 
profile.</action>
       <!-- ADD -->
       <!-- UPDATE -->
       <action type="update" dev="ggregory" due-to="Gary Gregory">Bump 
org.apache.commons:commons-parent from 93 to 107.</action>

Reply via email to