codehaus-plexus / plexus-compiler

Plexus compiler a layer on top of compilers and used by maven-compiler-plugin
https://codehaus-plexus.github.io/plexus-compiler/
34 stars 58 forks source link

Version of the javac compiler cannot be determined corretly when custom compiler executable is set #408

Open luktom opened 1 month ago

luktom commented 1 month ago

Hi,

we are using a javac wrapper for compiling our project, its doing some stuff and delegates the compilation to javac. The wrapper is set in the 'executable' property of the maven-compiler-plugin. The wrapper needs some custom arguments provided via the CLI arguments of compiler executable.

After updating the maven-compiler-plugin our project fails to compile, the root cause was introduced in the #357. The 'JavacCompiler#getOutOfProcessJavacVersion' invokes the compiler executable only with '-version' parameter, but without any custom parameters defined in the 'CompilerConfiguration#customCompilerArguments'. Thus our wrapper and possibly all custom executables are failing to run properly due to missing custom arguments.

cmconti commented 2 days ago

i'm still experimenting, but this change also appears to break setting up a toolchain for jdk 1.4 (don't ask) since that javac doesn;t support -version as a param