Allure报告构建到Jenkins缺少Test body项

最近引入Allure框架时遇到了一个奇葩的问题,在此记录下:

问题描述:

在本地上跑脚本后生成的allure report可以正常的显示test body项以及attachment截图项,但是构建到Jenkins却丢失test body项

pom.xml配置如下:



    
    4.0.0
    
    com.test.test
    
    test
    
    1.0-SNAPSHOT
    
        UTF-8
        ${xmlFileName}
        1.8.10
    
    
        
            org.testng
            testng
            6.8
            test
        
        
            org.testng
            testng
            6.8
            compile
        
        
            org.seleniumhq.selenium
            selenium-java
            2.41.0
        
        
            org.seleniumhq.selenium
            selenium-server
            2.41.0
        
        
            commons-collections
            commons-collections
            3.2.1
        
        
            commons-lang
            commons-lang
            2.5
        
        
            commons-beanutils
            commons-beanutils
            1.9.2
        
        
            commons-logging
            commons-logging
            1.2
        
        
            commons-httpclient
            commons-httpclient
            3.1
        
        
            net.sf.json-lib
            json-lib-ext-spring
            1.0.2
        
        
            net.sourceforge.jexcelapi
            jxl
            2.6.10
        
        
            org.apache.poi
            poi
            3.17
        
        
            org.apache.poi
            poi-ooxml
            3.17
        
        
            org.apache.poi
            poi-ooxml-schemas
            3.17
        
        
            mysql
            mysql-connector-java
            5.1.45
        
        
            com.google.inject
            guice
            4.0
            test
        
        
            com.google.code.gson
            gson
            2.3.1
            test
        
        
        

        
            io.qameta.allure
            allure-testng
            2.0-BETA21
            test
        
        
            io.qameta.allure
            allure-java-commons
            2.12.1
            compile
        
    
    
        
            
                org.apache.maven.plugins
                maven-surefire-plugin
                2.20
                
                    
                        
                        src/test/resources/${xmlFileName}
                    
                    
                    
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    
                    
                    
                        -Dfile.encoding=UTF-8
                    
                    .
                
                
                    
                        org.aspectj
                        aspectjweaver
                        ${aspectj.version}
                    
                
            
        
    

本地运行的截图如下:


image.png

Jenkins上运行截图如下:(缺少test body项)


image.png

问题解决:

去掉pom设置中的-Dfile.encoding=UTF-8项


image.png

问题原因:

目前尚未找到原因

你可能感兴趣的:(Allure报告构建到Jenkins缺少Test body项)