码迷,mamicode.com
首页 > 其他好文 > 详细

启动maven服务时 出现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......异常

时间:2018-03-10 10:19:06      阅读:1017      评论:0      收藏:0      [点我收藏+]

标签:org   prefix   gpo   compile   config   validate   spec   cti   art   

异常:

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,

原因:在pom.xm文件中配置tomcat插件时编译出现了问题

解决方法:在pom.xml文件中找到<build>标签,在里面加 上<defaultGoal>compile</defaultGoal>,代码如下:

<build>
  <defaultGoal>compile</defaultGoal>
	 <plugins>
	  <!-- 配置Tomcat插件 -->
	  <plugin>
	    <groupId>org.apache.tomcat.maven</groupId>
	    <artifactId>tomcat7-maven-plugin</artifactId>
		  <configuration>
			<path>/</path>
			<port>8080</port>
		  </configuration>
	  </plugin>
	</plugins>
 </build>

  

 

启动maven服务时 出现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......异常

标签:org   prefix   gpo   compile   config   validate   spec   cti   art   

原文地址:https://www.cnblogs.com/solitary-boy/p/8537208.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!