Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
来源:互联网 发布:php 记录蜘蛛程序 编辑:程序博客网 时间:2024/06/05 11:44
1. 好坑呐,一个问题解决了好久才解决。终于可以了不容易啊。
跟着《Maven实战》学习第一个项目就出问题。Compile通过了,可是Test时有问题。网上报这个错的大部分用的都是Eclipse的。我用的Intellij IDEA。搞得好累。
(1)书上的配置时这样的:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin>
结果报这个错误:
[WARNING] Some problems were encountered while building the effective model for com.jasminezhao.mvntest:hello-world:jar:1.0-SNAPSHOT[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 20, column 21[WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.[WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
需要加上:<version>3.1</version>
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin>(2) 报下面的错误,
[ERROR] COMPILATION ERROR :[INFO] -------------------------------------------------------------[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[3,17] package org.junit does not exist[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[5,24] package org.junit does not exist[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[5,1] static import only from classes and interfaces[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[11,6] cannot find symbol symbol: class Test location: class HelloWorldTest[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[17,9] cannot find symbol symbol: method assertEquals(java.lang.String,java.lang.String) location: class HelloWorldTest[INFO] 5 errors[INFO] -------------------------------------------------------------[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 9.056 s[INFO] Finished at: 2014-12-11T17:50:50+08:00[INFO] Final Memory: 11M/27M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project hello-world: Compilation failure: Compilation failure:[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[3,17] package org.junit does not exist[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[5,24] package org.junit does not exist[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[5,1] static import only from classes and interfaces[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[11,6] cannot find symbol[ERROR] symbol: class Test[ERROR] location: class HelloWorldTest[ERROR] /D:/Maven Hello World Project/src/test/java/HelloWorldTest.java:[17,9] cannot find symbol[ERROR] symbol: method assertEquals(java.lang.String,java.lang.String)[ERROR] location: class HelloWorldTest[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发现External Libraries里面有junit 4.1.0 jar,但是发现项目还是哪里有一个junit 3.8.1 jar,我估计两个jar冲突了。把两个都删了,打算重新导入。结果在项目里点击下面的按钮都不能导入,后面把.m2(C:\Users\*\.m2\repository\junit\junit)下面的包删除了。在点击旁边的一个Event Log里面蓝色字体提示的也会帮助导入包。一直不知道怎么导入maven的jar包。
截图如下:
0 0
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
- maven 构建编译失败:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:
- intellidea maven compile Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:
- maven 构建编译失败:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-c
- 针对Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决方案
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1解决
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1解决办法
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法
- 针对Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决方案
- 解决Maven test时报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- window系统查看端口被哪个进程占用了
- Mysql基础(一) mysql给root开启远程访问权限,修改root密码
- 万年历
- bat截取字符串
- 判断二进制流编码
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
- 黑马程序员 -- Java基础学习(2)
- 【COCOS2DX-LUA 脚本开发之一】LUA语言基础在Cocos2dX游戏中使用Lua脚本进行游戏开发(基础篇)并介绍脚本在游戏中详细用途!
- Oracle存储过程应用中遇到的问题解决
- 二叉树非递归解决后序遍历
- android 自定义View 动态绘制曲线图
- Objective-C中的@property和@synthesize用法
- EM算法学习(Expectation Maximization Algorithm)
- APP创业团队招人组队