搭建Maven以及在eclipse运行maven命令时出现的错误

来源:互联网 发布:linux大棚命令百篇上 编辑:程序博客网 时间:2024/05/19 03:45

1. Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test):

maven打包项目的时候一直报这个异常
解决办法:
这是因为测试代码时遇到错误,它会停止编译。只需要在pom.xml的里添加以下配置,使得测试出错不影响项目的编译。

<build>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-surefire-plugin</artifactId>            <configuration>                <testFailureIgnore>true</testFailureIgnore>            </configuration>        </plugin>    </plugins></build>

2. Eclipse中,No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 问题的解决方案

解决办法:参考 http://www.awolau.com/java/eclipse-maven-no-compiler-is-provided.html
配置好Eclipse的JDK即可

3. eclipse unable to create project from archetype

解决办法:查看maven项目默认的工作路径,不要是其他项目的路径下~我的就是在别的项目路径里,我改了以后就好了~这里写图片描述

0 0