ucsb-cs156 / proj-happycows

https://ucsb-cs156.github.io/proj-happycows/
1 stars 0 forks source link

Suppress Annotation Processing Warning (Java 21) #129

Open pconrad opened 4 weeks ago

pconrad commented 4 weeks ago

Summary

Add a plugin to the pom.xml to suppress a warning about annotation processing (to reduce noise in the maven output).

Details

Starting with Java 21, the following warning is produced during the compile phase unless the -proc:full is passed to the compiler:

[INFO] Annotation processing is enabled because one or more processors were found
on the class path. A future release of javac may disable annotation processing
unless at least one processor is specified by name (-processor), or a search
path is specified (--processor-path, --processor-module-path), or annotation
processing is enabled explicitly (-proc:only, -proc:full).
Use -Xlint:-options to suppress this message.
Use -proc:none to disable annotation processing.

In this PR, we add the maven-compiler-plugin to pass this argument to the java compiler, so that this message does not appear.

What to do:

  1. Do a mvn clean compile and see if the warning appears. If not, close the issue; it isn't needed.
  2. If it does appear, add this to the pom.xml in the plugins section:
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument>-proc:full</compilerArgument>
        </configuration>
      </plugin>
    1. Do a mvn clean compile again and see if the warning goes away. If it does, your work here is done; do a PR.