【问题标题】:maven-compiler-plugin:3.1:compile(1 errors) in eclipse [duplicate]eclipse中的maven-compiler-plugin:3.1:compile(1个错误)[重复]
【发布时间】:2017-04-18 11:57:15
【问题描述】:

我想学习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

在系统变量路径中: %JAVA_HOME%\bin %M2_HOME%\bin

一切都很好,我通过java -versionmvn-version 进行了检查 另外,我在install new software的eclipse中安装了mvn插件 到行家:

名称: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 在第一行检测到错误: 项目 xmlns="http://maven.apache.org/POM/4.0.0" .....

也在第 8 行。

这是完整的错误:

【问题讨论】:

  • 究竟是什么错误?
  • 请看我更新的问题
  • 如果您只是入门,那么使用 spring 工具套件可能会更容易 - spring.io/tools/sts
  • 我不确定更新是否有帮助。上面写着(1 errors),但execution default-compile, in Access/pom.xml 看起来不像是错误。
  • 错误“传输失败...”是这里真正的问题。您需要检查您与 Maven 中心的连接是否正常……或者您是否有代理问题..

标签: java eclipse spring maven


【解决方案1】:

您的本地存储库中似乎存在损坏。 请尝试:

  • 删除本地仓库,如果你使用Windows,删除文件夹C:\Users\your-user-name\.m2\repository
  • 在 Eclipse 中,右键单击项目名称,然后单击 Maven\Update project ...(或使用热键 ALT+F5)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-01
    • 2020-06-24
    • 2017-07-20
    • 2020-08-13
    • 2017-06-23
    • 2022-01-04
    • 2018-09-15
    • 1970-01-01
    相关资源
    最近更新 更多