倾城:未能获得ru.yandex.qat的报告ools.allure:allure-maven-plugin

时间:2015-06-23 12:08:14

标签: java maven junit maven-site-plugin allure

我试图将Allure系到我的测试中。我开始时的文档说(https://github.com/allure-framework/allure-core/wiki#getting-started)但是有一个我无法处理的错误:mvn site

[INFO] --- maven-site-plugin:3.0:site (default-site) @ oiakProject ---
[INFO] configuring report plugin ru.yandex.qatools.allure:allure-maven-      plugin:1.4.14
Downloading:     http://repo.maven.apache.org/maven2/ru/yandex/qatools/allure/allure
-maven-plugin/1.4.14/allure-maven-plugin-1.4.14.pom
[WARNING] The POM for ru.yandex.qatools.allure:allure-maven-  plugin:jar:1.4.14 is
missing, no dependency information available
[INFO] --------------------------------------------------------------------- ---
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site- plugin:3.0:si
te (default-site) on project oiakProject: failed to get report for   ru.yandex.qat
ools.allure:allure-maven-plugin: Plugin ru.yandex.qatools.allure:allure-maven-pl
ugin:1.4.14 or one of its dependencies could not be resolved: Failed to read art
ifact descriptor for ru.yandex.qatools.allure:allure-maven-plugin:jar:1.4.14: Co
uld not find artifact ru.yandex.qatools.allure:allure-maven-plugin:pom:1.4.14 in
central (http://repo.maven.apache.org/maven2) -> [Help 1]

这是我的 pom.xml

 <properties>
   <allure.version>1.4.14</allure.version>
   <aspectj.version>1.8.5</aspectj.version>
</properties>

  <dependencies> 
     <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
     </dependency>
  </dependencies>

<build>
  <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.3</version>
       <configuration>
         <source>1.8</source>
         <target>1.8</target>
       </configuration>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
            <testFailureIgnore>false</testFailureIgnore>
            <argLine>
                -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
            </argLine>
            <properties>
                <property>
                      <name>listener</name>
                    <value>ru.yandex.qatools.allure.junit.AllureRunListener</value>
                  </property>
              </properties>
          </configuration>
          <dependencies>
              <dependency>
                  <groupId>org.aspectj</groupId>
                  <artifactId>aspectjweaver</artifactId>
                  <version>${aspectj.version}</version>
              </dependency>
          </dependencies>
      </plugin>

     <plugin>
           <groupId>org.eclipse.jetty</groupId>
           <artifactId>jetty-maven-plugin</artifactId>
           <version>9.2.10.v20150310</version>
           <configuration>
                <webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
                <stopKey>stop</stopKey>
                <stopPort>1234</stopPort>
           </configuration>
    </plugin>
</plugins>
</build>

  <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>2.2</version>
        </plugin>
    </plugins>
</reporting>

  

1 个答案:

答案 0 :(得分:0)

此问题似乎与公司网络代理有关。使用Allure时我也遇到了同样的问题。

我尝试设置Git,克隆来自Github的回购并且无法做到。我通过在git config中设置来解决这个问题。参考文献:

是否可以在Allure配置文件中设置http(s)代理配置?

我的批处理文件:

@echo off

echo "Copying Test Assemblies"

copy D:\GIT\QA.Selenium\QA.Selenium\bin\Debug\*.*  D:\Execute_NUNIT_ALLURE\TestAssemblies\ 

echo "Setting Assembly Directory"
set ASSEMBLIES_DIR=D:\Execute_NUNIT_ALLURE\TestAssemblies

echo "Setting NUnit3 Directory"
set NUNIT_HOME=D:\NUnit-3.0.0

echo "Setting Allure Directory"
set ALLURE_CLI_HOME=D:\allure-cli

echo "Setting JAVA_HOME"
set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_65"

echo "Setting JRE_HOME"
set JRE_HOME="C:\Program Files\Java\jre1.8.0_65"

echo "Setting NUnit Test Output Directory"
set OUTPUT_DIR=D:\Execute_NUNIT_ALLURE\TestResults

echo "Setting Allure Report Directory"
set ALLURE_REPORT=D:\Execute_NUNIT_ALLURE\TestReports

echo "Executing NUnit Tests"
%NUNIT_HOME%\bin\nunit3-console %ASSEMBLIES_DIR%\QA.Selenium.dll /framework=net-4.0 

echo "Generating Allure Reports"
%JAVA_HOME%\bin\java -jar %ALLURE_CLI_HOME%\lib\allure-cli.jar report generate -v 2.1 %OUTPUT_DIR% -o %ALLURE_REPORT%

我的输出:

D:\Execute_NUNIT_ALLURE>NUnit_Allure.bat
"Copying Test Assemblies"
D:\GIT\QA.Selenium\QA.Selenium\bin\Debug\AllureCSharpCommons.dll
....
D:\GIT\QA.Selenium\QA.Selenium\bin\Debug\log4net.dll 
D:\GIT\QA.Selenium\QA.Selenium\bin\Debug\WebDriver.xml
       16 file(s) copied.
"Setting Assembly Directory"
"Setting NUnit3 Directory"
"Setting Allure Directory"
"Setting JAVA_HOME"
"Setting JRE_HOME"
"Setting NUnit Test Output Directory"
"Setting Allure Report Directory"
"Executing NUnit Tests"
NUnit Console Runner 3.0.5797
Copyright (C) 2015 Charlie Poole

Runtime Environment
   OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
  CLR Version: 4.0.30319.18034

Test Files
    D:\Execute_NUNIT_ALLURE\TestAssemblies\QA.Selenium.dll

=> QA.Selenium.Test_Scripts.LoginTest
#. Test Case Start: Login
Test Step - Visit URL
Test Step - Verify Login Page appeared
....
Test Case End
=> QA.Selenium.Test_Scripts.LogoutTest
#. Test Case Start: Logout
Test Step - Click Logout Link
...
Test Case End

Run Settings
    RuntimeFramework: net-4.0
    WorkDirectory: D:\Execute_NUNIT_ALLURE
    NumberOfTestWorkers: 8

Test Run Summary
    Overall result: Passed
   Tests run: 2, Passed: 2, Errors: 0, Failures: 0, Inconclusive: 0
     Not run: 0, Invalid: 0, Ignored: 0, Explicit: 0, Skipped: 0
  Start time: 2015-12-02 07:40:54Z
    End time: 2015-12-02 07:42:03Z
    Duration: 68.520 seconds

Results (nunit3) saved as TestResult.xml
"Generating Allure Reports"
I/O exception (java.net.SocketException) caught when processing request: Connect
ion reset
Retrying request
I/O exception (java.net.SocketException) caught when processing request: Connect
ion reset
Retrying request
I/O exception (java.net.SocketException) caught when processing request: Connect
ion reset
Retrying request
org.eclipse.aether.collection.DependencyCollectionException: Failed to read arti
fact descriptor for ru.yandex.qatools.allure:allure-report-data:jar:2.1