Unknown lifecycle phase "mybatis-generator-generate"

来源:互联网 发布:程序员用的文本编辑器 编辑:程序博客网 时间:2024/05/27 00:33

1、错误描述

Microsoft Windows [版本 6.1.7601]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\Administrator>mvn mybatis-generator-generate[INFO] Scanning for projects...[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 0.161 s[INFO] Finished at: 2016-03-03T22:48:36+08:00[INFO] Final Memory: 7M/171M[INFO] ------------------------------------------------------------------------[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\Administrator). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectExceptionC:\Users\Administrator>cd F:\workspaces\MybatisC:\Users\Administrator>f:F:\workspaces\Mybatis>mvn mybatis-generator-generate[INFO] Scanning for projects...[INFO][INFO] ------------------------------------------------------------------------[INFO] Building Mybatis 0.0.1-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 0.141 s[INFO] Finished at: 2016-03-03T22:49:53+08:00[INFO] Final Memory: 7M/171M[INFO] ------------------------------------------------------------------------[ERROR] Unknown lifecycle phase "mybatis-generator-generate". 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-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundExceptionF:\workspaces\Mybatis>

2、错误原因

     pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelVersion>4.0.0</modelVersion>  <groupId>com.you.mybatis</groupId>  <artifactId>Mybatis</artifactId>  <version>0.0.1-SNAPSHOT</version>  <packaging>war</packaging>    <build>    <plugins>    <plugin>    <groupId>org.mybatis.generator</groupId>    <artifactId>mybatis-generator-maven-plugin</artifactId>    <version>1.3.2</version>    <configuration>        <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>        <verbose>true</verbose>        <overwrite>true</overwrite>    </configuration>    <executions>        <execution>        <id>generate</id>        <goals>           <goal>generate</goal>        </goals>        </execution>    </executions>    <dependencies>        <dependency>            <groupId>org.mybatis.generator</groupId>            <artifactId>mybatis-generator-core</artifactId>            <version>1.3.2</version>        </dependency>    </dependencies></plugin>  </plugins>  </build></project>

          Maven命令出现错误


3、解决办法

     修改命令

     mvn mybatis-generator:generate

0 0
原创粉丝点击