1

I'm trying to use Codacy with Travis CI, Spring Boot and Maven.

My .travis.yml:

env:
  global:
  - CODACY_PROJECT_TOKEN = Zcs....

My pom.xml

<dependency>
<groupId>org.jacoco</groupId>
<rtifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
</dependency>

and I got this error from Travis CI

10/27 21:11:23 ERROR c.c.rules.ConfigurationRules:22 - Invalid configuration: Project token not provided and not available in environment variable "CODACY_PROJECT_TOKEN" 

Anyone can help me?

vinibrsl
  • 6,563
  • 4
  • 31
  • 44
Rodrigo Batista
  • 151
  • 2
  • 12
  • 2
    Please be mindful of the tags you put on your question. As far as I can tell, your question is not about Java, Spring nor Maven (even though you may be using these), and thus those tags are not appropriate for this question. – Joe C Oct 27 '18 at 21:58

1 Answers1

2

Try removing the spaces between the environment variable key and the equal sign.

env:
  - DB=postgres
  - SH=bash
  - PACKAGE_VERSION="1.0.*"
  - CODACY_PROJECT_TOKEN="..."
vinibrsl
  • 6,563
  • 4
  • 31
  • 44
  • thanks sir. But now has a new error: 10/27 22:26:44 ERROR c.c.CodacyCoverageReporter$:28 - File /home/travis/build/rjdesenvolvimento/apipessoas/build/reports/jacoco/test/jacocoTestReport.xml does not exist. – Rodrigo Batista Oct 27 '18 at 22:27
  • 1
    that means something is wrong on your pipeline now Rodrigo. Best way to debug it is to clean your repo (mvn clean), and follow the same steps than travis. You'll see the file does not exist also. Probably some command is missing. Are you following the instructions on the README? https://github.com/codacy/codacy-coverage-reporter/#codacy-coverage-reporter – pedrorijo91 Oct 28 '18 at 08:07
  • I discovered the error. Using postgresql, I used schemas to merge tables that belonged to the same purpose. When I run the tests, the H2 reports that schemas are missing. – Rodrigo Batista Oct 28 '18 at 11:28