0

We are running the Sonar analysis as part of the TFS 2015 builds. We are using powershell script which executes a maven command to run the sonar analysis. Analysis is happening fine, but we get the above error

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

Powershell script is as below

    $param = " sonar:sonar  -X >" + " " + """" + location + "\Sonarlog.txt"" --f=""" + $Env:BUILD_REPOSITORY_LOCALPATH + "\pom.xml"""
    write-host $param
    Invoke-Expression "cmd.exe /c mvn.bat $param"

We tried installing certificate as instructed in the below answer This stackoverflow answer. But still the issue persists.

Community
  • 1
  • 1
Nayana Setty
  • 1,001
  • 1
  • 12
  • 34
  • Can you give what the param string is supposed to look like in the end? I am guessing you are having issues with things like your 4 double quotes. In general, it's better to not use the plus sign as string concatenation and just enclose your whole string in double quotes. Then you just need to escape the relevant characters with ` – BenH Sep 30 '16 at 13:49
  • Does this script work if you run it manually on TFS build agent machine? – Cece Dong - MSFT Oct 03 '16 at 00:54
  • Are you trying to connect to a SonarQube server via HTTPS? It looks like that at some point a SSL connection fails to validate your SSL certificate. Make sure that your SSL certificate is in the keystore of the JVM that is used to run Maven. Here are useful links that could help you adding your SSL certificate to your keystore: https://docs.oracle.com/cd/E19830-01/819-4712/ablqw/index.html http://maven.apache.org/guides/mini/guide-repository-ssl.html – Jean-Denis Coffre Oct 04 '16 at 09:30

0 Answers0