我想学习java spring,所以我选择Eclipse Mars2版本,我想用Maven构建一个java项目。但我得到错误
maven-compiler-plugin:3.1:compile(1 errors)
maven-compiler-plugin:3.1:testCompile(1 errors)
然后我在Windows 10 64位系统变量中检查我的maven和java路径。 我这样配置:
JAVA_HOME => C:\Program Files\Java\jdk1.8.0_71
M2_HOME => C:\apache-maven
MAVEN_HOME => C:\apache-maven
在systen variabel路径中: %JAVA_HOME%\ bin中 %M2_HOME%\ bin中
一切都很好,我通过java -version
和mvn-version
进行了检查
另外,我在install new software
的eclipse中安装了mvn插件
到了maven:
姓名:m2e 地点:http://download.eclipse.org/technology/m2e/releases
但我仍然失败了。错误仍然会弹出。 请指教。感谢。
更新
我测试构建项目maven-archetype-quickstart 1.1版
execution default-compile, in Access/pom.xml
execution default-testCompile, in Access/pom.xml
再次更新
<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在第一行检测到错误,即: project xmlns =&#34; http://maven.apache.org/POM/4.0.0" .....
也在第8行。
这是完整的错误:
答案 0 :(得分:0)
您的本地存储库中似乎存在损坏。 请尝试:
C:\Users\your-user-name\.m2\repository