首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未知的生命周期阶段“构建”。必须以以下格式指定有效的生命周期阶段或目标

未知的生命周期阶段“构建”。必须以以下格式指定有效的生命周期阶段或目标
EN

Stack Overflow用户
提问于 2016-04-11 22:52:49
回答 2查看 49K关注 0票数 15

队员们,

在我的pom文件中出现以下错误。未知的生命周期阶段“构建”。必须在格式中指定有效的生命周期阶段或目标。我检查了提供的URL,但仍然收到错误。MVN版本3.2.1,Java版本: 1.7.0_51如有任何帮助,不胜感激

POM如下所示:

代码语言:javascript
复制
<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.organization.dramer</groupId>
<artifactId>sTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>sTest</name>
<description>test automation framework created using Java, testNG,
selenium</description>


  <properties>
  <suiteXmlFile>src/main/resources/testng.xml</suiteXmlFile>
  <skipTests>false</skipTests>
  </properties>

  <dependencies>
    <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.2</version>
        <scope>provided</scope>
    </dependency>

  <dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.8</version>
  <scope>test</scope>
  </dependency>

  <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>2.53.0</version>
    </dependency>

    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>2.44.0</version>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>htmlunit-driver</artifactId>
        <version>2.20</version>
    </dependency>  

    <dependency>
        <groupId>net.sourceforge.jexcelapi</groupId>
        <artifactId>jxl</artifactId>
        <version>2.6.12</version>
    </dependency>

      </dependencies>

  <build>

  <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.6</version>
        <configuration>
            <suiteXmlFiles>
                <suiteXmlFile>${suiteXmlFile)</suiteXmlFile>
            </suiteXmlFiles>    
            <testFailureIgnore>true</testFailureIgnore>
        </configuration>
    </plugin>
  </plugins>




  </build>




</project>
EN

回答 2

Stack Overflow用户

发布于 2016-04-11 23:26:01

Maven没有build目标(在Maven行话中是阶段),您可能想要的是compiletestinstall,这取决于您想要实现什么。

请通读Introduction to the Build Lifecycle以了解更多关于Maven生命周期的工作原理和每个步骤的作用。

票数 23
EN

Stack Overflow用户

发布于 2022-01-02 15:36:16

mvn build没有任何build目标,这意味着如果您正在运行maven命令。此命令在maven生命周期中不存在。

对于project

  • mvn compile

  • test

  • mvn install,您必须运行mvn pacage for run compile
  • mvn test
  • install
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36552133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档