由于缺少执行数据文件而跳过JaCoCo执行:/ var / lib / jenkins / workspace / soapuiauto1 / hdap-project / tar get / jacoco.exec

时间:2017-09-09 21:53:55

标签: java maven jenkins code-coverage jacoco

我正在使用此

运行以下内容
clean jacoco:prepare-agent install jacoco:report -DENVIRONMENT=localhost -X
  

的pom.xml

文件我在jenkins服务器上运行这个pom,它是一个带有SoapUI Maven插件的maven项目,SoapUIproject.xml附加到maven做自动SoapUI测试我得到以下错误,我已经尝试了所有stackoverflow相关的答案这个项目并通过网络搜索,但仍然无法摆脱它:

  

[INFO] --- maven-install-plugin:2.4:install(default-install)@   soapui-maven-plugin --- [INFO]安装   /var/lib/jenkins/workspace/soapuiauto1/hdap-project/target/soapui-maven-plugin-0.0.1-SNAPSHOT.jar   至   /home/jboss/.m2/repository/com/smartbear/soapui/soapui-maven-plugin/0.0.1-SNAPSHOT/soapui-maven-plugin-0.0.1-SNAPSHOT.jar   [DEBUG]编写跟踪文件   /home/jboss/.m2/repository/com/smartbear/soapui/soapui-maven-plugin/0.0.1-SNAPSHOT/_remote.repositories   [INFO]正在安装   /var/lib/jenkins/workspace/soapuiauto1/hdap-project/pom.xml to   /home/jboss/.m2/repository/com/smartbear/soapui/soapui-maven-plugin/0.0.1-SNAPSHOT/soapui-maven-plugin-0.0.1-SNAPSHOT.pom   [DEBUG]写入跟踪文件[INFO]由于跳过JaCoCo执行   缺少执行数据   文件:/var/lib/jenkins/workspace/soapuiauto1/hdap-project/target/jacoco.exec

通知上游项目完成工作 加入通知程序需要一个CauseAction     http://maven.apache.org/xsd/maven-4.0.0.xsd">         4.0.0         com.smartbear.soapui         soapUI的,Maven的插件         0.0.1-SNAPSHOT                                        5.3.0                                                             獾                                      假                                              环境                         獾                                                                                                                   火鸡                                      假                                              环境                         火鸡                                                                                                                   豹                                      假                                              环境                         豹                                                                                                                   QA6                                      假                                              环境                         QA6                                                                                                                   QA7                                      假                                              环境                         QA7                                                                                                                   QA8                                      假                                              环境                         QA8                                                                                                                                     smartbear - 瑞典 - 插件 - 库                 http://smartbearsoftware.com/repository/maven2/                                           Vonage公司-M2-插件系统信息库                 http://maven.dev.s.vonagenetworks.net:8080/nexus/content/repositories/Vonage-m2/             

    </pluginRepositories>
    <repositories>
    </repositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui-maven-plugin</artifactId>
                <version>${soapui.plugin.version}</version>
                <dependencies>
                <dependency>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui</artifactId>
                <version>${soapui.plugin.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javafx</groupId>
                        <artifactId>jfxrt</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
                    <dependency>
                        <groupId>org.reflections</groupId>
                        <artifactId>reflections</artifactId>
                        <version>0.9.10</version>
                    </dependency>
                    <dependency>
                        <groupId>org.postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>9.3-1102-jdbc41</version>
                    </dependency>
                    <dependency>
                       <groupId>org.mongodb</groupId>
                       <artifactId>mongodb-driver</artifactId>
                       <version>3.3.0</version>
                   </dependency>
                    <dependency>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.19.1</version>
                    </dependency>
                    <dependency>
                        <groupId>com.jgoodies</groupId>
                        <artifactId>jgoodies-forms</artifactId>
                        <version>1.6.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.vonage.asl</groupId>
                        <artifactId>unifiedServices</artifactId>
                        <version>2015.12.4-RELEASE</version>
                        <exclusions>
                            <exclusion>
                                <groupId>*</groupId>
                                <artifactId>*</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-lang3</artifactId>
                        <version>3.3.2</version>
                    </dependency>
                    <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.11</version>
                    </dependency>

                </dependencies>
                <configuration>
                    <settingsFile>${basedir}/src/config/soapui-settings.xml</settingsFile>
                    <junitReport>true</junitReport>
                    <printReport>true</printReport>

                </configuration>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <trimStackTrace>false</trimStackTrace>
                            <testFailIgnore>true</testFailIgnore>
                            <outputFolder>${project.build.directory}/reports</outputFolder>
                            <projectFile>${basedir}/src/test/resources/HDAP-soapui-project.xml</projectFile>
                            <projectProperties>
                                <projectProperty>ENVIRONMENT=${ENVIRONMENT}</projectProperty>
                            </projectProperties>
            <junitReport>true</junitReport>
                    <skip>${skipITs}</skip>
                    <coverage>${project.build.directory}/reports</coverage>
                        </configuration>
          </execution>
                </executions>
            </plugin>
        <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.2.201409121644</version>
               <!-- <configuration>
                   <destFile>${jacoco.reportPath}</destFile>
                    <dataFile>${jacoco.reportPath}</dataFile>
                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                    <classDumpDir>${project.reporting.outputDirectory}/jacoco-it/classes</classDumpDir> 
                    <skip>${skipITs}</skip>
            <output>file</output>
                </configuration> -->
                <executions>
                    <execution>
                        <id>jacoco-agent</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                      <configuration>
                           <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile> 
                            <propertyName>jacoco.agent.itArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-report</id>
                        <phase>post-integration-test</phase>
                           <configuration>
                <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
                <!-- Sets the output directory for the code coverage report. -->
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-out</outputDirectory>
                </configuration>

                        <goals>
                            <!--<goal>dump</goal> -->
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
                            <configuration>
                    <systemPropertyVariables>
                        <jacoco-agent.destFile>target/jacoco.exec</jacoco-agent.destFile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
    <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.15</version>
    <executions>
        <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.15</version>
    <executions>
        <!--
            Ensures that both integration-test and verify goals of the Failsafe Maven
            plugin are executed.
        -->
        <execution>
            <id>integration-tests</id>
            <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
            </goals>
            <configuration>
                <!-- Sets the VM argument line used when integration tests are run. -->
                <argLine>${jacoco.agent.itArgLine}</argLine>

                <skipTests>${skip.integration.tests}</skipTests>
            </configuration>
        </execution>
    </executions>
</plugin>
        </plugins>
    </build>
</project>

1 个答案:

答案 0 :(得分:0)

您是否在Jenkins中运行maven时明确设置-DskipITs=false