Problem
I decided to get spring boot hello word example to work with Java 1.8 but an annoying dependency issues. In the answer section I explain what solved my problem as well as some hints on how to bring everything on your machine up to date. The error I was getting was:
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:3.x
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/xxx/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar
[ERROR] urls[1] = file:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[2] = file:/Users/xxx/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
[ERROR] urls[3] = file:/Users/xxx/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[4] = file:/Users/xxx/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
[ERROR] urls[5] = file:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.2/plexus-compiler-api-2.2.jar
[ERROR] urls[7] = file:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.2/plexus-compiler-manager-2.2.jar
[ERROR] urls[8] = file:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.2/plexus-compiler-javac-2.2.jar
[ERROR] urls[9] = file:/Users/xxx/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[10] = file:/Users/xxx/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
[ERROR] urls[11] = file:/Users/xxx/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
[ERROR] urls[12] = file:/Users/xxx/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[13] = file:/Users/xxx/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Solutions that didn't work
A lot of the threads were suggesting removing the ~/.m2/ repositories like here but it did not solve my problem.
Some others said that this is due to the Java 1.8 and it works perfectly for them with Java 1.7! But couldn't believe them as it did not make sense. And I really wanted to get this simple example to work with Java 8.
Solution summary
It was a dependency conflict but had nothing to do with the Java version or the repositories under .m2 folder for me.
The source of the error was a dependency conflict that was caused plugin>org.apache.maven.plugins:maven-compiler-plugin:3.x
.
Other related sources
Other questions on stackoverflow that are similar but didn't solve my problem with spring boot are as follows:
1- maven-build-error-failed-to-execute-goal-missing-a-class
2- failed-to-execute-goal-org-apache-maven-pluginsmaven-compiler-plugin2-3-2comp
3- maven-release-plugin-issue-failed-to-execute-goal-org-apache-maven-pluginsmav