从pom.xml运行测试时出现UnsupportedFileFormatException

时间:2015-11-08 03:20:11

标签: maven-2

pom.xml运行测试时出现此错误:

  

NoClassDefFoundError:UnsupportedFileFormatException

但是当我直接运行类文件时脚本运行正常。这有什么问题?

这是我的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>FlightBooking</groupId>
  <artifactId>SpiceJet</artifactId>
  <version>0.0.1-SNAPSHOT</version>




<dependencies>

  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.48.2</version>
  </dependency>

  <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.48.2</version>
  </dependency>

  <dependency>
  <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.6</version>
  </dependency>

  <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.7</version>
</dependency>

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.3</version>
  <type>maven-plugin</type>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.13</version>
</dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>ooxml-schemas</artifactId>
    <version>1.1</version>
</dependency>

  </dependencies>



<build>
    <pluginManagement>
      <plugins>
      <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>`enter code here`
                <fork>true</fork>
                <executable>C:\Program Files\Java\jdk1.7.0_45\bin\javac.exe</executable>
            </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <`version`>2.19</version>

          <configuration>
          <includes>
          <include>
          `TestScenario1`.java
          </include>
          </includes>
          </configuration>
        </plugin>
      </`plugins`>
    </pluginManagement>
  </build>

我收录了以下poi jars:

  1. ooxml-schemas-1.1

  2. poi-3.13-20150929

  3. poi-examples-3.13-20150929

  4. poi-excelant-3.13-20150929

  5. poi-ooxml-3.13-20150929

  6. poi-ooxml-schemas-3.13-20150929

  7. poi-scratchpad-3.13-20150929

  8. xmlbeans-2.6.0

0 个答案:

没有答案
相关问题