coveralls-maven-plugin icon indicating copy to clipboard operation
coveralls-maven-plugin copied to clipboard

Build error: Line number [...] is greater than the source file

Open ak80 opened this issue 8 years ago • 7 comments

Hi Team,

I was unable to find a solution to my problem, when using coveralls-maven-plugin in my project. I have mixed Java and Kotlin sources and do my coverage reporting with jacoco. My build fails when I do a

mvn test jacoco:report coveralls:report

with this error:

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:4.2.0:report (default-cli) on project BinaryDataParser: Build error: Line number 90 is greater than the source file bdp-processor/src/main/java/org/ak80/bdp/MappedClass.kt size -> [Help 1]

Any idea what could be the problem? Looking at the htm repors created by jacoco, everything seems fine.

Thank you for your time

Alex

ak80 avatar Nov 27 '16 16:11 ak80

I see now, that this is a known problem, at least with Scala, see #98 and #73 and #82. Still any idea how to workaround this with Kotlin?

ak80 avatar Dec 01 '16 17:12 ak80

My guess is that something similar happens here what happens with scalac. Sorry that at the moment I have no time to investigate this more.

You could check the exact JaCoCo output XML files and the line numbers found there. If the line numbers are off like what happens with scalac then I really don't know what we can do about it.

trautonen avatar Dec 04 '16 20:12 trautonen

Alright, thank you for your reply. Maybe I can reach out to the Kotlin folks :-)

ak80 avatar Dec 08 '16 20:12 ak80

@trautonen Looks like the Kotlin issue is caused by its compiler inlining functions, and the extra lines are the best solution they have: https://youtrack.jetbrains.com/issue/KT-9766

Given this, would you be more open to a PR like https://github.com/trautonen/coveralls-maven-plugin/pull/97 being acceptable?

josephlbarnett avatar Jun 10 '17 00:06 josephlbarnett

I've the same problem with a plain java project. Please have a look at spotter.

sdorra avatar Feb 10 '18 16:02 sdorra

still no workarounds for this? I'm having the following error message: Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:4.3.0:report (default-cli) on project jpademo: Build error: Line number 13 is greater than the source file src/main/kotlin/com/anyulled/jpademo/JpaDemoApplication.kt size -> [Help 1]

anyulled avatar Aug 27 '18 06:08 anyulled

I have the same result with Kotlin and JaCoCo in version 7.X. If I upgrade to JaCoCo 8.X, the system shows me some error about file "Comparison.kt" not found. This file is the result of an inner class generated by the Kotlin code for lambda and name like this by JaCoCo.

Build pipeline in 0.7.5: https://gitlab.com/davinkevin/Podcast-Server/-/jobs/265523285 Build pipeline in 0.8.4: https://gitlab.com/davinkevin/Podcast-Server/-/jobs/265523712

For information, I migrated to codecov which do the job for me.

davinkevin avatar Aug 04 '19 17:08 davinkevin