0

I'm facing to a problem below.

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.770 s [INFO] Finished at: 2024-06-09T09:34:45+09:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo: Fatal error compiling: error: invalid flag: -Xep:NullAway:ERROR -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

my `pom.xml` file

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.3.0</version> <relativePath/> </parent> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</name> <description>demo</description> <properties> <java.version>17</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.3.2</version> </dependency> <dependency> <groupId>com.uber.nullaway</groupId> <artifactId>nullaway</artifactId> <version>0.9.7</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>17</source> <target>17</target> <compilerArgs> <arg>-Xplugin:ErrorProne</arg> <arg>-Xep:NullAway:ERROR</arg> <arg>-XepOpt:NullAway:AnnotatedPackages=com.example</arg> </compilerArgs> <annotationProcessorPaths> <path> <groupId>com.google.errorprone</groupId> <artifactId>error_prone_core</artifactId> <version>2.3.4</version> </path> <path> <groupId>com.uber.nullaway</groupId> <artifactId>nullaway</artifactId> <version>0.9.7</version> </path> </annotationProcessorPaths> </configuration> </plugin> </plugins> </build> </project> 

and environment versions

mJP0K9VCRTDFCPC:demo 01611367$ java -version

openjdk version "17.0.9" 2023-10-17 LTS OpenJDK Runtime Environment Zulu17.46+19-CA (build 17.0.9+8-LTS)

OpenJDK 64-Bit Server VM Zulu17.46+19-CA (build 17.0.9+8-LTS, mixed mode, sharing)

mJP0K9VCRTDFCPC:demo 01611367$ javac -version

javac 17.0.9 mJP0K9VCRTDFCPC:demo 01611367$ mvn -version

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Maven home: /opt/homebrew/Cellar/maven/3.9.6/libexec

Java version: 17.0.9,

vendor: Azul Systems, Inc.,

runtime: /Users/01611367/.sdkman/candidates/java/17.0.9-zulu/zulu-17.jdk/Contents/Home

Default locale: en_JP,

platform encoding: UTF-8 OS

name: "mac os x", version: "14.4.1", arch: "aarch64", family: "mac"

1 Answer 1

0

This configuration is not in NullAway instructions for Maven:

<arg>-Xep:NullAway:ERROR</arg> 

Remove it.

Sign up to request clarification or add additional context in comments.

2 Comments

Then I get another error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project demo: Compilation failure [ERROR] An unknown compilation problem occurred
I suspect now that the version of NullAway is too old. Try with the latest release.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.