2013-02-19 123 views
0

大家好我實際上使用Jenkins和testlink(使用testLink插件)來進行測試自動化。Maven執行測試不起作用

我對IC和testlink不熟悉,所以我嘗試着用「TestLink插件教程」做好開端。

但是當我運行構建我收到以下錯誤:

 
[workspace] $ C:\maven-3.0.4\bin\mvn.bat -s C:\maven-3.0.4\conf\settings.xml -gs C:\maven- 3.0.4\conf\settings.xml clean test -DsuiteXmlFiles=suite.xml                  
    [INFO] --------------------------------------------------------------------- 
    [INFO] Building Jenkins TestLink Plug-in Tutorial 0.3-SNAPSHOT 
    [INFO] --------------------------------------------------------------------- 
    [INFO]    
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ jenkins-testlink-plugin-     tutorial ------------------------------------------------------------ 
    [INFO] Deleting C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target 
    [INFO]  
    [INFO] --- docbkx-maven-plugin:2.0.11:generate-pdf (book-output) @ jenkins-testlink-plugin-tutorial --- 
    [INFO] Processing input file: book.xml 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD FAILURE 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 23.377s 
    [INFO] Finished at: Tue Feb 19 17:43:14 CET 2013 
    [INFO] Final Memory: 8M/112M 
    [INFO] ------------------------------------------------------------------------ 
    [ERROR] Failed to execute goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output) on project jenkins-testlink-plugin-tutorial: Failed to read source: Connection timed out: connect -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

我用我的行家/ conf目錄的settings.xml中定義的代理。

我認爲maven在生成pdf時無法達到目標測試。

我GOOGLE了很多,但沒有真正有用,有人可以幫我嗎?

+0

我將認爲docbkx正試圖從外部(互聯網)訪問DTD文件等,以驗證XML文件。此外,爲什麼你使用這種奇怪的命令行參數(只需使用** mvn clean test **)。而且通常你不需要套件文件。最好的方法是真正運行** mvn -X ... **並深入觀察輸出。 – khmarbaise 2013-02-19 17:46:32

+2

在maven/conf/settings.xml中定義的東西是錯誤的位置,因爲這是maven發行版的一部分。它將在您下次更新/更改Maven版本時被覆蓋。更好的位置是〜/ .m2/settings.xml文件,在jenkins等CI解決方案中運行也是如此。 – khmarbaise 2013-02-19 17:54:57

回答

0

好的,謝謝你的第一個建議!我不知道這個commande -DsuiteXmlFiles = suite.xml的用法是什麼,但沒有它的話沒有改變。隨着-X我這有:

[DEBUG] ----------------------------------------------------------------------- 
[DEBUG] Goal:   com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output) 
[DEBUG] Style:   Regular 
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <artifacts>${plugin.artifacts}</artifacts> 
    <draftMode>no</draftMode> 
    <foCustomization>src/main/book/stylesheets/style.xsl</foCustomization> 
    <fop1Extensions>1</fop1Extensions> 
    <generatedSourceDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target/book/generated/en</generatedSourceDirectory> 
    <highlightSource>1</highlightSource> 
    <includes default-value="*.xml">book.xml</includes> 
    <postProcess> 
    <copy todir="C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/target/book/media"> 
     <fileset dir="C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/src/main/book/media/"> 
     <include name="**/*.css"/> 
     <include name="**/*.png"/> 
     <include name="**/*.gif"/> 
     <include name="**/*.jpg"/> 
     </fileset> 
    </copy> 
    </postProcess> 
    <project>${project}</project> 
    <sourceDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace/src/main/book/en/</sourceDirectory> 
    <targetDirectory>C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target/book/en/</targetDirectory> 
    <targetFileExtension default-value="fo"/> 
    <xincludeSupported>true</xincludeSupported> 
</configuration> 

這:

[DEBUG] (f) draftMode = no 
[DEBUG] (f) foCustomization = src/main/book/stylesheets/style.xsl 
[DEBUG] (f) fop1Extensions = 1 
[DEBUG] (f) generatedSourceDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\generated\en 
[DEBUG] (f) highlightSource = 1 
[DEBUG] (f) includes = book.xml 
[DEBUG] (f) postProcess = 
[DEBUG] (f) project = MavenProject: com.tupilabs:jenkins-testlink-plugin-tutorial:0.3-SNAPSHOT @ C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\pom.xml 
[DEBUG] (f) sourceDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\src\main\book\en 
[DEBUG] (f) targetDirectory = C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\en 
[DEBUG] (f) targetFileExtension = fo 
[DEBUG] (f) xincludeSupported = true 
[DEBUG] -- end configuration -- 
[DEBUG] Catalogs to load: jar:file:/C:/Users/rlyonnet/.m2/repository/net/sf/docbook/docbook-xsl/1.75.2/docbook-xsl-1.75.2-ns-resources.zip!/docbook/catalog.xml 
[DEBUG] Using stylesheet: jar:file:/C:/Users/rlyonnet/.m2/repository/net/sf/docbook/docbook-xsl/1.75.2/docbook-xsl-1.75.2-ns-resources.zip!/docbook/fo/docbook.xsl 
[DEBUG] SourceFile: C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\src\main\book\en\book.xml 
[DEBUG] TargetFile: C:\Jenkins\jobs\Jenkins TestLink Plug-in examples\workspace\target\book\en\book.fo 
[INFO] Processing input file: book.xml 
[DEBUG] Advanced XInclude mode entered 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 23.450s 
[INFO] Finished at: Wed Feb 20 09:23:37 CET 2013 
[INFO] Final Memory: 7M/76M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.agilejava.docbkx:docbkx-maven-plugin:2.0.11:generate-pdf (book-output) on project jenkins-testlink-plugin-tutorial: Failed to read source: Connection timed out: connect -> [Help 1]