0

I want to learn Java Spring, so I choose Eclipse Mars2 Version and I want to build a Java project using Maven. But I get errors

maven-compiler-plugin:3.1:compile(1 errors)
maven-compiler-plugin:3.1:testCompile(1 errors)

Then I check my Maven and Java path in my Windows 10 64 bit system variable. I configured like this:

JAVA_HOME => C:\Program Files\Java\jdk1.8.0_71
M2_HOME => C:\apache-maven
MAVEN_HOME => C:\apache-maven

And in system variable path:

%JAVA_HOME%\bin
%M2_HOME%\bin

Everything is fine, I checked it by java -version and mvn-version Also, I have installed mvn plugin in Eclipse in install new software to Maven:

Name: m2e Location: http://download.eclipse.org/technology/m2e/releases

But the errors still pop up. What can I try next?

Update

I test to build a project maven-archetype-quickstart version 1.1

execution default-compile, in Access/pom.xml
execution default-testCompile, in Access/pom.xml

Update again

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.tresnamuda</groupId>
  <artifactId>access</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

<name>access</name>
  <url>http://maven.apache.org</url>

<properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
 <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
 </dependency>
 </dependencies>
</project>

Eclipse detect error in first line which is:

 project xmlns="http://maven.apache.org/POM/4.0.0"  .....

also in line 8.

This is the complete error:

Eclipse mars2 errors

6
  • 1
    Exactly what errors? Dec 3, 2016 at 19:07
  • Please see my updated question
    – Fadly Dzil
    Dec 3, 2016 at 19:19
  • If you getting only getting started then perhaps it would be easier to use the spring tool suite - spring.io/tools/sts.
    – Curious
    Dec 3, 2016 at 19:23
  • I'm not sure that update helps. It says (1 errors), but execution default-compile, in Access/pom.xml does not look like an error. Dec 3, 2016 at 20:19
  • 1
    The error "failure to transfer ..." is the real problem here. You need to check if your connection to Maven central is working ...or if you have proxy problem..
    – khmarbaise
    Dec 4, 2016 at 8:57

1 Answer 1

1

It seems like there is corruption in your local repository. Please try:

  • Delete the local repository, if you use Windows, delete the folder C:\Users\your-user-name\.m2\repository
  • In Eclipse, right click on the project name and click Maven\Update project ... (or use hotkey ALT+F5)

Not the answer you're looking for? Browse other questions tagged or ask your own question.