title: How to configure SonarCloud
body: <p>I have java project and I want to integrate it with SonarCloud I Follow the official steps:</p>
  
  <blockquote>
    <p>Inspecting code with the SonarQube Scanner #</p>
    
    <p>Before inspecting your code, you need to:</p>
    
    <ol>
    <li>Create a user authentication token for your account on SonarCloud.</li>
    <li>Encrypt this token travis encrypt abcdef0123456789 or define SONAR_TOKEN in your Repository Settings</li>
    <li>Find which SonarCloud.io organization you want to push your project on and get its key</li>
    <li>Create a sonar-project.properties file for your project (see the documentation). Then add the following lines to your .travis.yml file
    to trigger the analysis:</li>
    </ol>
  </blockquote>
  
  <p>add in my travis.yml file</p>
  
  <pre><code> addons:
    sonarcloud:
      organization: "xelian-github"
      token:
        secure: ${SONAR_TOKEN}
      branches:
        - master
  script:
    # other script steps might be done before running the actual analysis
    - sonar-scanner
  </code></pre>
  
  <p>Where SONAR_TOKEN is a variable on Travis CI pointing to the key from SonarCloud.(It is not encrypted).
  <a href="https://i.stack.imgur.com/2Gapz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2Gapz.png" alt="enter image description here"></a>
  From SonarCloud I add permissions
  <a href="https://i.stack.imgur.com/aK1Kf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aK1Kf.png" alt="enter image description here"></a></p>
  
  <p>But when I start the travis build I have the following error:</p>
  
  <pre><code>Setting environment variables from repository settings
  $ export SONAR_TOKEN=[secure]
  
   ....
  ERROR: Error during SonarQube Scanner execution
  ERROR: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
  ERROR: 
  ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
  </code></pre>
  
  <p>It seems to me that I the travis do not have permissions to upload results to SonarCloud. Is the problem in the token or in some Sonar configurations.</p>