Gradle 2.11-rc-1 is now available for testing

Gradle 2.11-rc-1 is now available for testing

This release delivers significant improvements to the new software model, together with improvements to IDE integration and continuous build.

The software model is the future of Gradle. The core software model is the basis of the native language and Play framework support in Gradle, and we are working intensively to bring full Java support. With this release, the new Java plugins support testing with JUnit and do a better job in compile avoidance. As well as developing our Java support, we continue to invest in the software model infrastructure, so support for developing any plugin with the new software model also got better.

Existing Java projects also benefit from Gradle 2.11. Improved IDE integration means that developing a Gradle project in IntelliJ IDEA or Eclipse is even better, with fewer tweaks to the IDE configuration required. These improvements encompass both the generated project files and the Tooling API used by IDEs to import Gradle projects.

By detecting changes that occur during build execution, Continuous build has become more dependable. We encourage users to try out this cool feature, which can really enhance the development experience with Gradle.

In addition to these features, Gradle continues to improve with a variety of small improvements and bug fixes. Check the release notes release notes for more information.

Downloads and wrapper usage instructions are available at http://gradle.org/release-candidate. Please try Gradle 2.11-rc-1 with your projects and report any problems.

This topic is now a banner. It will appear at the top of every page until it is dismissed by the user.

Everything fine with the usual three projects.
Except the stuff mentioned here but I didn’t expect it to be fixed since we couldn’t pinpoint the problem so far.

We’re seeing something really strange. We used to have rare problems due to “failed to initialize ssl context” (probably GRADLE-3029) so we were really looking forward to Gradle 2.11, but after upgrading to 2.11-rc-1 we’re seeing something even more strange:

Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'http://artifactory.xxx/artifactory/repo/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.pom'.
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:72)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:58)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:62)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:51)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:34)
    at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.openResource(DefaultExternalResourceConnector.java:41)
    at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.openResource(ProgressLoggingExternalResourceAccessor.java:36)
    at org.gradle.internal.resource.transport.DefaultExternalResourceRepository.getResource(DefaultExternalResourceRepository.java:63)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:75)
    at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadStaticResource(DefaultExternalResourceArtifactResolver.java:90)
    ... 82 more
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
    at sun.security.ssl.InputRecord.read(InputRecord.java:527)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:388)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:102)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:79)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:70)
    ... 91 more

For some bizarre reason it seems like Gradle / HttpClient is trying to talk https over a plain old http connection to our in-house Artifactory service.

The HttpClient implementation isn’t that clever, it just looks at the scheme (i.e. https://) to figure out whether to create a secured socket connection or not. If you are configuring your repository with an unsecure (i.e. http://) scheme then perhaps some redirection is happening. Can you try running the build with --debug to see if that provides some more useful information?

That is the bizarre part, if you look at the stacktrace the scheme is plain old http!

Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'http://artifactory.xxx/artifactory/repo/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.pom'.

But I’ll try with --debug tomorrow to see if that reveals anything of interest.

This is the requested URL so it’s not necessarily the URL of the actual request that is blowing up. That statement is being logged by Gradle but there could be a redirect buried under there in the HttpClient code.

You are right, from the output it looks like the service supports NTLM and it tries to use that over the insecure basic http auth. Forcing Gradle / HttpClient to use basic http auth seems to be working fine.

I have same issue…
my gradle.build plugin section:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'ru.yandex.qatools.allure:allure-bundle:1.5.0-RC1'
    }
}

plugins {
    id 'java'
    id 'com.terrafolio.jenkins' version '1.3.1'
}
23:09:23.487 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
23:09:23.643 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Shutdown connection
23:09:23.643 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
23:09:23.643 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-0: Close connection
23:09:23.659 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 0][route: {tls}->https://proxy:8080->https://plugins.gradle.org:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
23:09:23.659 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 1.079 secs
23:09:23.659 [ERROR] [org.gradle.BuildExceptionReporter] 
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] 
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] Build file...
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] 
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] Error resolving plugin [id: 'com.terrafolio.jenkins', version: '1.3.1']
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] > Could not GET 'https://plugins.gradle.org/api/gradle/2.11-rc-1/plugin/use/com.terrafolio.jenkins/1.3.1'.
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter]    > Unrecognized SSL message, plaintext connection?
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] 
23:09:23.674 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.GradleException: Error resolving plugin [id: 'com.terrafolio.jenkins', version: '1.3.1']
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:190)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$000(DefaultPluginRequestApplicator.java:44)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:67)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:65)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:187)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:182)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:65)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:132)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:521)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:92)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:33)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.Factories$1.create(Factories.java:22)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
23:09:23.690 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.util.Swapper.swap(Swapper.java:38)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
23:09:23.705 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://plugins.gradle.org/api/gradle/2.11-rc-1/plugin/use/com.terrafolio.jenkins/1.3.1'.
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getRawResource(HttpResourceAccessor.java:74)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.request(HttpPluginResolutionServiceClient.java:86)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.queryPluginMetadata(HttpPluginResolutionServiceClient.java:66)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:60)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:58)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.fetch(PersistentCachingPluginResolutionServiceClient.java:110)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:103)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:91)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.queryPluginMetadata(PersistentCachingPluginResolutionServiceClient.java:67)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:47)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:45)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.getResponse(InMemoryCachingPluginResolutionServiceClient.java:76)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.queryPluginMetadata(InMemoryCachingPluginResolutionServiceClient.java:42)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.DeprecationListeningPluginResolutionServiceClient.queryPluginMetadata(DeprecationListeningPluginResolutionServiceClient.java:48)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.service.internal.PluginResolutionServiceResolver.resolve(PluginResolutionServiceResolver.java:84)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.internal.CompositePluginResolver.resolve(CompositePluginResolver.java:33)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.resolve.internal.NotNonCorePluginOnClasspathCheckPluginResolver.resolve(NotNonCorePluginOnClasspathCheckPluginResolver.java:42)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:188)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	... 62 more
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:388)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:102)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getRawResource(HttpResourceAccessor.java:72)
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 	... 79 more
23:09:23.721 [ERROR] [org.gradle.BuildExceptionReporter] 
23:09:23.721 [LIFECYCLE] [org.gradle.BuildResultLogger] 
23:09:23.721 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
23:09:23.737 [LIFECYCLE] [org.gradle.BuildResultLogger] 
23:09:23.737 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 12.61 secs

After it i try set up new certificate https://plugins.gradle.org/ (valid from 04/01/2016) to JVM, but it not resolve this error. Revert back to gradle v2.10 solve it.

@admizh In this release we upgraded HttpClient that is used internally to download dependencies. It could be either a regression in HttpClient or something wrong with your local configuration that didn’t make the previous version of HttpClient fail. Are you behind a proxy? If yes, could you verify how you configure it?

@kimbetti Could you clarify your answer? I understand that you confirmed that there is an HTTPS request under the hood. Are you also saying that you are forcing basic HTTP authentication in your build script? Did that work with your Artifactory service before Gradle upgrade? We have another user reporting similar issue so it would be really helpful if you provided more information.

@admizh @kimbetti We also made a potentially breaking change when upgrading HttpClient. Previously we created HttpClient in a way that took into account all system properties supported by the library. We are now selective about what system properties are taken into account. For example, properties related to proxy configuration are still supported. Could you verify if you are using any other system properties to configure the connection?

It could also help to know what operating system you are using.

@admizh The change here in 2.11 is that now proxy settings are being used for plugin portal resolution. It sounds like you might be trying to use an HTTP proxy to access an HTTPS URL.

I have to admit that I’m really not sure what exactly is going on as I’ve not had much time to look into this problem today. To me it looks like Gradle / HttpClient is trying to open a secure socket to a plain http proxy.

With these settings in gradle.properties does work with Gradle 2.10, nothing has changed in our environment.

systemProp.http.proxyHost=proxy.com
systemProp.http.proxyPort=8100
systemProp.https.proxyHost=proxy.com
systemProp.https.proxyPort=8100

Here is what I’ve tried:

a) Commenting out the https properties above and forcing Gradle / HttpClient to use Basic Auth when talking to Artifactory. This solved the artifact download issue.

authentication {
    basic(BasicAuthentication)
}

At this point I have to admit to being pretty pleased with myselv, but it only took an hour before someone realized that it broke the Gradle Wrapper download (that obviously stopped working without the https properties mentioned above).

b) Enabling the https proxy properties again fixes the Gradle Wrapper download, but breaks integration with Artifactory. So I’m stuck between a rock and a hard place.

I don’t know enough about how Java / HttpClient works with proxies and TLS connections, but based on the output below I’m inclined to believe that for some reason it prefers to open a secure socket if it finds https proxy settings regardless of the scheme of the target uri.

build	28-Jan-2016 10:29:00	09:28:56.534 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: http://artifactory.zzz/artifactory/repo/io/dropwizard/dropwizard-core/0.8.4/dropwizard-core-0.8.4.pom
build	28-Jan-2016 10:29:00	09:28:56.535 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: http://artifactory.zzz/artifactory/repo/com/google/guava/guava/18.0/guava-18.0.pom
build	28-Jan-2016 10:29:00	09:28:56.536 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: http://artifactory.zzz/artifactory/repo/com/fasterxml/jackson/core/jackson-annotations/2.5.1/jackson-annotations-2.5.1.pom
build	28-Jan-2016 10:29:00	09:28:56.728 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientConfigurer] Using Credentials [username: ***] for authenticating against 'null:-1' using Basic
build	28-Jan-2016 10:29:00	09:28:56.735 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientConfigurer] Using Credentials [username: ***] for authenticating against 'null:-1' using Basic
build	28-Jan-2016 10:29:00	09:28:56.735 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientConfigurer] Using Credentials [username: ***] for authenticating against 'null:-1' using Basic
build	28-Jan-2016 10:29:00	09:28:56.838 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
build	28-Jan-2016 10:29:00	09:28:56.842 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
build	28-Jan-2016 10:29:00	09:28:56.842 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
build	28-Jan-2016 10:29:00	09:28:56.852 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
build	28-Jan-2016 10:29:00	09:28:56.853 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {}->https://proxy.zzz.no:8100->http://artifactory.zzz.no:80][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]

Look closely at the last line…

And again, our setup works with Gradle 2.10 (well, apart from GRADLE-3029) so something in Gradle or bundled with Gradle must have changed.

I think I found the broken code:

If it find configuration for an https proxy it will never use http regardless of the resource being requested.

1 Like

You are correct, this is the problem. We are working on a fix for this now which will go back to the old behavior of using the HTTP proxy for HTTP requests and HTTPS proxy for HTTPS requests. We will release 2.11-rc-2 when this is completed.

1 Like

@kimbetti @admizh

Would you guys be able to try out a snapshot? We’ll be rolling this into a 2.11-rc-2 release next week.

You can switch to it with:
./gradlew wrapper --gradle-version=2.11-20160130232115+0000

We were incorrectly using https.proxyHost and https.proxyPort for http requests and overriding any specified http.proxyHost or http.proxyPort options (if http_s_ options were also supplied).

I’ve added some more test coverage for this, but it would be great to know if this solved your problems too.

Just ran a couple of builds. Looks good!

This topic is no longer a banner. It will no longer appear at the top of every page.