zoukankan      html  css  js  c++  java
  • maven install 出错解决

    No goals have been specified for this build

    今天通过
    mvn archetype:create -DgroupId=ricki.cheung.struts
    -DartifactId=my_struts -DarchetypeGroupId=org.apache.struts
    -DarchetypeArtifactId=struts2-archetype-blank
    -DarchetypeVersion=2.0.14-SNAPSHOT
    -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository
    命令又构建了一个Struts2工程并导入eclipse,右键单击pom.xml文件,选择【Run As】-【Maven build】的时候,报:
    [INFO] Scanning for projects…[INFO]
    [INFO] BUILD FAILURE[INFO]
    [INFO] Total time: 0.109s[INFO] Finished at: Wed Apr 13 11:04:20 CST 2011[INFO] Final Memory: 1M/4M[INFO]
    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>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources,
    process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-
    test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy,
    pre-clean, clean, post-clean. -> [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/NoGoalSpecifiedException 

    eclipse安装的maven插件是m2eclipse,在控制台使用命令mvn compile并未报错。后在pom.xml文件<build>标签后面加 上<defaultGoal>compile</defaultGoal>即可。

    其实使用命令行时就已经指定了phase,而使用m2eclipse的【Run As】-【Maven build】时并未为其指定goal或phase,所以才报这个错误。

  • 相关阅读:
    LPC1768基本输入输出GPIO使用
    LPC1768IAP(详解,有上位机)
    STM32_IAP详解(有代码,有上位机)
    ucos2.86的任务调度漏洞
    ucos任务优先级从64到256,任务就绪表的改变
    ucos互斥信号量解决优先级反转问题
    ucos信号量集源码分析
    ucos内存管理原理详解
    ucos队列的实现--源码分析
    ucos调度器详解
  • 原文地址:https://www.cnblogs.com/hitwtx/p/2244629.html
Copyright © 2011-2022 走看看