coveralls-maven-plugin: Source not found

I am trying to build http://github.com/dresden-ocl/dresdenocl repository. But if I run mvn cobertura:cobertura coveralls:report cobertura runs fine. But coveralls-maven-plugin reports a problem:

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:3.0.1:report (default-cli) on project org.dresdenocl: I/O operation failed: No source found for testpackage/Class1_DefAspect_testSortedByIteratorExp01.aj -> [Help 1]

The file in question lies in /tests/org.dresdenocl.tools.codegen.ocl2java.test.aspectj/src/testpackage/constraints so I really ask me why it is not looking into testpackage/constraints/ but in testpackage/.

Tried adding the directory to sourceDirectory but this does not help.

As you can see it is a multi module setup. Maybe you see where the problem comes from.

About this issue

  • Original URL
  • State: open
  • Created 10 years ago
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, i solved the issue adding the source directory to the list of directories where coveralls searches the sources. I do not understand why coveralls plugin is not looking in the default source directory.

However, find below my working configurations:

<plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <repoToken>${env.COVERALLS_TOKEN}</repoToken>
                    <sourceEncoding>UTF-8</sourceEncoding>
                    <sourceDirectories>
                        <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
                    </sourceDirectories>
                </configuration>
            </plugin>

Hello, i am encountering the same issue on a Scala project built with Maven and using Travis. Please find following my configuration in the pom.xml:

<plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <repoToken>${env.COVERALLS_TOKEN}</repoToken>
                    <sourceEncoding>UTF-8</sourceEncoding>
                </configuration>
            </plugin>
<plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

The .travis.yml

sudo: false
language: java
notifications:
  email:
    on_success: change 
    on_failure: always
script:
    - mvn test jacoco:report
after_success:
    - mvn coveralls:report

Could you please help me?

The problem is that this plugin cannot deal with any kind of code generation, because it requires the original source to be available. It is also questionable if you should run your coverage metrics based on generated code, which actually means you are testing a code generator, not your own code.

As a general solution, all generated code should be excluded from coverage tools. JaCoCo: http://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html#excludes Cobertura (Instrumentation): http://www.mojohaus.org/cobertura-maven-plugin/usage.html