Skip to content

Commit 02e077c

Browse files
authored
Add Java 25 (LTS) support and drop Java 22-24 (non-LTS) (#2821)
* Add Java 25 (LTS) support and drop Java 22-24 (non-LTS) * JaCoCo 0.8.14 officially supports Java 25 * upgraded maven-compiler-plugin to 3.14.1 * Added missing dependency org.apache.maven:maven-parent:pom:45 * updated maven-complier-plugin to 3.13.0 * updated back to 3.14.1 as 3.13.0 does not support java 25 * Upgrade Mockito and ByteBuddy dependencies for Java 25 support * reverted maven-compiler-plugin to 3.8.0 * Add profile-specific Mockito dependencies for multi-JDK support * removed maven-parent temp dependency
1 parent 76e8115 commit 02e077c

File tree

3 files changed

+121
-35
lines changed

3 files changed

+121
-35
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To build the jar files, you must use minimum version of Java 11 with Maven. You
4646
* Maven:
4747
1. If you have not already done so, add the environment variable `mssql_jdbc_test_connection_properties` in your system with the connection properties for your SQL Server or SQL DB instance.
4848
2. Run one of the commands below to build a JRE 11 and newer versions compatible jar or JRE 8 compatible jar in the `\target` directory.
49-
* Run `mvn install -Pjre23`. This creates JRE 23 compatible jar in `\target` directory which is JDBC 4.3 compliant (Build with JDK 23).
49+
* Run `mvn install -Pjre25`. This creates JRE 25 compatible jar in `\target` directory which is JDBC 4.3 compliant (Build with JDK 25).
5050
* Run `mvn install -Pjre21`. This creates JRE 21 compatible jar in `\target` directory which is JDBC 4.3 compliant (Build with JDK 21+).
5151
* Run `mvn install -Pjre17`. This creates JRE 17 compatible jar in `\target` directory which is JDBC 4.3 compliant (Build with JDK 17+).
5252
* Run `mvn install -Pjre11`. This creates JRE 11 compatible jar in `\target` directory which is JDBC 4.3 compliant (Build with JDK 11+).
@@ -55,7 +55,7 @@ To build the jar files, you must use minimum version of Java 11 with Maven. You
5555
* Gradle:
5656
1. If you have not already done so, add the environment variable `mssql_jdbc_test_connection_properties` in your system with the connection properties for your SQL Server or SQL DB instance.
5757
2. Run one of the commands below to build a JRE 11 and newer versions compatible jar or JRE 8 compatible jar in the `\build\libs` directory.
58-
* Run `gradle build -PbuildProfile=jre23`. This creates JRE 23 compatible jar in `\build\libs` directory which is JDBC 4.3 compliant (Build with JDK 23).
58+
* Run `gradle build -PbuildProfile=jre25`. This creates JRE 25 compatible jar in `\build\libs` directory which is JDBC 4.3 compliant (Build with JDK 25).
5959
* Run `gradle build -PbuildProfile=jre21`. This creates JRE 21 compatible jar in `\build\libs` directory which is JDBC 4.3 compliant (Build with JDK 21+).
6060
* Run `gradle build -PbuildProfile=jre17`. This creates JRE 17 compatible jar in `\build\libs` directory which is JDBC 4.3 compliant (Build with JDK 17+).
6161
* Run `gradle build -PbuildProfile=jre11`. This creates JRE 11 compatible jar in `\build\libs` directory which is JDBC 4.3 compliant (Build with JDK 11+).

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ test {
3333
}
3434
}
3535

36-
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre23")) {
36+
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre25")) {
3737

38-
jreVersion = "jre23"
38+
jreVersion = "jre25"
3939
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
4040
jar {
4141
manifest {
4242
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
4343
}
4444
}
45-
sourceCompatibility = 23
46-
targetCompatibility = 23
45+
sourceCompatibility = 25
46+
targetCompatibility = 25
4747
test {
4848
useJUnitPlatform {
4949
excludeTags(hasProperty('excludedGroups') ? excludedGroups : 'vectorTest','JSONTest')

pom.xml

Lines changed: 115 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -135,30 +135,6 @@
135135
<scope>provided</scope>
136136
</dependency>
137137
<!-- dependencies for running tests -->
138-
<dependency>
139-
<groupId>org.mockito</groupId>
140-
<artifactId>mockito-core</artifactId>
141-
<version>4.11.0</version>
142-
<scope>test</scope>
143-
</dependency>
144-
<dependency>
145-
<groupId>org.mockito</groupId>
146-
<artifactId>mockito-inline</artifactId>
147-
<version>4.11.0</version>
148-
<scope>test</scope>
149-
</dependency>
150-
<dependency>
151-
<groupId>net.bytebuddy</groupId>
152-
<artifactId>byte-buddy</artifactId>
153-
<version>1.15.11</version>
154-
<scope>test</scope>
155-
</dependency>
156-
<dependency>
157-
<groupId>net.bytebuddy</groupId>
158-
<artifactId>byte-buddy-agent</artifactId>
159-
<version>1.15.11</version>
160-
<scope>test</scope>
161-
</dependency>
162138
<dependency>
163139
<groupId>org.junit.platform</groupId>
164140
<artifactId>junit-platform-console</artifactId>
@@ -271,6 +247,32 @@
271247
<profiles>
272248
<profile>
273249
<id>jre8</id>
250+
<dependencies>
251+
<dependency>
252+
<groupId>org.mockito</groupId>
253+
<artifactId>mockito-core</artifactId>
254+
<version>4.11.0</version>
255+
<scope>test</scope>
256+
</dependency>
257+
<dependency>
258+
<groupId>org.mockito</groupId>
259+
<artifactId>mockito-inline</artifactId>
260+
<version>4.11.0</version>
261+
<scope>test</scope>
262+
</dependency>
263+
<dependency>
264+
<groupId>net.bytebuddy</groupId>
265+
<artifactId>byte-buddy</artifactId>
266+
<version>1.15.11</version>
267+
<scope>test</scope>
268+
</dependency>
269+
<dependency>
270+
<groupId>net.bytebuddy</groupId>
271+
<artifactId>byte-buddy-agent</artifactId>
272+
<version>1.15.11</version>
273+
<scope>test</scope>
274+
</dependency>
275+
</dependencies>
274276
<build>
275277
<finalName>${project.artifactId}-${project.version}.jre8${releaseExt}</finalName>
276278
<plugins>
@@ -324,6 +326,27 @@
324326
</profile>
325327
<profile>
326328
<id>jre11</id>
329+
<dependencies>
330+
<!-- JDK 11 compatible Mockito -->
331+
<dependency>
332+
<groupId>org.mockito</groupId>
333+
<artifactId>mockito-core</artifactId>
334+
<version>5.14.2</version>
335+
<scope>test</scope>
336+
</dependency>
337+
<dependency>
338+
<groupId>net.bytebuddy</groupId>
339+
<artifactId>byte-buddy</artifactId>
340+
<version>1.17.5</version>
341+
<scope>test</scope>
342+
</dependency>
343+
<dependency>
344+
<groupId>net.bytebuddy</groupId>
345+
<artifactId>byte-buddy-agent</artifactId>
346+
<version>1.17.5</version>
347+
<scope>test</scope>
348+
</dependency>
349+
</dependencies>
327350
<build>
328351
<finalName>${project.artifactId}-${project.version}.jre11${releaseExt}</finalName>
329352
<plugins>
@@ -357,6 +380,27 @@
357380
</profile>
358381
<profile>
359382
<id>jre17</id>
383+
<dependencies>
384+
<!-- JDK 17 compatible Mockito -->
385+
<dependency>
386+
<groupId>org.mockito</groupId>
387+
<artifactId>mockito-core</artifactId>
388+
<version>5.14.2</version>
389+
<scope>test</scope>
390+
</dependency>
391+
<dependency>
392+
<groupId>net.bytebuddy</groupId>
393+
<artifactId>byte-buddy</artifactId>
394+
<version>1.17.5</version>
395+
<scope>test</scope>
396+
</dependency>
397+
<dependency>
398+
<groupId>net.bytebuddy</groupId>
399+
<artifactId>byte-buddy-agent</artifactId>
400+
<version>1.17.5</version>
401+
<scope>test</scope>
402+
</dependency>
403+
</dependencies>
360404
<build>
361405
<finalName>${project.artifactId}-${project.version}.jre17${releaseExt}</finalName>
362406
<plugins>
@@ -390,6 +434,27 @@
390434
</profile>
391435
<profile>
392436
<id>jre21</id>
437+
<dependencies>
438+
<!-- JDK 21 compatible Mockito -->
439+
<dependency>
440+
<groupId>org.mockito</groupId>
441+
<artifactId>mockito-core</artifactId>
442+
<version>5.14.2</version>
443+
<scope>test</scope>
444+
</dependency>
445+
<dependency>
446+
<groupId>net.bytebuddy</groupId>
447+
<artifactId>byte-buddy</artifactId>
448+
<version>1.17.5</version>
449+
<scope>test</scope>
450+
</dependency>
451+
<dependency>
452+
<groupId>net.bytebuddy</groupId>
453+
<artifactId>byte-buddy-agent</artifactId>
454+
<version>1.17.5</version>
455+
<scope>test</scope>
456+
</dependency>
457+
</dependencies>
393458
<build>
394459
<finalName>${project.artifactId}-${project.version}.jre21${releaseExt}</finalName>
395460
<plugins>
@@ -422,12 +487,33 @@
422487
</build>
423488
</profile>
424489
<profile>
425-
<id>jre23</id>
490+
<id>jre25</id>
426491
<activation>
427492
<activeByDefault>true</activeByDefault>
428493
</activation>
494+
<dependencies>
495+
<!-- JDK 25 compatible Mockito -->
496+
<dependency>
497+
<groupId>org.mockito</groupId>
498+
<artifactId>mockito-core</artifactId>
499+
<version>5.14.2</version>
500+
<scope>test</scope>
501+
</dependency>
502+
<dependency>
503+
<groupId>net.bytebuddy</groupId>
504+
<artifactId>byte-buddy</artifactId>
505+
<version>1.17.5</version>
506+
<scope>test</scope>
507+
</dependency>
508+
<dependency>
509+
<groupId>net.bytebuddy</groupId>
510+
<artifactId>byte-buddy-agent</artifactId>
511+
<version>1.17.5</version>
512+
<scope>test</scope>
513+
</dependency>
514+
</dependencies>
429515
<build>
430-
<finalName>${project.artifactId}-${project.version}.jre23${releaseExt}</finalName>
516+
<finalName>${project.artifactId}-${project.version}.jre25${releaseExt}</finalName>
431517
<plugins>
432518
<plugin>
433519
<groupId>org.apache.maven.plugins</groupId>
@@ -437,8 +523,8 @@
437523
<excludes>
438524
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
439525
</excludes>
440-
<source>23</source>
441-
<target>23</target>
526+
<source>25</source>
527+
<target>25</target>
442528
</configuration>
443529
</plugin>
444530
<plugin>
@@ -603,7 +689,7 @@
603689
<plugin>
604690
<groupId>org.jacoco</groupId>
605691
<artifactId>jacoco-maven-plugin</artifactId>
606-
<version>0.8.12</version>
692+
<version>0.8.14</version>
607693
<executions>
608694
<execution>
609695
<id>pre-test</id>

0 commit comments

Comments
 (0)