maven-compiler-plugin icon indicating copy to clipboard operation
maven-compiler-plugin copied to clipboard

[MCOMPILER-537] Inconsistent behaviour when compiler is forked

Open jira-importer opened this issue 2 years ago • 1 comments

Sebb opened MCOMPILER-537 and commented

Further to MCOMPILER-491, there is another difference between forked and non-forked compiles. Informational messages about deprecation etc are not shown in the forked case.

For example:

$ git clone https://gitbox.apache.org/repos/asf/commons-compress.git --single-branch --branch commons-compress-1.22 --depth 1 $ cd commons-compress $ mvn clean compile ... [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ commons-compress --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 360 source files to /private/tmp/commons-compress/target/classes [INFO] /private/tmp/commons-compress/src/main/java/org/apache/commons/compress/harmony/pack200/Archive.java: Some input files use or override a deprecated API. [INFO] /private/tmp/commons-compress/src/main/java/org/apache/commons/compress/harmony/pack200/Archive.java: Recompile with -Xlint:deprecation for details. [INFO] /private/tmp/commons-compress/src/main/java/org/apache/commons/compress/harmony/unpack200/AttributeLayoutMap.java: Some input files use unchecked or unsafe operations. [INFO] /private/tmp/commons-compress/src/main/java/org/apache/commons/compress/harmony/unpack200/AttributeLayoutMap.java: Recompile with -Xlint:unchecked for details. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS ... $ mvn clean compile -Dcommons.compiler.fork=true ...[INFO] Compiling 360 source files to /private/tmp/commons-compress/target/classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ ...


Issue Links:

  • MCOMPILER-491 testCompile goal doesn't fail the build when encoding error occurs

jira-importer avatar Jun 06 '23 10:06 jira-importer

Sebb commented

AFAICT the compiler does produce these messages when run stand-alone; it looks like Maven suppresses them.

I ran the command shown in the -X output, and got the following:

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

(The associated file names are not shown).

This was with

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /opt/apache-maven-3.6.3 Java version: 19.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-19.0.2.jdk/Contents/Home Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "12.6.6", arch: "aarch64", family: "mac"

jira-importer avatar Jun 06 '23 10:06 jira-importer