啟動maven服務時 出現No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or


異常:

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>

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM