trautonen / coveralls-maven-plugin

Maven plugin for submitting Java code coverage reports to Coveralls web service.
MIT License
312 stars 123 forks source link

Report submission to Coveralls API failed with HTTP status 422 #62

Closed ogdabou closed 9 years ago

ogdabou commented 9 years ago

Hi !

Thank you for your plugin, it sounds great :). But I have a problem.

I'm using travis CI and coveralls for a projec, both in free version. My projet is written in JAVA and uses Maven.

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.

My 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 ?

Thanks

ogdabou commented 9 years ago

Hello,

After various try it seems that my error is in my travis.yml and a lack of basic maven knowledge.

I thought <serviceJobId>${env.TRAVIS_JOB_ID} </serviceJobId> was sufident but maven needs to inject the variable.

In my travis.yml I changed :
- mvn clean cobertura:cobertura coveralls:report
to - mvn clean -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID cobertura:cobertura coveralls:report

That way the variable is available in pom.xml

trautonen commented 9 years ago

I'm not sure 100% how Travis exposes the environment variables, but anyway coveralls maven plugin has automatic service detector for Travis, so you don't need any of the service specific configuration. Just remove serviceName and serviceJobId configuration parameters and you should not need the JVM system property either.