I am using Maven 3.0.5 and Spring Tool Source 3.2 with Maven plugin installed. When I try to do \'Run As---> Maven install\', I am getting
I am adding more points to the solution by @Rushi Shah
mvn clean install -X
helps to identify the root cause.
Some of the important phases of Maven build lifecycle are:
clean
– the project is clean of all artifacts that came from previous compilations
compile
– the project is compiled into /target directory of project root
install
– packaged archive is copied into local maven repository (could in your user's home directory under /.m2)
test
– unit tests are run
package
– compiled sources are packaged into archive (JAR by default)
The 1.6 under tag refers to JDK version. We need to ensure that proper jdk version in our dev environment or change the value to 1.7 or 1.5 or whatever if the application can be supported in that JDK version.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
We can find the complete details on Maven build lifecycle in Maven site.
check the property endorsed.dir
tag in your pom.xml
.
I also had this problem and I fixed by modifying the property.
Example:
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
I got this error when trying to calling mvn install
on a project.
I had installed Java 9 on macOS as well as Java 8 Update 144. My Maven project was apparently invoking Java 9 and failing. Removed Java 9 from my Mac, leaving just Java 8 in place. Maven is now happily building my project to successful completion.
Using Apache Maven 3.5.0 on macOS Sierra.
Deleting full .m2 local repository solved my problem, too.
If you don't know where it is, the locations are:
Unix/Mac OS X – ~/.m2/repository
Windows – C:\Documents and Settings\{your-username}\.m2\repository
( %USERPROFILE%\.m2\repository too, as suggested by **MC Empero** )
i had the same problem and besides the above posts' configurations putting
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.32</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
</configuration>
<executions>
<execution>
<goals>
<goal>endpoints_get_discovery_doc</goal>
</goals>
</execution>
</executions>
</plugin>
in the plugins element in pom.xml. i think the problem was absence of execution -> goal "endpoints_get_discovery_doc" in some cases like mine, so this worked for me.
I think you have Two ways to solve this problem
01. Set Properties
Right click project ->Java Build Path ->Select Libraries tab ->Select JRE System Library ->Click Edit button ->Click Installed JREs-> add tick to box ->click Edit ->Click Directory->Select jdk
Right click project ->Project Facets ->tick java and select java version->Apply ->Ok
Right-click on "project"->Go to Maven->Update
02.Delete .m2 file
If you can't solve your problem using above two topic get this action Close your project. Delete your full .m2 folder
How to fined .m2 file(windows)
Go to Local Disk(C) ->Users ->Select your PC name ->.m2 file