GithubHelp home page GithubHelp logo

Comments (12)

rtfpessoa avatar rtfpessoa commented on May 20, 2024

Did you download the jar directly from maven?

from codacy-coverage-reporter.

rtfpessoa avatar rtfpessoa commented on May 20, 2024

If you follow the steps here: https://github.com/codacy/codacy-coverage-reporter#setup
it should not happen

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

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

from codacy-coverage-reporter.

rtfpessoa avatar rtfpessoa commented on May 20, 2024

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?

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

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

from codacy-coverage-reporter.

rtfpessoa avatar rtfpessoa commented on May 20, 2024

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 ?

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

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 

from codacy-coverage-reporter.

rtfpessoa avatar rtfpessoa commented on May 20, 2024

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?

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

Yes, I am CODACY_PROJECT_TOKEN in the environment. Keep in mind that before JPM broken codacy worked perfectly for me.

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

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.

from codacy-coverage-reporter.

rtfpessoa avatar rtfpessoa commented on May 20, 2024

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?

from codacy-coverage-reporter.

fabiocarvalho777 avatar fabiocarvalho777 commented on May 20, 2024

The issue is finally solved. So, actually there were two issues here:

  1. The first was how to get the correct jar and run it properly, that was causing first java.lang.NoClassDefFoundError: scala/Product and later Error: Could not find or load main class com.codacy.CodacyCoverageReporter, depending on the jar used.
  2. There was in fact a problem with the token I had in the environment variable at my CI environment. That was causing 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.

from codacy-coverage-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.