Closed fabiocarvalho777 closed 7 years ago
Did you download the jar directly from maven?
If you follow the steps here: https://github.com/codacy/codacy-coverage-reporter#setup it should not happen
I did download the jar directly from maven, and I did followed the instructions you pointed out.
The only difference is that I used codacy-coverage-reporter-1.0.13.jar
.
Your doc refer to codacy-coverage-reporter-assembly-1.0.5.jar
though. So, when I use it, I get a different error, as seen below.
Error: Could not find or load main class com.codacy.CodacyCoverageReporter
If I do
wget https://github.com/codacy/codacy-coverage-reporter/releases/download/1.0.13/codacy-coverage-reporter-assembly-1.0.5.jar
java -cp codacy-coverage-reporter-assembly-1.0.5.jar com.codacy.CodacyCoverageReporter -l Java -r jacoco.xml
in a clean machine if requests my token so it is finding the class. Not sure what can be the problem. Do you have any aditional details? What are you exactly doing?
The previous error I got when using a different jar codacy-coverage-reporter-1.0.13.jar
. When I use codacy-coverage-reporter-assembly-1.0.5.jar
though, I get [error] com.codacy Failed to upload report: Not Found
. See all my commands below.
[facarvalho@LM-aun-00874876 resteasy-spring-boot]$ ls resteasy-spring-boot-starter/target/site/cobertura/coverage.xml
resteasy-spring-boot-starter/target/site/cobertura/coverage.xml
[facarvalho@LM-aun-00874876 resteasy-spring-boot]$ java -cp codacy-coverage-reporter-assembly-1.0.5.jar com.codacy.CodacyCoverageReporter -l Java -r ./resteasy-spring-boot-starter/target/site/cobertura/coverage.xml --projectToken XXXXXXXXXX
2017-04-19 11:43:54,297 [info] com.codacy Parsing coverage data...
2017-04-19 11:43:54,573 [info] com.codacy Uploading coverage data...
2017-04-19 11:43:55,815 [error] com.codacy Failed to upload report: Not Found
Weird. I just noticed the jar in the 1.0.13 release is 1.0.5 and that might be the actual problem. Can you try with https://secure.central.sonatype.com/maven2/com/codacy/codacy-coverage-reporter/1.0.13/codacy-coverage-reporter-1.0.13-assembly.jar ?
I didn't work neither. I got: [error] com.codacy Failed to upload report: Not Found
My full command and output below:
[facarvalho@LM-aun-00874876 resteasy-spring-boot]$ ls -l ./resteasy-spring-boot-starter/target/site/cobertura/coverage.xml
-rw-r--r-- 1 facarvalho 110111498 45591 Apr 17 10:45 ./resteasy-spring-boot-starter/target/site/cobertura/coverage.xml
[facarvalho@LM-aun-00874876 resteasy-spring-boot]$ java -cp codacy-coverage-reporter-1.0.13-assembly.jar com.codacy.CodacyCoverageReporter -l Java -r ./resteasy-spring-boot-starter/target/site/cobertura/coverage.xml --projectToken XXXXXXXX
2017-04-20 11:18:28,353 [info] com.codacy Parsing coverage data...
2017-04-20 11:18:28,680 [info] com.codacy Uploading coverage data...
2017-04-20 11:18:30,024 [error] com.codacy Failed to upload report: Not Found
I just updated one of our projects to use this instead of JPM.
https://github.com/codacy/codacy-api-java/blob/master/circle.yml#L7
Are you exporting the CODACY_PROJECT_TOKEN in the environment?
Yes, I am CODACY_PROJECT_TOKEN in the environment. Keep in mind that before JPM broken codacy worked perfectly for me.
I got the same com.codacy Failed to upload report: Not Found
error after doing what you said.
I am starting to wonder if my token is bad.
What does that error message mean exactly? Does it mean the token is bad?
Also, what is the token for? I am asking because even though I get that error message, I can tell still my coverage data gets uploaded.
Usually either the token is bad or the endpoint is wrong.
Old versions will have outdated endpoints since we changed some time ago.
Just to confirm, you are using the token generated in the project settings > integration > project token?
The issue is finally solved. So, actually there were two issues here:
java.lang.NoClassDefFoundError: scala/Product
and later Error: Could not find or load main class com.codacy.CodacyCoverageReporter
, depending on the jar used.com.codacy Failed to upload report: Not Found
. That started to happen only after issue 1 was solved, but before we talked about how the token is used, we hadn't realized that.I changed the way to get the codacy report tool (as seen here) and reset the codacy token in the CI environment and now everything works.
Thanks a lot Rodrigo for your time and getting this solved.
Feel free to close this issue.
Hello,
Whenever I run CodacyCoverageReporter I get the following error:
It happens when I run it manually from my laptop or also during automated builds in CI job, as you can see here (search for
java.lang.NoClassDefFoundError: scala/Product
).The odd thing about it is that, regardless of this issue, apparently the coverage info seems to be uploaded.