Maven工作服插件 [英] Maven coveralls plugin

查看:92
本文介绍了Maven工作服插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为项目使用travis CI和工作服.

I'm using travis CI and coveralls for a project.

我得到了错误 Processing of input or output data failed: Report submission to Coveralls API failed with HTTP status 422: Unprocessable Entity (Couldn't find a repository matching this job.). 您可以在那里看到该版本.

I get the error Processing of input or output data failed: Report submission to Coveralls API failed with HTTP status 422: Unprocessable Entity (Couldn't find a repository matching this job.). You can see the build there.

我的pom.xml:

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <outputDirectory>${basedir}/target</outputDirectory>
                <format>xml</format>
                <maxmem>256m</maxmem>
                <!-- aggregated reports for multi-module projects -->
                <aggregate>true</aggregate>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
             <version>3.0.1</version>

            <configuration>
                <coberturaReports>
                    <coberturaReport>
                        ${basedir}/target/coverage.xml
                    </coberturaReport>
                </coberturaReports>
                <sourceEncoding>UTF-8</sourceEncoding>
                <serviceName>travis-ci</serviceName>
                <serviceJobId>${env.TRAVIS_JOB_ID} </serviceJobId>
            </configuration>
        </plugin>

我在其免费版本中使用工作服. 为什么工作服无法得到我的建造物?

I use coveralls in it's free version. Why coveralls cannot get my build ?

谢谢

推荐答案

这是解决方案:

该环境变量在travis环境中可用,但我需要为工作服注入它.

The environment variable is available in the travis environment but I needed to inject it for the coveralls task.

这意味着添加-DTRAVIS_JOB_ID=$TRAVIS_JOB_ID以便使其在pom.xml中可用

That means adding -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID in order to let it available in the pom.xml

travis.yml中的最后一行:

Final line in travis.yml :

- mvn clean -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID cobertura:cobertura coveralls:report

这篇关于Maven工作服插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆