Maven Project error: No goals have been specified for this build. You must specify a valid lifecycle phase or a

Source: Internet
Author: User

In the MAVEN project, the startup service times had the following exceptions:

No goals have been specified for this build. 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,

The reason for this is that there was a problem compiling the Tomcat plug-in. The following code gives an error message:

<build>
		<!--configuration plugin-->
		<plugins>
			<plugin>
				<groupId> org.apache.tomcat.maven</groupid>
				<artifactId>tomcat7-maven-plugin</artifactId>
				< Configuration>
					<!--Portal Service port number-->
					<port>8082</port>
					<path>/</path>
				</configuration>
			</plugin>
		</plugins>
	</build>  

Workaround: The MAVEN plugin installed by Eclipse is m2eclipse, and the console uses commands mvn compile does not complain.

Need to modify the Pom.xml file, add <defaultGoal>compile</defaultGoal> to the <build> tag.

The modified code looks like this:

<build>
		<defaultGoal>compile</defaultGoal>
		<!--configuration plugin-->
		<plugins>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId> tomcat7-maven-plugin</artifactid>
				<configuration>
					<!--Portal Service port number-->
					<port> 8082</port>
					<path>/</path>
				</configuration>
			</plugin>
		</ Plugins>
	</build>  


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.