Skip to content

configuration not anymore needed with last release of m-compiler-plugin#240

Closed
olamy wants to merge 1 commit intomasterfrom
cleanup-compiler-plugin-configuration
Closed

configuration not anymore needed with last release of m-compiler-plugin#240
olamy wants to merge 1 commit intomasterfrom
cleanup-compiler-plugin-configuration

Conversation

@olamy
Copy link
Copy Markdown
Member

@olamy olamy commented Mar 15, 2022

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Copy link
Copy Markdown
Member

@basil basil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steps to reproduce

See JENKINS-67960 and #235.

  • Build and install this PR with mvn clean install to obtain 1.73-SNAPSHOT.
  • git clone https://github.com/basil/acceptance-test-harness.git
  • cd acceptance-test-harness
  • git checkout jsr305
  • sed -i -e 's/1.51/1.73-SNAPSHOT/g' pom.xml
  • Verify this PR has taken effect by running mvn help:effective-pom | grep forceJavacCompilerUse and ensure there are no results.
  • Verify Maven Compiler Plugin 3.10.1 is in use by running mvn help:effective-pom | grep maven-compiler-plugin.version and ensure you see <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>.
  • With Java 11, run mvn clean verify -Denforcer.skip.

Expected results

(Note: These are the actual results when running mvn clean verify -Denforcer.skip -Dmaven.compiler.forceJavacCompilerUse=true or when running with POM 1.72 from before this PR.)

The build fails with a readable message with the compilation error:

[…]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project acceptance-test-harness: Compilation failure: Compilation failure: 
[ERROR] /tmp/acceptance-test-harness/src/main/java/org/jenkinsci/test/acceptance/po/PageAreaImpl.java:[7,38] error: package edu.umd.cs.findbugs.annotations does not exist
[…]
[ERROR] /tmp/acceptance-test-harness/src/main/java/org/jenkinsci/test/acceptance/update_center/PluginSpec.java:[45,19] error: cannot find symbol
[ERROR]   symbol:   class NonNull
[ERROR]   location: class PluginSpec
[…]

Actual results

The build fails without printing a readable message with the compilation error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project acceptance-test-harness: Fatal error compiling: CompilerException: NullPointerException -> [Help 1]

Evaluation

The workaround delivered in Maven Compiler Plugin 3.10.1 appears to be incomplete, as the original problem can still be reproduced. Therefore, I conclude #235 is still needed at the present time.

@olamy
Copy link
Copy Markdown
Member Author

olamy commented Mar 16, 2022

interesting one...
obviously works fine with jdk 17 (let's make a JEP to upgrade directly to jdk17!! 🤣)
the stack is a bit different from the previous one (and another jdk11 bug https://bugs.openjdk.java.net/browse/JDK-8216202)

mvn clean verify -Denforcer.skip -e

Caused by: java.lang.NullPointerException
    at com.sun.tools.javac.main.JavaCompiler.readSourceFile (JavaCompiler.java:841)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete (JavacProcessingEnvironment.java:1535)
    at com.sun.tools.javac.code.Symbol.complete (Symbol.java:642)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete (Symbol.java:1326)
    at com.sun.tools.javac.code.Type$ClassType.complete (Type.java:1140)
    at com.sun.tools.javac.code.Type$ClassType.getTypeArguments (Type.java:1066)
    at com.sun.tools.javac.code.Printer.visitClassType (Printer.java:237)
    at com.sun.tools.javac.code.Printer.visitClassType (Printer.java:52)
    at com.sun.tools.javac.code.Type$ClassType.accept (Type.java:993)
    at com.sun.tools.javac.code.Printer.visit (Printer.java:136)
    at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument (AbstractDiagnosticFormatter.java:199)
    at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments (AbstractDiagnosticFormatter.java:167)
    at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:111)
    at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:67)
    at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument (AbstractDiagnosticFormatter.java:185)
    at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments (AbstractDiagnosticFormatter.java:167)
    at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:111)
    at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:67)
    at com.sun.tools.javac.util.JCDiagnostic.getMessage (JCDiagnostic.java:788)

@olamy olamy closed this May 6, 2022
@olamy olamy deleted the cleanup-compiler-plugin-configuration branch May 6, 2022 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants