Skip to content

Commit 747e1f5

Browse files
authored
Closes JAVA-33719: Maven surefire plugin upgrade. (#16774)
* JAVA-33719: Forced the version for all maven surefire plugins. Update to 3.2.5 * JAVA-33719: Fix errors in pom files * Revert jhipster change * Fix maven-modules * Fix modules * Fix spring-project * Fix spring-boot-modules * minor change * Fix spring-swagger-codegen * fix core-java-16 * Fix apache-poi * Fix guava-18 * Fix core-java-io-apis * Fix core-java-numbers-conversions * Fix Apache-poi * Fix attempt to apache-poi * Fix modules. * Fix junit-5-basics-2 * Fix jakart-ee
1 parent 03bcfbd commit 747e1f5

File tree

176 files changed

+275
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+275
-123
lines changed

apache-httpclient4/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
<plugin>
204204
<groupId>org.apache.maven.plugins</groupId>
205205
<artifactId>maven-surefire-plugin</artifactId>
206+
<version>${maven-surefire-plugin.version}</version>
206207
<executions>
207208
<execution>
208209
<phase>integration-test</phase>

apache-kafka/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
<plugin>
165165
<groupId>org.apache.maven.plugins</groupId>
166166
<artifactId>maven-surefire-plugin</artifactId>
167+
<version>${maven-surefire-plugin.version}</version>
167168
<configuration>
168169
<argLine>
169170
--add-opens java.base/java.time=ALL-UNNAMED

apache-poi/pom.xml

+3-8
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
<groupId>org.jxls</groupId>
2424
<artifactId>jxls-jexcel</artifactId>
2525
<version>${jexcel.version}</version>
26-
<exclusions>
27-
<exclusion>
28-
<artifactId>commons-logging</artifactId>
29-
<groupId>commons-logging</groupId>
30-
</exclusion>
31-
</exclusions>
3226
</dependency>
3327
<dependency>
3428
<groupId>org.dhatim</groupId>
@@ -70,11 +64,12 @@
7064
</build>
7165

7266
<properties>
73-
<poi.version>5.2.5</poi.version>
67+
<poi.version>5.3.0</poi.version>
7468
<jexcel.version>1.0.9</jexcel.version>
75-
<fastexcel.version>0.17.0</fastexcel.version>
69+
<fastexcel.version>0.18.0</fastexcel.version>
7670
<maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
7771
<log4j.version>2.23.1</log4j.version>
72+
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> <!-- cannot upgrade without breaking build -->
7873
</properties>
7974

8075
</project>

apache-poi/src/test/java/com/baeldung/poi/excel/ExcelCellFormatterUnitTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import org.apache.poi.ss.usermodel.Sheet;
1111
import org.apache.poi.ss.usermodel.Workbook;
1212
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
13-
import org.junit.Before;
14-
import org.junit.Test;
13+
import org.junit.jupiter.api.BeforeEach;
14+
import org.junit.jupiter.api.Test;
1515

16-
public class ExcelCellFormatterUnitTest {
16+
class ExcelCellFormatterUnitTest {
1717
private static final String FILE_NAME = "ExcelCellFormatterTest.xlsx";
1818
private static final int STRING_CELL_INDEX = 0;
1919
private static final int BOOLEAN_CELL_INDEX = 1;
@@ -23,13 +23,13 @@ public class ExcelCellFormatterUnitTest {
2323

2424
private String fileLocation;
2525

26-
@Before
27-
public void setup() throws IOException, URISyntaxException {
26+
@BeforeEach
27+
void setup() throws IOException, URISyntaxException {
2828
fileLocation = Paths.get(ClassLoader.getSystemResource(FILE_NAME).toURI()).toString();
2929
}
3030

3131
@Test
32-
public void givenStringCell_whenGetCellStringValue_thenReturnStringValue() throws IOException {
32+
void givenStringCell_whenGetCellStringValue_thenReturnStringValue() throws IOException {
3333
Workbook workbook = new XSSFWorkbook(fileLocation);
3434
Sheet sheet = workbook.getSheetAt(0);
3535
Row row = sheet.getRow(0);
@@ -40,7 +40,7 @@ public void givenStringCell_whenGetCellStringValue_thenReturnStringValue() throw
4040
}
4141

4242
@Test
43-
public void givenBooleanCell_whenGetCellStringValue_thenReturnBooleanStringValue() throws IOException {
43+
void givenBooleanCell_whenGetCellStringValue_thenReturnBooleanStringValue() throws IOException {
4444
Workbook workbook = new XSSFWorkbook(fileLocation);
4545
Sheet sheet = workbook.getSheetAt(0);
4646
Row row = sheet.getRow(0);
@@ -51,7 +51,7 @@ public void givenBooleanCell_whenGetCellStringValue_thenReturnBooleanStringValue
5151
}
5252

5353
@Test
54-
public void givenNumericCell_whenGetCellStringValue_thenReturnNumericStringValue() throws IOException {
54+
void givenNumericCell_whenGetCellStringValue_thenReturnNumericStringValue() throws IOException {
5555
Workbook workbook = new XSSFWorkbook(fileLocation);
5656
Sheet sheet = workbook.getSheetAt(0);
5757
Row row = sheet.getRow(0);
@@ -63,7 +63,7 @@ public void givenNumericCell_whenGetCellStringValue_thenReturnNumericStringValue
6363
}
6464

6565
@Test
66-
public void givenFormualCell_whenGetCellStringValue_thenReturnOriginalFormulaString() throws IOException {
66+
void givenFormulaCell_whenGetCellStringValue_thenReturnOriginalFormulaString() throws IOException {
6767
Workbook workbook = new XSSFWorkbook(fileLocation);
6868
Sheet sheet = workbook.getSheetAt(0);
6969
Row row = sheet.getRow(0);
@@ -74,7 +74,7 @@ public void givenFormualCell_whenGetCellStringValue_thenReturnOriginalFormulaStr
7474
}
7575

7676
@Test
77-
public void givenFormualCell_whenGetCellStringValueForFormula_thenReturnOriginalFormulatring() throws IOException {
77+
void givenFormulaCell_whenGetCellStringValueForFormula_thenReturnOriginalFormulaString() throws IOException {
7878
Workbook workbook = new XSSFWorkbook(fileLocation);
7979
Sheet sheet = workbook.getSheetAt(0);
8080
Row row = sheet.getRow(0);

apache-poi/src/test/java/com/baeldung/poi/excel/merge/ExcelCellMergerUnitTest.java

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package com.baeldung.poi.excel.merge;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertNotNull;
53

6-
import java.io.FileOutputStream;
4+
import static org.junit.jupiter.api.Assertions.assertEquals;
5+
import static org.junit.jupiter.api.Assertions.assertNotNull;
6+
77
import java.io.IOException;
8-
import java.io.InputStream;
98
import java.net.URISyntaxException;
10-
import java.nio.file.Files;
119
import java.nio.file.Paths;
1210

1311
import org.apache.poi.ss.usermodel.Cell;
@@ -19,10 +17,11 @@
1917
import org.apache.poi.ss.usermodel.Workbook;
2018
import org.apache.poi.ss.util.CellRangeAddress;
2119
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
22-
import org.junit.Before;
23-
import org.junit.Test;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
22+
23+
class ExcelCellMergerUnitTest {
2424

25-
public class ExcelCellMergerUnitTest {
2625
private static final String FILE_NAME = "ExcelCellFormatterTest.xlsx";
2726

2827
private static final String FILE_NAME_2 = "MergedAlignCell.xlsx";
@@ -31,21 +30,25 @@ public class ExcelCellMergerUnitTest {
3130

3231
private String fileLocation2;
3332

34-
@Before
35-
public void setup() throws IOException, URISyntaxException {
36-
fileLocation = Paths.get(ClassLoader.getSystemResource(FILE_NAME).toURI()).toString();
37-
fileLocation2 = Paths.get(ClassLoader.getSystemResource(FILE_NAME_2).toURI()).toString();
33+
@BeforeEach
34+
void setup() throws IOException, URISyntaxException {
35+
fileLocation = Paths.get(ClassLoader.getSystemResource(FILE_NAME)
36+
.toURI())
37+
.toString();
38+
fileLocation2 = Paths.get(ClassLoader.getSystemResource(FILE_NAME_2)
39+
.toURI())
40+
.toString();
3841
}
3942

4043
@Test
41-
public void givenCellIndex_whenAddMergeRegion_thenMergeRegionCreated() throws IOException {
44+
void givenCellIndex_whenAddMergeRegion_thenMergeRegionCreated() throws IOException {
4245
Workbook workbook = new XSSFWorkbook(fileLocation);
4346
Sheet sheet = workbook.getSheetAt(0);
4447

4548
assertEquals(0, sheet.getNumMergedRegions());
46-
int firstRow = 0;
47-
int lastRow = 0;
48-
int firstCol = 0;
49+
int firstRow = 0;
50+
int lastRow = 0;
51+
int firstCol = 0;
4952
int lastCol = 2;
5053
sheet.addMergedRegion(new CellRangeAddress(firstRow, lastRow, firstCol, lastCol));
5154
assertEquals(1, sheet.getNumMergedRegions());
@@ -54,19 +57,19 @@ public void givenCellIndex_whenAddMergeRegion_thenMergeRegionCreated() throws IO
5457
}
5558

5659
@Test
57-
public void givenCellRefString_whenAddMergeRegion_thenMergeRegionCreated() throws IOException {
60+
void givenCellRefString_whenAddMergeRegion_thenMergeRegionCreated() throws IOException {
5861
Workbook workbook = new XSSFWorkbook(fileLocation);
5962
Sheet sheet = workbook.getSheetAt(0);
6063

61-
assertEquals(0, sheet.getNumMergedRegions());
64+
assertEquals(0, sheet.getNumMergedRegions());
6265
sheet.addMergedRegion(CellRangeAddress.valueOf("A1:C1"));
6366
assertEquals(1, sheet.getNumMergedRegions());
6467

6568
workbook.close();
6669
}
6770

6871
@Test
69-
public void givenCellIndex_whenAddMergeRegionWithCenterAlignment_thenMergeRegionWithCenterCreated() throws IOException {
72+
void givenCellIndex_whenAddMergeRegionWithCenterAlignment_thenMergeRegionWithCenterCreated() throws IOException {
7073
Workbook workbook = new XSSFWorkbook(fileLocation2);
7174
Sheet sheet = workbook.getSheetAt(0);
7275

@@ -91,7 +94,8 @@ public void givenCellIndex_whenAddMergeRegionWithCenterAlignment_thenMergeRegion
9194
assertEquals(1, sheet.getNumMergedRegions());
9295

9396
// Verify cell style (alignment)
94-
Cell readCell = sheet.getRow(firstRow).getCell(firstCol);
97+
Cell readCell = sheet.getRow(firstRow)
98+
.getCell(firstCol);
9599
assertNotNull(readCell);
96100
CellStyle readCellStyle = readCell.getCellStyle();
97101
assertEquals(HorizontalAlignment.CENTER, readCellStyle.getAlignment());

core-groovy-modules/core-groovy-2/gmavenplus-pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
</plugin>
112112
<plugin>
113113
<artifactId>maven-surefire-plugin</artifactId>
114-
<version>2.20.1</version>
114+
<version>${maven-surefire-plugin.version}</version>
115115
<configuration>
116116
<useFile>false</useFile>
117117
<includes>

core-groovy-modules/core-groovy-2/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
</plugin>
116116
<plugin>
117117
<artifactId>maven-surefire-plugin</artifactId>
118+
<version>${maven-surefire-plugin.version}</version>
118119
<configuration>
119120
<useFile>false</useFile>
120121
<includes>

core-java-modules/core-java-14/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<plugin>
3838
<groupId>org.apache.maven.plugins</groupId>
3939
<artifactId>maven-surefire-plugin</artifactId>
40-
<version>${surefire.plugin.version}</version>
40+
<version>${maven-surefire-plugin.version}</version>
4141
<configuration>
4242
<argLine>--add-modules jdk.incubator.foreign</argLine>
4343
</configuration>

core-java-modules/core-java-16/pom.xml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>core-java-16</artifactId>
77
<packaging>jar</packaging>
@@ -34,7 +34,7 @@
3434
<plugin>
3535
<groupId>org.apache.maven.plugins</groupId>
3636
<artifactId>maven-surefire-plugin</artifactId>
37-
<version>${surefire.plugin.version}</version>
37+
<version>${maven-surefire-plugin.version}</version>
3838
<configuration>
3939
<argLine>
4040
--add-opens core.java/com.baeldung.features=ALL-UNNAMED
@@ -45,15 +45,11 @@
4545
<dependency>
4646
<groupId>org.apache.maven.surefire</groupId>
4747
<artifactId>surefire-api</artifactId>
48-
<version>${surefire.plugin.version}</version>
48+
<version>${maven-surefire-plugin.version}</version>
4949
</dependency>
5050
</dependencies>
5151
</plugin>
5252
</plugins>
5353
</build>
5454

55-
<properties>
56-
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
57-
</properties>
58-
5955
</project>

core-java-modules/core-java-17/pom.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<plugin>
3535
<groupId>org.apache.maven.plugins</groupId>
3636
<artifactId>maven-surefire-plugin</artifactId>
37-
<version>${surefire.plugin.version}</version>
37+
<version>${maven-surefire-plugin.version}</version>
3838
<configuration>
3939
<argLine>--enable-preview</argLine>
4040
<argLine>--enable-native-access=core.java</argLine>
@@ -65,8 +65,4 @@
6565
</dependency>
6666
</dependencies>
6767

68-
<properties>
69-
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
70-
</properties>
71-
7268
</project>

core-java-modules/core-java-18/pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<plugin>
3030
<groupId>org.apache.maven.plugins</groupId>
3131
<artifactId>maven-surefire-plugin</artifactId>
32-
<version>${surefire.plugin.version}</version>
32+
<version>${maven-surefire-plugin.version}</version>
3333
<configuration>
3434
<forkCount>1</forkCount>
3535
</configuration>
@@ -48,7 +48,6 @@
4848
<maven.compiler.source.version>18</maven.compiler.source.version>
4949
<maven.compiler.target.version>18</maven.compiler.target.version>
5050
<maven.compiler.release>18</maven.compiler.release>
51-
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
5251
</properties>
5352

5453
</project>

core-java-modules/core-java-20/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<plugin>
5050
<groupId>org.apache.maven.plugins</groupId>
5151
<artifactId>maven-surefire-plugin</artifactId>
52+
<version>${maven-surefire-plugin.version}</version>
5253
<configuration>
5354
<argLine>--enable-preview --add-modules=jdk.incubator.concurrent</argLine>
5455
</configuration>

core-java-modules/core-java-21/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<plugin>
3131
<groupId>org.apache.maven.plugins</groupId>
3232
<artifactId>maven-surefire-plugin</artifactId>
33+
<version>${maven-surefire-plugin.version}</version>
3334
<configuration>
3435
<argLine>--enable-preview</argLine>
3536
</configuration>

core-java-modules/core-java-9-jigsaw/library-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<plugin>
4040
<groupId>org.apache.maven.plugins</groupId>
4141
<artifactId>maven-surefire-plugin</artifactId>
42-
<version>3.0.0-M5</version>
42+
<version>${maven-surefire-plugin.version}</version>
4343
<configuration>
4444
<useModulePath>false</useModulePath>
4545
</configuration>

core-java-modules/core-java-9-new-features/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
</plugin>
7373
<plugin>
7474
<artifactId>maven-surefire-plugin</artifactId>
75+
<version>${maven-surefire-plugin.version}</version>
7576
<configuration>
7677
<argLine>--add-modules=jdk.incubator.httpclient</argLine>
7778
</configuration>

core-java-modules/core-java-collections-array-list/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<plugin>
3535
<groupId>org.apache.maven.plugins</groupId>
3636
<artifactId>maven-surefire-plugin</artifactId>
37-
<version>${surefire.plugin.version}</version>
37+
<version>${maven-surefire-plugin.version}</version>
3838
<configuration>
3939
<argLine>
4040
--add-opens java.base/java.util=ALL-UNNAMED
@@ -47,7 +47,6 @@
4747
<properties>
4848
<maven-compiler-plugin.source>21</maven-compiler-plugin.source>
4949
<maven-compiler-plugin.target>21</maven-compiler-plugin.target>
50-
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
5150
</properties>
5251

53-
</project>
52+
</project>

core-java-modules/core-java-collections-maps-4/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<plugin>
3939
<groupId>org.apache.maven.plugins</groupId>
4040
<artifactId>maven-surefire-plugin</artifactId>
41-
<version>3.0.0-M5</version>
41+
<version>${maven-surefire-plugin.version}</version>
4242
<configuration>
4343
<!-- those tests are not made for CI purposes, but for manual testing -->
4444
<groups>!performance</groups>

core-java-modules/core-java-collections-maps-7/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<plugin>
5353
<groupId>org.apache.maven.plugins</groupId>
5454
<artifactId>maven-surefire-plugin</artifactId>
55+
<version>${maven-surefire-plugin.version}</version>
5556
<configuration>
5657
<argLine>
5758
--add-opens java.base/java.util=ALL-UNNAMED

core-java-modules/core-java-collections-maps-8/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<plugin>
3737
<groupId>org.apache.maven.plugins</groupId>
3838
<artifactId>maven-surefire-plugin</artifactId>
39+
<version>${maven-surefire-plugin.version}</version>
3940
<configuration>
4041
<argLine>
4142
--add-opens java.base/java.util=ALL-UNNAMED

0 commit comments

Comments
 (0)