Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle(

Posted 浅嫣

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

报错:

[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,

 

解决方式:

打开pom.xml 在build节点中 增加

<defaultGoal>compile</defaultGoal>

<build>
        <defaultGoal>compile</defaultGoal>


        <finalName>CharlieWebDemo</finalName>
        <resources>
            <!--表示把java目录下的有关xml文件,properties文件编译/打包的时候放在resource目录下-->
            <resource>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <!--mybatis 逆向工程插件-->
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.5</version>
                <configuration>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

以上是关于Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle(的主要内容,如果未能解决你的问题,请参考以下文章

报错configure:error: no acceptable C compiler found in $PATH。。

MacVScode配置Python开发环境详细教程(报错解决Import Error No module named ) CodeRunner插件

maven 启动 报错 Fatal error compiling: 无效的目标发行版

Vue3.0报错error: Unexpected console statement (no-console) 解决办法

解决MySQL报错:ERROR 2006 (HY000): MySQL server has gone away No connection(图文并茂)

解决MySQL报错:ERROR 2006 (HY000): MySQL server has gone away No connection(图文并茂)