I am new to gradle and I am building a project in it.Now I want to import a maven dependency from local repo into my gradle project .So the path to my local repo is like
Users/test/.m2/org/springframework/spring-jdbc/4.3.8.RELEASE
So what I have tried is
maven{
url uri('/Users/test/.m2/repository')
}
repositories {
mavenLocal()
mavenCentral()
}
and
My build.gradle
buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'com.smudmmlta.dgs'
version = '1.0'
sourceCompatibility = 1.8
maven{
url uri('/Users/test/.m2/repository')
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
testCompile('org.springframework.boot:spring-boot-starter-test')
compile('org.springframework.dao')
compile('com.zaxxer:HikariCP:2.7.6')
compile('org.mindrot:jbcrypt:0.4')
compile('org.springframework:spring-jdbc')
}
After this still the program throws error as below:
import org.springframework.jdbc.core.JdbcTemplate;
The import org.springframework.jdbc cannot be resolved
because of unresolved dependencies. Any help is appreciated.
EDIT I also changed this part to be like
repositories {
mavenLocal()
mavenCentral()
maven{
url uri('/Users/test/.m2/repository')
}
}