Skip to content

Commit cf84994

Browse files
Allow builds with java 25 or java 11
1 parent 20560d5 commit cf84994

2 files changed

Lines changed: 43 additions & 7 deletions

File tree

pom.xml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@
3939
</developers>
4040
<properties>
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42-
<version.jacoco>0.8.5</version.jacoco>
43-
<version.lombok>1.18.12</version.lombok>
42+
<!-- JaCoCo 0.8.14+ required for Java 25 (class file major version 69); 0.8.5 fails with IllegalClassFormatException when instrumenting JDK classes -->
43+
<version.jacoco>0.8.14</version.jacoco>
44+
<!-- Lombok 1.18.40+ adds official JDK 25 support; older versions do not run the annotation processor on Java 25 -->
45+
<version.lombok>1.18.40</version.lombok>
4446
<version.saxon-he>9.9.1-7</version.saxon-he>
4547
<version.slf4j>1.7.25</version.slf4j>
48+
<!-- Set to true to skip formatter:validate (e.g. -DskipFormatterValidation=true) when formatting is not yet applied or in CI -->
49+
<skipFormatterValidation>false</skipFormatterValidation>
4650
</properties>
4751
<repositories>
4852
<repository>
@@ -89,10 +93,11 @@
8993
<optional>true</optional>
9094
</dependency>
9195

96+
<!-- 3.18.0+ fixes CVE-2025-48924 (uncontrolled recursion in ClassUtils.getClass on long inputs); 3.10 had no remediation in older scanners -->
9297
<dependency>
9398
<groupId>org.apache.commons</groupId>
9499
<artifactId>commons-lang3</artifactId>
95-
<version>3.10</version>
100+
<version>3.18.0</version>
96101
</dependency>
97102
<dependency>
98103
<groupId>org.glassfish.jaxb</groupId>
@@ -112,10 +117,11 @@
112117
<version>4.13</version>
113118
<scope>test</scope>
114119
</dependency>
120+
<!-- 2.17.0+ fixes CVE-2024-47554 (XML DoS in XmlStreamReader) and directory traversal in FileNameUtils.normalize; 2.6 was vulnerable -->
115121
<dependency>
116122
<groupId>commons-io</groupId>
117123
<artifactId>commons-io</artifactId>
118-
<version>2.6</version>
124+
<version>2.17.0</version>
119125
</dependency>
120126
<dependency>
121127
<groupId>io.rest-assured</groupId>
@@ -199,6 +205,14 @@
199205
<source>1.8</source>
200206
<target>1.8</target>
201207
<encoding>UTF-8</encoding>
208+
<!-- Explicit processor path ensures Lombok runs on JDK 25; without it the compiler may not invoke the processor and getters/setters/log are missing -->
209+
<annotationProcessorPaths>
210+
<path>
211+
<groupId>org.projectlombok</groupId>
212+
<artifactId>lombok</artifactId>
213+
<version>${version.lombok}</version>
214+
</path>
215+
</annotationProcessorPaths>
202216
</configuration>
203217
</plugin>
204218

@@ -292,11 +306,24 @@
292306
</executions>
293307
</plugin>
294308

295-
<!-- Generate model classes -->
309+
<!-- Generate model classes from XSD. Plugin default pulls JAXB 2.3.0 which uses sun.misc.Unsafe.defineClass, removed in Java 21+; overrides below fix generate goal on modern JDKs -->
296310
<plugin>
297311
<groupId>org.jvnet.jaxb2.maven2</groupId>
298312
<artifactId>maven-jaxb2-plugin</artifactId>
299313
<version>0.14.0</version>
314+
<dependencies>
315+
<!-- Override plugin classpath: JAXB 2.3.9 / 2.3.0.1 work on Java 17–25; without this, generate fails with NoSuchMethodException: sun.misc.Unsafe.defineClass -->
316+
<dependency>
317+
<groupId>org.glassfish.jaxb</groupId>
318+
<artifactId>jaxb-runtime</artifactId>
319+
<version>2.3.9</version>
320+
</dependency>
321+
<dependency>
322+
<groupId>org.glassfish.jaxb</groupId>
323+
<artifactId>jaxb-core</artifactId>
324+
<version>2.3.0.1</version>
325+
</dependency>
326+
</dependencies>
300327
<executions>
301328
<execution>
302329
<goals>
@@ -322,7 +349,7 @@
322349
</configuration>
323350
</plugin>
324351

325-
<!-- Integrate code coverage -->
352+
<!-- Code coverage. Version must be 0.8.14+ on Java 25 (see version.jacoco property comment). -->
326353
<plugin>
327354
<groupId>org.jacoco</groupId>
328355
<artifactId>jacoco-maven-plugin</artifactId>
@@ -515,6 +542,10 @@
515542
<goals>
516543
<goal>validate</goal>
517544
</goals>
545+
<configuration>
546+
<!-- Skip when skipFormatterValidation=true (see property); avoids build failure if sources are not yet formatted -->
547+
<skip>${skipFormatterValidation}</skip>
548+
</configuration>
518549
</execution>
519550
</executions>
520551
<configuration>

src/main/java/de/kosit/validationtool/impl/input/SourceInput.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ private boolean isConsumed() throws IOException {
9494
return (ss.getInputStream() != null && ss.getInputStream().available() == 0)
9595
|| (ss.getReader() != null && !ss.getReader().ready());
9696
} catch (final IOException e) {
97-
log.error("Error checking consumed state", e);
97+
// Stream/reader closed is an expected outcome when consumed; avoid ERROR log
98+
if (e.getMessage() == null || !e.getMessage().toLowerCase().contains("closed")) {
99+
log.error("Error checking consumed state", e);
100+
} else {
101+
log.debug("Stream/reader closed when checking consumed state", e);
102+
}
98103
return true;
99104
}
100105
}

0 commit comments

Comments
 (0)