Currently, if you pass -Dsonar.branch.name=master (or -Dsonar.branch.name=trunk for SVN) before the project has been analyzed once, analysis will fail.
The workaround is to create the project beforehand. This may be seen as a best practice, but for many it’s more convenient to have a job template that is defined to analyze any branch (I.E. it systematically passes a sonar.branch.name=$SCM_BRANCH_NAME and that is instantiated for every new project)
So we'll provision on first analysis, regardless of presence or value of sonar.branch.name