Gringo Golf
Gringo Golf

Reputation: 473

Unknown lifecycle phase "build". You must specify a valid lifecycle phase or a goal in the format

Team,

Getting the following error on my pom file. Unknown lifecycle phase "build". You must specify a valid lifecycle phase or a goal in the format. I went thru the URL provided but still getting the error. MVN version 3.2.1,Java version: 1.7.0_51 any help would be appreciated

POM looks like:

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

Upvotes: 22

Views: 73580

Answers (2)

user11936657
user11936657

Reputation:

maven haven't any build target, it means if you are run mvn build command. this command doesn't exist in maven lifecycle.

  • you have to run mvn package for run the project
  • mvn compile for compile
  • mvn test for test
  • mvn install for install
  • mvn clean build -run the build phases of the default lifecycle and for each build phase all the plugin goals they contain are executed.

Upvotes: 4

Esko
Esko

Reputation: 29367

Maven doesn't have build target (phase in Maven lingo), what you probably want is either compile, test or install depending what you want to achieve.

Please read through Introduction to the Build Lifecycle to learn more about how Maven lifecycle works and what each step does.

Upvotes: 33

Related Questions