I've just deployed a CI system based on jenkins plus sonarqube. Once Jenkins Sonnarscanner starts his part of the Pipeline I can see a lot of messages such as the following:
WARN: Invalid character encountered in file /var/jenkins_home/workspace/Pipeline Test/code/..../CodigoSitioDAO.java at line 3 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
Well, my sonarqube calling line is:
sh "${scannerHome}/bin/sonar-scanner \
-Dsonar.sourceEnconding=UTF-8 \
-Dsonar.projectKey=My_Project\
-Dsonar.sources=. \
-Dsonar.java.binaries=. \
-Dsonar.nodejs.executable=. \
-Dsonar.login=c9bb378b2380af844c7465424933b942d10f5d18 \
-Dsonar.host.url=http://sonarqube:9000"
}
So, once I've check the mentioned file, what I can see in line 3 is something that I think does not have to do with the warning messages: import java.sql.Connection;
Having also configured -Dsonar.sourceEncoding=UTF-8
, I have to say that I don't know what is happenig.
Could anyone of you help me?