SonarQube upgrade from 6.4 to 6.5 breaks the scanner

后端 未结 4 1425
青春惊慌失措
青春惊慌失措 2021-02-14 03:58
  1. I am on sonarQube6.4 and have upgraded to 6.5
  2. Sonar-scanner is 3.0.3
  3. Now after the upgrade the scanner fails anytime there is a java file in the source p
相关标签:
4条回答
  • 2021-02-14 04:29

    Error during SonarQube Scanner execution org.sonar.squidbridge.api.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property

    Since SonarJava 4.12, you must specify sonar.java.binaries property https://docs.sonarqube.org/display/PLUG/Java+Plugin+and+Bytecode

    Example :

    sonar-scanner -Dsonar.projectKey=fr.demo:my-project -Dsonar.sources=. -Dsonar.java.binaries=.
    
    0 讨论(0)
  • 2021-02-14 04:34

    The error message says:

    Error during SonarQube Scanner execution org.sonar.squidbridge.api.AnalysisException:
    Please provide compiled classes of your project with sonar.java.binaries property
    

    It seems like the java sensor requires the .class files, in addition to the .java files.

    You could:

    • Add those files to the analysis (it will by the way give you more valuable sonar findings!)
    • Try adding and removing files to find out, which piece of code causes the issue and report it as a Sonar Java bug
    0 讨论(0)
  • 2021-02-14 04:43

    Even i was also facing same issue after SonarQube upgrade to latest 6.5 version. But after downgrading SonarJava plugin(from 4.12 to 4.11), it worked. Hope it will help you.

    0 讨论(0)
  • 2021-02-14 04:53

    I had this issue as well and I fixed it in the following way:

    This page mentions about an entry which was optional before and became mandatory during the latest update (4.12). It says that the sonar.java.binaries entry in the Jenkins project settings should be set. When set, even to a faulty folder, it will fix your errors, leaving only a warning and your pipeline will be running again.

    The setting should be added to Jenkins -> "your project" -> Configuration -> Build -> Execute SonarQube Scanner -> Analysis Properties. Add this entry and point it to your binaries folder.

    0 讨论(0)
提交回复
热议问题