My project structure has 2 levels in intellij using gradle wrapper.
My lower level project has dependence
org.springframework.data:spring-data-elasticsearch:1.3.4.RELEASE
which comes with elasticsearch 1.5.2
I exclude elasticsearch 1.5.2 and manually include 2.0.0
all is working fine.
build.gradle
group 'com.ohmyapp'
version '1.0-SNAPSHOT'
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile ("org.springframework.data:spring-data-jpa:1.9.2.RELEASE")
compile ("org.springframework.data:spring-data-elasticsearch:1.3.4.RELEASE") {
exclude module: 'elasticsearch'
}
compile 'org.elasticsearch:elasticsearch:2.0.0'
}
When I include this project as a compile dependence
dependencies {
compile project(':module1')
compile 'org.springframework.boot:spring-boot-starter:1.3.1.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
elasticsearch 2.0.0 is correctly pulled in.
When I apply spring-boot plugin, elasticsearch 1.5.2 comes back. What is the problem here?
build.gradle
group 'com.ohmyapp'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'spring-boot'
buildscript {
repositories {
mavenCentral()
jcenter()
maven {url 'https://plugins.gradle.org/m2'}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE'
}
}
repositories {
mavenCentral()
}
dependencies {
compile project(':module1')
compile 'org.springframework.boot:spring-boot-starter:1.3.1.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.11'
}