使用selenium生成xslt报告时,错误工件没有文件错误

时间:2014-05-05 09:53:46

标签: java maven selenium-webdriver maven-3

我正在尝试使用Selenium Webdriver(Java)+ Maven 3生成xslt报告。我的pom.xl如下:

http://maven.apache.org/xsd/maven-4.0.0.xsd">     4.0.0     com.shn.UAF     UAF     0.0.2-SNAPSHOT     罐

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

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

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.36.0</version>
        <scope>test</scope>
    </dependency>

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



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

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-ie-driver</artifactId>
        <version>2.36.0</version>
    </dependency>

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

    <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>saxon</artifactId>
        <version>8.7</version>
    </dependency>

    <dependency>
        <groupId>org.apache.james</groupId>
        <artifactId>apache-mime4j</artifactId>
        <version>0.6</version>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.2.3</version>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2.3</version>
    </dependency>

    <dependency>
        <groupId>bsh</groupId>
        <artifactId>bsh</artifactId>
        <version>2.0b4</version>
    </dependency>



    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.1_3</version>
    </dependency>

    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.6</version>
    </dependency>

    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-exec</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>commons-jxpath</groupId>
        <artifactId>commons-jxpath</artifactId>
        <version>1.3</version>
    </dependency>

    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging-api</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>cssparser</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.4</version>
    </dependency>


    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>12.0</version>
    </dependency>

    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>net.sourceforge.htmlunit</groupId>
        <artifactId>htmlunit</artifactId>
        <version>2.9</version>
    </dependency>

    <dependency>
        <groupId>org.ini4j</groupId>
        <artifactId>ini4j</artifactId>
        <version>0.5.2</version>
    </dependency>

    <dependency>
        <groupId>com.beust</groupId>
        <artifactId>jcommander</artifactId>
        <version>1.13</version>
    </dependency>

    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>3.4.0</version>
    </dependency>

    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>platform</artifactId>
        <version>3.4.0</version>
    </dependency>

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20080701</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>4.10</version>
    </dependency>

    <dependency>
        <groupId>net.sourceforge.nekohtml</groupId>
        <artifactId>nekohtml</artifactId>
        <version>1.9.15</version>
    </dependency>

    <dependency>
        <groupId>org.jboss.netty</groupId>
        <artifactId>netty</artifactId>
        <version>3.2.7.Final</version>
    </dependency>

    <dependency>
        <groupId>com.opera</groupId>
        <artifactId>operadriver</artifactId>
        <version>0.14</version>
    </dependency>

    <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>2.4.1</version>
    </dependency>

    <dependency>
        <groupId>milyn</groupId>
        <artifactId>sac</artifactId>
        <version>1.3</version>
    </dependency>

    <dependency>
        <groupId>xalan</groupId>
        <artifactId>serializer</artifactId>
        <version>2.7.1</version>
    </dependency>



    <dependency>
        <groupId>org.webbitserver</groupId>
        <artifactId>webbit</artifactId>
        <version>0.4.14</version>
    </dependency>

    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.9.1</version>
    </dependency>

    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.3.04</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.21</version>
    </dependency>

    <dependency>
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>1.6.3</version>
    </dependency>

    <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.50</version>
    </dependency>

    <dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>2.3</version>
    </dependency>



    <dependency>
        <groupId>net.lightbody.bmp</groupId>
        <artifactId>browsermob-proxy</artifactId>
        <version>2.0-beta-8</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
    </dependency>

    <dependency>
        <groupId>org.apache.oozie</groupId>
        <artifactId>oozie-core</artifactId>
        <version>3.3.0-cdh4.2.0</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-core</artifactId>
        <version>2.0.0-mr1-cdh4.2.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-hdfs</artifactId>
        <version>2.0.0-cdh4.2.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-common</artifactId>
        <version>2.0.0-cdh4.2.0</version>
    </dependency>

    <dependency> <groupId>jdk.tools</groupId> <artifactId>jdk.tools</artifactId> 
        <version>1.7.0_05</version> <scope>system</scope> <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath> 
        </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.5</version>
    </dependency>

    <dependency>
        <groupId>com.github.detro.ghostdriver</groupId>
        <artifactId>phantomjsdriver</artifactId>
        <version>1.0.4</version>
    </dependency>

    <dependency>
            <groupId>com.saucelabs</groupId>
            <artifactId>sauce_testng</artifactId>
            <version>[1.0.0,)</version>
            <scope>test</scope>
        </dependency>  

    <dependency>
        <groupId>org.uncommons</groupId>
        <artifactId>reportng</artifactId>
        <version>1.1.4</version>
    </dependency>  

</dependencies>

<repositories>
    <repository>
        <id>repository-location</id>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
    <repository>
        <id>repository-location1</id>
        <url>http://maven-repository.com/</url>
    </repository>

    <repository>
        <id>cloudera</id>
        <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
    </repository>

    <repository>
        <id>saucelabs-repository</id>
        <url>http://repository-saucelabs.forge.cloudbees.com/release</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>

</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>reporty-ng</id>
        <url>https://github.com/cosminaru/reporty-ng/raw/master/dist/maven</url>
    </pluginRepository>
</pluginRepositories>


<profiles>
    <profile>
        <id>runClass</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <testSource>1.7</testSource>
                        <testTarget>1.7</testTarget>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <executions>
                        <execution>
                            <id>my-execution</id>
                            <phase>package</phase>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                    <!-- <configuration> <mainClass>com.shn.library.RunFromCommandLine</mainClass> 
                        </configuration> -->
                </plugin>
            </plugins>
        </build>
    </profile>
    <profile>
        <id>runTests</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <testSource>1.7</testSource>
                        <testTarget>1.7</testTarget>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.14.1</version>
                    <configuration>
                        <!-- <include>com/shn/test/*Tests.class</include> -->
                        <suiteXmlFiles>

                            <suiteXmlFile>${tests}</suiteXmlFile>
                        </suiteXmlFiles>
                        <systemPropertyVariables>
                            <propertyName>${dashboardURLFromCLI}</propertyName>
                            <propertyName>${serviceURLFromCLI}</propertyName>
                            <propertyName>${username_serviceFromCLI}</propertyName>
                            <propertyName>${password_serviceFromCLI}</propertyName>
                            <propertyName>${username_tenantFromCLI}</propertyName>
                            <propertyName>${password_tenantFromCLI}</propertyName>
                        </systemPropertyVariables>
                        <testFailureIgnore>true</testFailureIgnore>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <reporting>
            <plugins>
                <!-- TestNG-xslt related configuration. -->

                <plugin>
                    <groupId>org.reportyng</groupId>
                    <artifactId>reporty-ng</artifactId>
                    <version>1.2</version>

                    <configuration>

                        <!-- Output directory for the testng xslt report -->
                        <outputDir>/target/testng-xslt-report</outputDir>
                        <sortTestCaseLinks>true</sortTestCaseLinks>
                        <testDetailsFilter>FAIL,SKIP,PASS,CONF,BY_CLASS</testDetailsFilter>
                        <showRuntimeTotals>true</showRuntimeTotals>
                    </configuration>
                </plugin>


            </plugins>
        </reporting>
    </profile>





</profiles>

我使用以下命令执行testng.xml:

mvn -P runTests -Dtests=src\test\resources\xml_Suites\Box.xml test site

测试成功执行,甚至生成xslt报告。但是,我收到以下错误:

[ERROR] Artifact: jdk.tools:jdk.tools:jar:1.7.0_05 has no file.
[ERROR] Artifact: org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1 has
no file.
[ERROR] Artifact: org.apache.geronimo.specs:geronimo-jpa_2.0_spec:jar:1.1 has no
 file.

和许多像这样的类似错误

[WARNING] The repository url 'file://${basedir}/stage' is invalid - Repository '
local-mime4j-stage-repository' will be blacklisted.

我必须每次使用ctrl + c手动退出作业。你能否告诉我这些错误发生的原因?

1 个答案:

答案 0 :(得分:0)

目前的解决方法是禁用依赖项报告:

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>cim</report>
              ...
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

<强>参考

Dependency report fails to generate if dependencies contain com.ibm.icu:icu4j:2.6.1