unv-unv opened a new issue, #1043:
URL: https://github.com/apache/maven-compiler-plugin/issues/1043

   ### Affected version
   
   3.15.0
   
   ### Bug description
   
   Java file with compilation error on line 5:
   ```java
   package com.test;
   
   public class Test {
   String foo() {
    null;
   }
   }
   ```
   
   Javac output:
   ```
   C:\Projects\maven-test\src\main\java\com\test>javac Test.java
   Test.java:5: error: not a statement
    null;
    ^
   1 error
   ```
   
   maven-compiler-plugin output without fork (correct):
   ```
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) 
on project test: Compilation failure
   [ERROR] 
/C:/Projects/Consulo/.archive/maven-test/src/main/java/com/test/Test.java:[5,2] 
not a statement
   ```
   
   maven-compiler-plugin output with fork (column shifted by -1):
   
   ```
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) 
on project test: Compilation failure
   [ERROR] 
C:\Projects\Consulo\.archive\maven-test\src\main\java\com\test\Test.java:[5,1] 
not a statement
   ```
   
   Archive with example project:
   
[maven-test.zip](https://github.com/user-attachments/files/26674773/maven-test.zip)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to