Azure DevOps with Maven: Fail to get bootstrap index from server: connect timed out

  • ALM used: Azure DevOps

  • CI system used: Azure DevOps, the problem only occurs in combination with Maven. I’m using the default Maven task for it.

  • Scanner command used when applicable (private details masked): C:\WINDOWS\system32\cmd.exe /D /S /C ““C:\Program Files (x86)\apache-maven-3.6.3\bin\mvn.cmd” -f C:\Agent\1\1000\s\pom.xml -s C:\Agent\1_temp\settings.xml -X -e clean package “-Dsonar.jacoco.reportPaths=C:\Agent\1\1000\s\CCReport43F6D5EF\jacoco.exec” org.sonarsource.scanner.maven:sonar-maven-plugin:RELEASE:sonar”

  • Languages of the repository: Java

I’m running out of options. We are using Azure DevOps, with private agents. These agents are behind a corporate proxy, so that’s the first place to look.

I already did:
Added the certificates to the Java keystore
Add proxy settings (for the agent, Java and Maven)

When we run the scanner for .NET, or if we run the standalone scanner, everything works fine. So the proxy isn’t blocking the content.

When we run the scanner from Maven, we get the following error:

2021-04-08T07:08:27.3067934Z [DEBUG] 07:08:27.306 Extract sonar-scanner-api-batch in temp...
2021-04-08T07:08:27.3119096Z [DEBUG] 07:08:27.311 Get bootstrap index...
2021-04-08T07:08:27.3119751Z [DEBUG] 07:08:27.311 Download: https://sonarcloud.io/batch/index
2021-04-08T07:08:42.3533904Z [ERROR] 07:08:42.352 SonarCloud server [https://sonarcloud.io] can not be reached
2021-04-08T07:08:42.3537358Z [INFO] ------------------------------------------------------------------------
2021-04-08T07:08:42.3537719Z [INFO] BUILD FAILURE
2021-04-08T07:08:42.3539208Z [INFO] ------------------------------------------------------------------------
2021-04-08T07:08:42.3541521Z [INFO] Total time:  20.767 s
2021-04-08T07:08:42.3543764Z [INFO] Finished at: 2021-04-08T07:08:42Z
2021-04-08T07:08:42.3545203Z [INFO] ------------------------------------------------------------------------
2021-04-08T07:08:42.3558583Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project ms-waynemo-asset-service: Unable to execute SonarScanner analysis: Fail to get bootstrap index from server: connect timed out -> [Help 1]
2021-04-08T07:08:42.3564169Z org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar (default-cli) on project ms-waynemo-asset-service: Unable to execute SonarScanner analysis
2021-04-08T07:08:42.3567646Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
2021-04-08T07:08:42.3569616Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2021-04-08T07:08:42.3570597Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2021-04-08T07:08:42.3574113Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2021-04-08T07:08:42.3575281Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2021-04-08T07:08:42.3577349Z     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2021-04-08T07:08:42.3578846Z     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2021-04-08T07:08:42.3580647Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2021-04-08T07:08:42.3581762Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2021-04-08T07:08:42.3582685Z     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2021-04-08T07:08:42.3583857Z     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2021-04-08T07:08:42.3584860Z     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2021-04-08T07:08:42.3586563Z     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2021-04-08T07:08:42.3587396Z     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2021-04-08T07:08:42.3589554Z     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
2021-04-08T07:08:42.3592072Z     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2021-04-08T07:08:42.3592526Z     at java.lang.reflect.Method.invoke (Method.java:498)
2021-04-08T07:08:42.3594376Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2021-04-08T07:08:42.3595366Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2021-04-08T07:08:42.3597929Z     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2021-04-08T07:08:42.3598437Z     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2021-04-08T07:08:42.3600652Z Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute SonarScanner analysis
2021-04-08T07:08:42.3606732Z     at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
2021-04-08T07:08:42.3607592Z     at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
2021-04-08T07:08:42.3608239Z     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2021-04-08T07:08:42.3609545Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2021-04-08T07:08:42.3612170Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2021-04-08T07:08:42.3613080Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2021-04-08T07:08:42.3615001Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2021-04-08T07:08:42.3617546Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2021-04-08T07:08:42.3619636Z     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2021-04-08T07:08:42.3620260Z     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2021-04-08T07:08:42.3624040Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2021-04-08T07:08:42.3624499Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2021-04-08T07:08:42.3624923Z     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2021-04-08T07:08:42.3625355Z     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2021-04-08T07:08:42.3627040Z     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2021-04-08T07:08:42.3627945Z     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2021-04-08T07:08:42.3630053Z     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2021-04-08T07:08:42.3631234Z     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
2021-04-08T07:08:42.3632705Z     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2021-04-08T07:08:42.3633966Z     at java.lang.reflect.Method.invoke (Method.java:498)
2021-04-08T07:08:42.3636235Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2021-04-08T07:08:42.3637430Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2021-04-08T07:08:42.3640269Z     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2021-04-08T07:08:42.3640773Z     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2021-04-08T07:08:42.3643149Z Caused by: org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
2021-04-08T07:08:42.3645957Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0 (IsolatedLauncherFactory.java:85)
2021-04-08T07:08:42.3649509Z     at java.security.AccessController.doPrivileged (Native Method)
2021-04-08T07:08:42.3650900Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:74)
2021-04-08T07:08:42.3651529Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:70)
2021-04-08T07:08:42.3653221Z     at org.sonarsource.scanner.api.EmbeddedScanner.doStart (EmbeddedScanner.java:185)
2021-04-08T07:08:42.3657692Z     at org.sonarsource.scanner.api.EmbeddedScanner.start (EmbeddedScanner.java:123)
2021-04-08T07:08:42.3658227Z     at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:56)
2021-04-08T07:08:42.3658753Z     at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
2021-04-08T07:08:42.3661432Z     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2021-04-08T07:08:42.3661980Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2021-04-08T07:08:42.3663505Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2021-04-08T07:08:42.3666081Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2021-04-08T07:08:42.3670463Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2021-04-08T07:08:42.3671055Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2021-04-08T07:08:42.3671822Z     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2021-04-08T07:08:42.3673579Z     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2021-04-08T07:08:42.3674814Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2021-04-08T07:08:42.3677323Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2021-04-08T07:08:42.3677773Z     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2021-04-08T07:08:42.3679075Z     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2021-04-08T07:08:42.3679859Z     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2021-04-08T07:08:42.3681299Z     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2021-04-08T07:08:42.3683121Z     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2021-04-08T07:08:42.3684517Z     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
2021-04-08T07:08:42.3685680Z     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2021-04-08T07:08:42.3687289Z     at java.lang.reflect.Method.invoke (Method.java:498)
2021-04-08T07:08:42.3688644Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2021-04-08T07:08:42.3690476Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2021-04-08T07:08:42.3692384Z     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2021-04-08T07:08:42.3694025Z     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2021-04-08T07:08:42.3695023Z Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
2021-04-08T07:08:42.3699155Z     at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex (BootstrapIndexDownloader.java:42)
2021-04-08T07:08:42.3700305Z     at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles (JarDownloader.java:58)
2021-04-08T07:08:42.3702217Z     at org.sonarsource.scanner.api.internal.JarDownloader.download (JarDownloader.java:53)
2021-04-08T07:08:42.3704334Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0 (IsolatedLauncherFactory.java:76)
2021-04-08T07:08:42.3705351Z     at java.security.AccessController.doPrivileged (Native Method)
2021-04-08T07:08:42.3707659Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:74)
2021-04-08T07:08:42.3710245Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:70)
2021-04-08T07:08:42.3712277Z     at org.sonarsource.scanner.api.EmbeddedScanner.doStart (EmbeddedScanner.java:185)
2021-04-08T07:08:42.3712776Z     at org.sonarsource.scanner.api.EmbeddedScanner.start (EmbeddedScanner.java:123)
2021-04-08T07:08:42.3715076Z     at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:56)
2021-04-08T07:08:42.3716600Z     at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
2021-04-08T07:08:42.3718713Z     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2021-04-08T07:08:42.3720193Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2021-04-08T07:08:42.3721436Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2021-04-08T07:08:42.3724071Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2021-04-08T07:08:42.3725305Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2021-04-08T07:08:42.3729883Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2021-04-08T07:08:42.3730485Z     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2021-04-08T07:08:42.3731064Z     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2021-04-08T07:08:42.3745819Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2021-04-08T07:08:42.3746323Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2021-04-08T07:08:42.3752420Z     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2021-04-08T07:08:42.3752901Z     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2021-04-08T07:08:42.3753302Z     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2021-04-08T07:08:42.3753694Z     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2021-04-08T07:08:42.3754073Z     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2021-04-08T07:08:42.3754488Z     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
2021-04-08T07:08:42.3754960Z     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2021-04-08T07:08:42.3755401Z     at java.lang.reflect.Method.invoke (Method.java:498)
2021-04-08T07:08:42.3755869Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2021-04-08T07:08:42.3756338Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2021-04-08T07:08:42.3756819Z     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2021-04-08T07:08:42.3757291Z     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2021-04-08T07:08:42.3757710Z Caused by: java.net.SocketTimeoutException: connect timed out
2021-04-08T07:08:42.3758112Z     at java.net.DualStackPlainSocketImpl.waitForConnect (Native Method)
2021-04-08T07:08:42.3766242Z     at java.net.DualStackPlainSocketImpl.socketConnect (DualStackPlainSocketImpl.java:85)
2021-04-08T07:08:42.3769482Z     at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:350)
2021-04-08T07:08:42.3770485Z     at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:206)
2021-04-08T07:08:42.3771573Z     at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:188)
2021-04-08T07:08:42.3772509Z     at java.net.PlainSocketImpl.connect (PlainSocketImpl.java:172)
2021-04-08T07:08:42.3773423Z     at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:392)
2021-04-08T07:08:42.3774528Z     at java.net.Socket.connect (Socket.java:607)
2021-04-08T07:08:42.3775406Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.platform.Platform.connectSocket (Platform.java:130)
2021-04-08T07:08:42.3776770Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket (RealConnection.java:263)
2021-04-08T07:08:42.3778063Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connect (RealConnection.java:183)
2021-04-08T07:08:42.3779057Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findConnection (ExchangeFinder.java:224)
2021-04-08T07:08:42.3781179Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findHealthyConnection (ExchangeFinder.java:108)
2021-04-08T07:08:42.3781865Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.find (ExchangeFinder.java:88)
2021-04-08T07:08:42.3788788Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.Transmitter.newExchange (Transmitter.java:169)
2021-04-08T07:08:42.3789425Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:41)
2021-04-08T07:08:42.3790169Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:142)
2021-04-08T07:08:42.3792883Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:117)
2021-04-08T07:08:42.3793525Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:94)
2021-04-08T07:08:42.3797037Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:142)
2021-04-08T07:08:42.3799529Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:117)
2021-04-08T07:08:42.3801058Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
2021-04-08T07:08:42.3803617Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:142)
2021-04-08T07:08:42.3808061Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:88)
2021-04-08T07:08:42.3808756Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:142)
2021-04-08T07:08:42.3811266Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:117)
2021-04-08T07:08:42.3814417Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain (RealCall.java:221)
2021-04-08T07:08:42.3815005Z     at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute (RealCall.java:81)
2021-04-08T07:08:42.3816931Z     at org.sonarsource.scanner.api.internal.ServerConnection.callUrl (ServerConnection.java:115)
2021-04-08T07:08:42.3818567Z     at org.sonarsource.scanner.api.internal.ServerConnection.downloadString (ServerConnection.java:99)
2021-04-08T07:08:42.3820381Z     at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex (BootstrapIndexDownloader.java:39)
2021-04-08T07:08:42.3822311Z     at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles (JarDownloader.java:58)
2021-04-08T07:08:42.3826532Z     at org.sonarsource.scanner.api.internal.JarDownloader.download (JarDownloader.java:53)
2021-04-08T07:08:42.3827116Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0 (IsolatedLauncherFactory.java:76)
2021-04-08T07:08:42.3828515Z     at java.security.AccessController.doPrivileged (Native Method)
2021-04-08T07:08:42.3830525Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:74)
2021-04-08T07:08:42.3832165Z     at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher (IsolatedLauncherFactory.java:70)
2021-04-08T07:08:42.3833583Z     at org.sonarsource.scanner.api.EmbeddedScanner.doStart (EmbeddedScanner.java:185)
2021-04-08T07:08:42.3834933Z     at org.sonarsource.scanner.api.EmbeddedScanner.start (EmbeddedScanner.java:123)
2021-04-08T07:08:42.3837956Z     at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:56)
2021-04-08T07:08:42.3838477Z     at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
2021-04-08T07:08:42.3844486Z     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2021-04-08T07:08:42.3845035Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2021-04-08T07:08:42.3845632Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2021-04-08T07:08:42.3846104Z     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2021-04-08T07:08:42.3847557Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2021-04-08T07:08:42.3849207Z     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2021-04-08T07:08:42.3851386Z     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2021-04-08T07:08:42.3854511Z     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2021-04-08T07:08:42.3854992Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2021-04-08T07:08:42.3856441Z     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2021-04-08T07:08:42.3868502Z     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2021-04-08T07:08:42.3868948Z     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2021-04-08T07:08:42.3869354Z     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2021-04-08T07:08:42.3869750Z     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2021-04-08T07:08:42.3870111Z     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2021-04-08T07:08:42.3870530Z     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
2021-04-08T07:08:42.3871012Z     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2021-04-08T07:08:42.3871435Z     at java.lang.reflect.Method.invoke (Method.java:498)
2021-04-08T07:08:42.3871863Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2021-04-08T07:08:42.3872380Z     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2021-04-08T07:08:42.3872844Z     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2021-04-08T07:08:42.3873338Z     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2021-04-08T07:08:42.3873668Z [ERROR] 
2021-04-08T07:08:42.3873887Z [ERROR] 
2021-04-08T07:08:42.3875665Z [ERROR] For more information about the errors and possible solutions, please read the following articles:
2021-04-08T07:08:42.3877885Z [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

When I enter the URL in a browser, from the same machine, it returns the information about the bootstrapper. I’m also able to download the jar file mentioned in the return.

Before the analysis, maven is also able to download the necessary plugins and packages from other URL’s, so i suspect the proxy is configured correctly.

Any ideas where to search?

Hey there.

It sounds like it could be an issue at the Java layer. What flavor/version of Java is being used to execute Maven?

I’ve tried different:
Java version: 11.0.2
Java version: 1.8.0_282 (ojdkbuild)

And for Maven:
Apache Maven 3.6.3

Thanks.

I would suggest taking Maven out of the equation entirely, and try out a tool like MichalHecko/SSLPoke to see if you can establish a connection to SonarCloud (and what configuration of proxy settings or keystores passed as Java options make it work / do not work). This should help narrow down where the issue is (if those flavors of Java work straight away, the issue is probably somewhere else).

At least that is not connecting straight away…

         java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:607)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:284)
        at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:143)
        at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
        at sk.mhecko.ssl.SSLPoke.main(SSLPoke.java:21)

Turns out that the requests to sonarcloud.io from within that maven task are not coming through the proxy.

I don’t understand why, as other actions from within the same build and job in the Azure DevOps maven task (getting the packages and plugins) are going through the proxy.

I tried passing the proxy settings in different ways, but only one seems to be working:

  • As part of JAVA_OPTS environment variable
  • As part of MAVEN_OPTS environment variable
  • As part of SONAR_SCANNER_OPTS environment variable
  • As part of the maven settings.xml (in mavens conf folder)
  • As part of the users maven settings (in users .m2 folder)
  • As part of the command line options (passing -Dhttps.proxyHost and -Dhttps.proxyPort)

Only the last one seems to work.