Gradle IntelliJ not able to resolve the correct dependency

Hi,

Im using spring boot 1.5.6 and here is my dependencies

compile group: 'org.elasticsearch.client', name: 'transport', version: '5.5.1'
compile group: 'org.elasticsearch', name: 'elasticsearch', version: '5.5.1'

when I check the dependency tree I have

+--- org.elasticsearch.client:transport:5.5.1
|    +--- org.elasticsearch:elasticsearch:5.5.1
|    |    +--- org.apache.lucene:lucene-core:6.6.0
|    |    +--- org.apache.lucene:lucene-analyzers-common:6.6.0
|    |    +--- org.apache.lucene:lucene-backward-codecs:6.6.0

However when I try to check the dependency tree when I have the following dependencies

compile group: 'org.elasticsearch.client', name: 'transport', version: '5.5.1'

I get the following in the dependecy tree

 +--- org.elasticsearch.client:transport:5.5.1
|    +--- org.elasticsearch:elasticsearch:5.5.1 -> 2.4.5
|    |    +--- org.apache.lucene:lucene-core:5.5.4
|    |    +--- org.apache.lucene:lucene-backward-codecs:5.5.4
|    |    |    \--- org.apache.lucene:lucene-core:5.5.4

But the elasticsearch client has a dependency of elasticsearch 5.5.1 so I need not add the core dependency

https://mvnrepository.com/artifact/org.elasticsearch.client/transport/5.5.1

When I add compile group: ‘org.elasticsearch’, name: ‘elasticsearch’, version: '5.5.1’
it works perfectly, it should have worked even without adding it , Can some one tell me where I am going wrong ?
I tried to remove the ~/.gradle/caches folder as well, it did not help