Spring-boot: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2

Created on 26 Aug 2017  Â·  11Comments  Â·  Source: spring-projects/spring-boot

I cannot run this sample in my local machine and got below exception
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project spring-boot-sample-tomcat: Fatal error compiling: invalid flag: -parameters ->

duplicate

Most helpful comment

My JDK is pointing to 8 . still im getting compilation error. Is there any work around ?

All 11 comments

You need to tell us more about your env. can you run mvn -v and paste the output here?

I can reproduce this with JDK7.

@daizhuzhu2007 if you're running that on the master branch, you should know that Spring Boot 2.0+ is JDK8+ only.

➜  spring-boot-sample-tomcat git:(master) mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"

➜  spring-boot-sample-tomcat git:(master) mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot Tomcat Sample 2.0.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-rules) @ spring-boot-sample-tomcat ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ spring-boot-sample-tomcat ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.2:compile (default-compile) @ spring-boot-sample-tomcat ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/bclozel/workspace/spring-boot/spring-boot-samples/spring-boot-sample-tomcat/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.247 s
[INFO] Finished at: 2017-08-28T16:20:00+02:00
[INFO] Final Memory: 20M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project spring-boot-sample-tomcat: Fatal error compiling: invalid flag: -parameters -> [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

Thanks @bclozel

@daizhuzhu2007 I guess you are running with Java7. Master requires Java8 but, regardless, that build should not fail. I've created an issue in plexus-compiler to investigate what's going on with that change in maven-compiler-plugin.

yes, you are right, After I changed JDK from 7 to 8, this exception disappeared. Thank you!

My JDK is pointing to 8 . still im getting compilation error. Is there any work around ?

@VasaviUppada this issue is closed and we don't use the tracker for questions. Please ask on Stackoverflow or join us on Gitter. When you do, please provide more details.

I'm also getting the error. I'm running on JDK 1.8 and I cant even package simple demo application as jar.

Please help.

@Avinashachu007 Please read the comments proceeding yours. As @snicoll has already said, GitHib issues, particularly closed issues, are not the right place to ask questions or for help. Please use Stack Overflow or Gitter instead.

i am getting this error!

pic1

@melroylobo Please read the comments proceeding yours.

Thank you, i resolved the issues

error was in pom.xml
groupId and artifectId was unique

Was this page helpful?
0 / 5 - 0 ratings