Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
desruisseaux commentedon 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.
Bukama commentedon Apr 25, 2025
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 commentedon Apr 25, 2025
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 commentedon Apr 25, 2025
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 commentedon Apr 25, 2025
Path of my plugin fork:
D:\Github\Maven\maven-compiler-pluginpath of the clone of your PR
D:\Github\Maven-Official-Testwiese\maven-compiler-pluginOutput
desruisseaux commentedon Apr 25, 2025
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.Use the native encoding for reading the file written by a native proc…
desruisseaux commentedon Apr 26, 2025
Should be fixed in commit 7bac7a5. Can you try again please?
Use the native encoding for reading the file written by a native proc…
desruisseaux commentedon May 4, 2025
Fixed by 3a56f5a.