newtmitch / docker-sonar-scanner

Quick sonar scanner docker image
MIT License
129 stars 88 forks source link

sonar-project.properties file #19

Closed FahdW closed 5 years ago

FahdW commented 5 years ago

I mounted my source code correctly and the scan is picking up some of the exclusions etc. However when it looks up the sonar.projectKey in said file it ignores it completely and just generates its own project name by default. Is it simply not adhering to these sonar-project.properties?

r4j4h commented 5 years ago

In the meantime since it is picking up some of the exclusions you could try passing the pieces that aren't making it as arguments,

for example sonar-scanner -Dsonar.projectKey="myproject"

newtmitch commented 5 years ago

@FahdW could you outline where you're putting your sonar-project.properties file that you expect this to be picked up as part of the test run?

newtmitch commented 5 years ago

@FahdW did you see my note in the README about overriding the sonar-runner.properties file with your own so you can specify your own properties as needed?

docker run -ti \
  -v $(pwd):/root/src \
  -v $(pwd)/sonar-runner.properties:/root/sonar-scanner/conf/sonar-scanner.properties \
  --link sonarqube newtmitch/sonar-scanner sonar-scanner
newtmitch commented 5 years ago

@FahdW I just confirmed this is working fine on my side with the 3.3.0 scanner. I'm going to close this for now until I can reproduce, or when I get more information about the core issue.