plexus-compiler icon indicating copy to clipboard operation
plexus-compiler copied to clipboard

JavaCompiler has error output, but compile result is true

Open chenxubiao opened this issue 2 years ago • 0 comments

i use mac m1

java -v openjdk version "1.8.0_362" OpenJDK Runtime Environment (Zulu 8.68.0.21-CA-macos-aarch64) (build 1.8.0_362-b09) OpenJDK 64-Bit Server VM (Zulu 8.68.0.21-CA-macos-aarch64) (build 25.362-b09, mixed mode)

mvn -v Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29) Maven home: /opt/homebrew/Cellar/mvnd/0.9.0/libexec Java version: 1.8.0_362, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "mac os x", version: "12.5.1", arch: "aarch64", family: "mac"

pom maven-compiler-plugin:3.7.0 plexus-compiler-api:2.8.4

javax.tools.JavaCompiler

mvn clean install -Dmaven.test.skip=true

i have some spring-boot java projects. A project dependency B project. B project already built and installed into maven local repository.

when i delete B jar in maven local repository before compiler A, compile has error log output, but compile result is success true.

such as image

when i see the log [INFO] Compiling 951 source files xxxx, i deleted my local mvn repository dependency jar quickly. rm ~/.m2/xxx/1.0.0-SNAPSHOT/xxx-1.0.0-SNAPSHOT.jar.

and then the bug reproduced.

when i debug this issue org.codehaus.plexus.compiler.javac.JavaxToolsCompiler#compileInProcess

image

it's looks like a jdk 1.8 bug.

chenxubiao avatar Mar 13 '23 10:03 chenxubiao