Skip to content

master does not build on windows with Maven 4.0.0-rc-3 #327

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

Open
Bukama opened this issue Apr 25, 2025 · 7 comments
Open

master does not build on windows with Maven 4.0.0-rc-3 #327

Bukama opened this issue Apr 25, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@Bukama
Copy link
Contributor

Bukama commented Apr 25, 2025

Affected version

4.0.0-beta-3-SNAPSHOT

Bug description

I wanted to update parent version, but I got test errors. So I tried to build master and got the same error too.

When trying to build current master (4.0.0-beta-3-SNAPSHOT) as of commit 7d44073 the build breaks on my Windows machine

D:\Github\Maven\maven-compiler-plugin>mvn clean verify site -P run-its -V
Apache Maven 4.0.0-rc-3 (3952d00ce65df6753b63a51e86b1f626c55a8df2)
Maven home: C:\apache-maven-4.0.0-rc-3
Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: C:\JDK\Java21
Default locale: de_DE, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "winnt"
[WARNING] [stderr] OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[ERROR] Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.515 s <<< FAILURE! -- in org.apache.maven.plugin.compiler.CompilerMojoTestCase
[ERROR] org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojo, TestCompilerMojo) -- Time elapsed: 0.506 s <<< ERROR!
org.apache.maven.plugin.compiler.CompilationFailureException:
Cannot compile myGroupId:myArtifactId:jar:1.0-SNAPSHOT main classes.
The first error is: Input length = 1
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.compile(AbstractCompilerMojo.java:1458)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:995)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:165)
        at org.apache.maven.plugin.compiler.CompilerMojoTestCase.testCompilerFork(CompilerMojoTestCase.java:209)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
        at java.base/java.lang.String.throwMalformed(String.java:1279)
        at java.base/java.lang.String.decodeUTF8_UTF16(String.java:1235)
        at java.base/java.lang.String.newStringUTF8NoRepl(String.java:759)
        at java.base/java.lang.String.newStringNoRepl1(String.java:790)
        at java.base/java.lang.String.newStringNoRepl(String.java:772)
        at java.base/java.lang.System$2.newStringNoRepl(System.java:2476)
        at java.base/java.nio.file.Files.readString(Files.java:3349)
        at java.base/java.nio.file.Files.readString(Files.java:3305)
        at org.apache.maven.plugin.compiler.ForkedTool.run(ForkedTool.java:167)
        at org.apache.maven.plugin.compiler.ForkedCompiler$1.call(ForkedCompiler.java:96)
        at org.apache.maven.plugin.compiler.CompilationTaskSources.compile(CompilationTaskSources.java:55)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.compile(AbstractCompilerMojo.java:1395)
        ... 6 more

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   CompilerMojoTestCase.testCompilerFork:209 » CompilationFailure Cannot compile myGroupId:myArtifactId:jar:1.0-SNAPSHOT main classes.
The first error is: Input length = 1
@Bukama Bukama added the bug Something isn't working label Apr 25, 2025
@desruisseaux
Copy link
Contributor

I think that this is a duplicated of #326. The master is known to not compile against Maven 4.0.0-rc-3. This is already fixed in pull request #320, which is waiting since April 6th for a volunteer to review it.

@Bukama
Copy link
Contributor Author

Bukama commented Apr 25, 2025

I think that this is a duplicated of #326. The master is known to not compile against Maven 4.0.0-rc-3. This is already fixed in pull request #320, which is waiting since April 6th for a volunteer to review it.

I cloned the branch of your PR and get the same error there.

Needed to run as admin, as one other test otherwise fails due to execution rights.

@desruisseaux
Copy link
Contributor

This error didn't occurred in the GitHub action, including on Windows. What is the full name of the directory where the plugin has been cloned on your machine? For checking if there is a special character which appears when the plugin converts a path to an absolute path.

@desruisseaux
Copy link
Contributor

Correction: maybe no need to provide the full path. Looking at the line where the error occurred, I think that this is an encoding issue. What is the encoding of your Windows system? Can you check if System.getProperty("native.encoding") returns the right encoding on your system?

@Bukama
Copy link
Contributor Author

Bukama commented Apr 25, 2025

Path of my plugin fork:

D:\Github\Maven\maven-compiler-plugin

path of the clone of your PR

D:\Github\Maven-Official-Testwiese\maven-compiler-plugin

Output

C:\Windows\system32>jshell
|  Willkommen bei JShell - Version 21.0.1
|  Geben Sie für eine Einführung Folgendes ein: /help intro

jshell> System.getProperty("native.encoding")
$1 ==> "Cp1252"

jshell>

@desruisseaux
Copy link
Contributor

Thanks. I wll try tomorrow to add a commit using the encoding returned by System.getProperty("native.encoding") for parsing the file produced by the forked compiler.

@desruisseaux
Copy link
Contributor

Should be fixed in commit 7bac7a5. Can you try again please?

desruisseaux added a commit to Geomatys/maven-compiler-plugin that referenced this issue Apr 27, 2025
…ess (forked compiler).

Avoid too verbatim verifications of locale-sensitive compiler messages.
apache#327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants