3

I am trying to build my maven application but keep running into this error:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project strategy-admin-service: Fatal error compiling

It started occuring after I changed my maven version from the bundled version (3.6.3). Now, even changing it back does not fix the issue. I've tried playing around wit the different java versions in Settings and Project Structure as suggested by people in this thread: Maven 3.8.0 Compiler - Fatal error compiling: release version 11 not supported. I also tried deleting the .m2 directory to clear maven cache Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile), but nothing seems to work.

Here is some info from my pom.xml:

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>2.1.5.RELEASE</version>
  <relativePath />
</parent>

...

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
      <!-- See https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html 
        Classpath elements to supply as annotation processor path. If specified, 
        the compiler will detect annotation processors only in those classpath elements. 
        If omitted, the default classpath is used to detect annotation processors. 
        The detection itself depends on the configuration of annotationProcessors. 
        According to this documentation, the provided dependency processor is not 
        considered! -->
      <annotationProcessorPaths>
        <path>
          <groupId>org.mapstruct</groupId>
          <artifactId>mapstruct-processor</artifactId>
          <version>1.3.1.Final</version>
        </path>
        <path>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
          <version>${org.projectlombok.version}</version>
        </path>
      </annotationProcessorPaths>
    </configuration>
  </plugin>

Here are the relevant settings of my project:

enter image description here

enter image description here

enter image description here

I'd appreciate any help. Thanks in advance.

Shoaib Ahmed
  • 115
  • 2
  • 5
  • What is the output for same goal from the command line? You can run it with the `-X` option to see more verbose output: `mvn –X clean compile`. – Andrey Mar 27 '22 at 06:36
  • @Andrey exact same output when running the `mvn -X clean compile` command. – Shoaib Ahmed Mar 28 '22 at 14:34

0 Answers0