Issues in downloading Dependency

buildship

(Aneez) #1

Whenever I run my gradle and it tries to download dependencies, I end up with the following stack trace

Caused by: java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at org.gradle.internal.resource.transport.http.HttpClientConfigurer.configureSslSocketConnectionFactory(HttpClientConfigurer.java:80)
at org.gradle.internal.resource.transport.http.HttpClientConfigurer.configure(HttpClientConfigurer.java:70)
at org.gradle.internal.resource.transport.http.HttpClientHelper.getClient(HttpClientHelper.java:123)
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)

And this happens only when my gradle downloads any of the dependencies. Can anyone tell me whats going wrong. PFB my build.gradle

buildscript {
ext {
springBootVersion = ‘1.2.2.RELEASE’
}
repositories {
mavenCentral()
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
}
}

repositories {
mavenCentral()
maven { url ‘http://maven.vaadin.com/vaadin-addons’ }
}

apply plugin: 'java’
apply plugin: 'org.springframework.boot’
apply plugin: ‘war’

jar {
baseName = 'viralheat’
version = ‘0.0.1-SNAPSHOT’
}

sourceCompatibility = 1.8

dependencies {
compile(‘com.vaadin:vaadin-spring-boot-starter:1.2.0’)
compile(‘org.vaadin.teemusa:sidemenu:1.0’)
compile(‘org.hibernate:hibernate-core:5.1.0.Final’)
compile(‘org.hibernate:hibernate-c3p0:5.1.0.Final’)
compile(‘org.springframework:spring-orm:4.3.1.RELEASE’)
compile(‘org.projectlombok:lombok:1.12.2’)
runtime(‘mysql:mysql-connector-java’)
testCompile(‘org.springframework.boot:spring-boot-starter-test’)
}

dependencyManagement {
imports {
mavenBom “com.vaadin:vaadin-bom:7.7.7”
}
}


(Daniel Lacasse) #2

Hi Aneez,

Could you provide a bit more information regarding what version of Gradle you are using? If you could give us an build scan, it would be a lot easier to debug as it contains all the required information.

Daniel


(Aneez) #3

Hi Daniel.,
Solved the issue. It was because I was using older version of java, which had an incompatabile httpcomponents jar. It worked fine when I switched to the latest version of java.

Aneez