Maven错误:“No goals have been specified for this build...”问题解决
2017-02-08 10:35
591 查看
如图出现如下错误:
解决方法如下:
1、(未测试)在pom.xml添加如下配置:
2、直接在运行的命令行上加入:
错误分析:
其实使用命令行时就已经指定了phase,而使用m2eclipse的【Run As】-【Maven build】时并未为其指定goal或phase,所以才报这个错误。但是一般这个是老版本才会出现,新版的eclipse已经没有这个问题,在运行时可以添加参数运行,效果和命令行保持一致。
解决方法如下:
1、(未测试)在pom.xml添加如下配置:
<build> <defaultGoal>compile</defaultGoal> </build>
2、直接在运行的命令行上加入:
//执行 mvn clean compile test //打包 mvn clean compile test package
错误分析:
其实使用命令行时就已经指定了phase,而使用m2eclipse的【Run As】-【Maven build】时并未为其指定goal或phase,所以才报这个错误。但是一般这个是老版本才会出现,新版的eclipse已经没有这个问题,在运行时可以添加参数运行,效果和命令行保持一致。
相关文章推荐
- Maven项目报错:“No goals have been specified for this build”解决办法
- 解决运行Maven是报错:No goals have been specified for this build
- maven在myeclipse下运行mvn出现 No goals have been specified for this build.
- Maven: mvn -X 执行报错:No goals have been specified for this build.
- Maven不让编译: No goals have been specified for this build. You must specify a valid lifecy
- 运行Maven工程总是报错:No goals have been specified for this build
- 运行Maven是报错:No goals have been specified for this build
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle
- 运行Maven是报错:No goals have been specified for this build
- 运行Maven是报错:No goals have been specified for this build
- 运行Maven是报错:No goals have been specified for this build .
- 运行Maven是报错:No goals have been specified for this build(转)
- 运行mvn提示错误No goals have been specified for this build
- 运行Maven是报错:No goals have been specified for this build
- 运行Maven是报错:No goals have been specified for this build
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- 运行Maven是报错:No goals have been specified for this build