Skip to content

Fix for Java 24 w/ upcoming new Eclipse Sisu #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented May 9, 2025

The upcoming Eclipse Sisu will not provide anymore "shaded" JARs (with out without ASM).
Also, fixed the maven-executor test that failed on "unexpected stderr output" that now happens with Java 24 due Guava.

@cstamas
Copy link
Member Author

cstamas commented May 12, 2025

The "full-build" CI job builds Maven Site, that contains PMD report that craps out on Java 24:

	at net.sourceforge.pmd.lang.java.types.TypeOps.isSubClassOfNoInterface(TypeOps.java:1957)
	at net.sourceforge.pmd.lang.java.types.TypeOps.isSubClassOfNoInterface(TypeOps.java:1957)
	at net.sourceforge.pmd.lang.java.types.TypeOps.isSubClassOfNoInterface(TypeOps.java:1957)
	at net.sourceforge.pmd.lang.java.types.TypeOps.isSubClassOfNoInterface(TypeOps.java:1957)
Error: [ERROR] Unknown error occurred while executing a PmdRunnable: **java.lang.StackOverflowError**

@cstamas
Copy link
Member Author

cstamas commented May 12, 2025

The IT failures:

[ERROR] Errors: 
[ERROR]   MavenITmng7045DropUselessAndOutdatedCdiApiTest.testShouldNotLeakCdiApi:41 » Verification Exit code was non-zero: 1; command line and log = 
[ERROR]   MavenITmng7160ExtensionClassloader.testVerify:44 » Verification Text not found in log: xpp3 -> mvn
[ERROR]   MavenITmng7587Jsr330.test:57 » Verification Exit code was non-zero: 1; command line and log = 

7045 craps out due old Groovy on Java 24, the latter two due lack of sisu index, but the build does not calls index plugin explicitly...

@slawekjaranowski
Copy link
Member

@cstamas
Copy link
Member Author

cstamas commented May 12, 2025

ITs seems fixed, full-build still plagued by PMD issue

@@ -142,7 +142,7 @@ private String validateOutput(boolean shave, ByteArrayOutputStream stdout, ByteA
}
// sanity checks: stderr has any OR result is empty string (no method should emit empty string)
if (stderr.size() > 0 || result.trim().isEmpty()) {
throw new ExecutorException(
System.err.println(
Copy link
Contributor

@Pankraz76 Pankraz76 May 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have logger for this? using system directly would cause spotbugs violations. We having this code pattern all over, so its justiciable, still questionable as bigger picture.

https://stackoverflow.com/questions/8601831/do-not-use-system-out-println-in-server-side-code

Why cannot we throw anymore, please? Of course we dont want to lose the information. As we having error we can not tread, how and why continue?
Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot throw, as this code (whole maven-executor) purpose is to execute Maven (embedded in JVM, or forked as in forked child process) real Maven mvn command in IT-like scenarios (this very code is used in Maven ITs). This codebase supports Maven 3 and Maven 4 transparently. The goal of PR is to "prepare it for Java 24".

All existing Maven versions released so far (including Maven 4 rc releases) emit warning on Java 24, and there is nothing to be done here (the MNG-8399 and/or alike). Hence, to make this code work on Java 24 AND be able to use current releases (ie. 3.9.9 or 4-rc-3), it cannot throw anymore, as err logging is part of "normal operation" on those Maven versions on Java 24. Or in other words, if we'd throw here (as before), we would not be able to run Maven 3.9.9 and 4-rc-3 and older Maven versions using Java 24, only "fixed" Maven 3.9.10 and upcoming 4-rc-4, and that would narrow the capabilities of this module too much.

The point of this PR is to prepare codebase be able to run on Java 24 as is, and this throw was one of the obstacles preventing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx.

@cstamas cstamas closed this May 20, 2025
@cstamas cstamas deleted the fix-java24 branch May 20, 2025 12:12
@@ -829,6 +829,17 @@ under the License.</licenseText>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Copy link
Contributor

@Pankraz76 Pankraz76 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cost of carry? the plugin seems not in use:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants