2017-04-12 12 views
0

誰かが私を助けてくれますか?私は現在、これで2つのエラーが発生しています。ファイルプロファイルには<profiles>、下部には</project>となります。私は誰かがこれを手伝うことができれば感謝します。TestNGでMavenをビルドする

<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>Finance</groupId> 
    <artifactId>MavenTestNGpaytm</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>MavenTestNGpaytm</name> 
    <url>http://maven.apache.org</url> 

    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <profiles> 
     <profile> 
     <id>Class</id> 
      <build> 

    <plugins> 
    <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.19.1</version> 
       <configuration> 
       <suiteXmlFiles> 
       <suiteXmlFile>Class.xml</suiteXmlFile> 
        </suiteXmlFiles> 
       </configuration> 
    </plugin> 

     <profiles> 
      <profile> 
       <id>Package</id> 
        <build> 

    <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.19.1</version> 
       <configuration> 
        <suiteXmlFiles> 
       <suiteXmlFile>Package.xml</suiteXmlFile> 
       </suiteXmlFiles> 
       </configuration> 
       </plugin> 

       </build> 
       </profile> 
       </profiles>   

    <dependencies> 

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

<dependency> 
    <groupId>org.seleniumhq.selenium</groupId> 
    <artifactId>selenium-java</artifactId> 
    <version>3.3.1</version> 
</dependency> 
     <dependency> 
    <groupId>io.appium</groupId> 
    <artifactId>java-client</artifactId> 
    <version>2.1.0</version> 
</dependency> 
</dependencies> 
</project> 
+2

こんにちは、どのようなエラーが表示されますか教えてください。あなたが質問に投稿した 'pom.xml 'が(XMLの観点から)まったく有効ではないので、私はそれを尋ねます!例えば、「」のクローズは全くありません。 – danidemi

答えて

1

以下を確認してください。開いている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>Finance</groupId> 
    <artifactId>MavenTestNGpaytm</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>MavenTestNGpaytm</name> 
    <url>http://maven.apache.org</url> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <profiles> 
     <profile> 
      <id>Class</id> 
      <build> 


       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-surefire-plugin</artifactId> 
         <version>2.19.1</version> 
         <configuration> 
          <suiteXmlFiles> 
           <suiteXmlFile>Class.xml</suiteXmlFile> 
          </suiteXmlFiles> 
         </configuration> 
        </plugin> 
       </plugins> 

      </build> 
     </profile> 

     <profile> 
      <id>Package</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-surefire-plugin</artifactId> 
         <version>2.19.1</version> 
         <configuration> 
          <suiteXmlFiles> 
           <suiteXmlFile>Package.xml</suiteXmlFile> 
          </suiteXmlFiles> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 

    <dependencies> 

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

     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>3.3.1</version> 
     </dependency> 
     <dependency> 
      <groupId>io.appium</groupId> 
      <artifactId>java-client</artifactId> 
      <version>2.1.0</version> 
     </dependency> 
    </dependencies> 
</project> 
+0

ありがとうございます。それは正常に働いた – Tessy

+0

こんにちは@前回の回答があなたの質問に答えた場合は、それはあなたが正しい答えとしてそれを選択するといいだろう。 – danidemi

関連する問題