I have the travis.yml file configured as follows:
dist: trusty
language: java
jdk: oraclejdk8
services:
- mysql before_install:
- mysql -e 'CREATE DATABASE petclinic;'
script: mvn test -Dspring-boot.run.profiles=mysql-travis
addons:
sonarcloud:
organization: ""
token:
secure: ""
script:
- mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey = name
But it doesn't run for me. However, if I remove the addons part down it does run. I clarify that where the quotes name
go and the corresponding variables and tokens go. I don't know if the problem is due to the structure scheme that I follow, the idea is to include SonarCloud when analyzing together with Travis CI.
I write this in case someone has the same problem and doesn't know how to fix it. The issue has been resolved by removing the first tag from
script
and adding the command to the end tagscript
.