【安装】

Eclipse安装Maven插件


【导入项目】

在Eclipse中导入SVN库里的Maven项目


【错误解决】

1、StackOverflowError

1)、注意Eclipse不能感受到系统环境变量MAVEN_OPTS:解决Maven中OutOfMemory错误

2)、eclipse中修改参考这里:

run as --->run configuragtions--->jre标签下的 属性VM arguments: 
  -Xms512m -Xmx1024m


2、设置eclipse使用外部的maven报“Can't find Maven installation EMBEDDED”:重启eclipse即可


3、代码不能补全,显著错误不能识别,弹窗报“this compilation unit is not on the build path of a Java project”:MyEclipse buildpath 报错问题的解决方法(Eclipse也适用)


4、使用 JUnit 报错 “class not found”:运行 mvn test 后再试试


5、下面错误的一种可能解决方案:将 jre 目录切换为 jdk 里面的 jre。例如 C:\Program Files\Java\jre1.8.0_162  切换为 C:\Program Files\Java\jdk1.8.0_162\jre。(Windows -> Preferences -> Java Installed JREs)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project SimpleAnalysis-walker: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre1.8.0_162\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


6、maven替换中央仓库- 阿里云


相关阅读:Maven详解之仓库------本地仓库、远程仓库


*** walker ***