Solving dependency conflict

There seems to be a dependency conflict on dep “org.javassist”. Have declared latest version within build.gradle file, excluded old version from dependency org.thymeleaf:thymeleaf.

The WAR file still have both versions of dependency (javassist-3.11.0.GA.jar & javassist-3.19.0-GA.jar) in the META-INF/lib directory.

The dependency conflict is likely to be the cause of the error (see stacktrace).

gradle dependencyInsight --dependency javassist output

gradle dependencyInsight --configuration compile --dependency org.javassist
:dependencyInsight
org.javassist:javassist:3.19.0-GA (conflict resolution)
\--- compile

org.javassist:javassist:3.16.1-GA -> 3.19.0-GA
\--- org.thymeleaf:thymeleaf:2.1.4.RELEASE
     +--- compile
     +--- org.thymeleaf:thymeleaf-spring4:2.1.4.RELEASE
     |    +--- compile
     |    \--- org.thymeleaf.extras:thymeleaf-extras-tiles2-spring4:2.1.1.RELEASE
     |         \--- compile
     +--- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:1.2.2
     |    \--- compile
     +--- org.thymeleaf.extras:thymeleaf-extras-tiles2:2.1.1.RELEASE
     |    +--- compile
     |    \--- org.thymeleaf.extras:thymeleaf-extras-tiles2-spring4:2.1.1.RELEASE (*)
     +--- org.thymeleaf.extras:thymeleaf-extras-tiles2-spring4:2.1.1.RELEASE (*)
     \--- org.thymeleaf.extras:thymeleaf-extras-springsecurity3:2.1.2.RELEASE
          \--- compile

org.javassist:javassist:3.18.1-GA -> 3.19.0-GA
+--- org.glassfish.hk2:hk2-locator:2.4.0-b10
|    +--- org.glassfish.jersey.core:jersey-common:2.17
|    |    +--- org.glassfish.jersey.connectors:jersey-apache-connector:2.17
|    |    |    \--- compile
|    |    \--- org.glassfish.jersey.core:jersey-client:2.17
|    |         \--- org.glassfish.jersey.connectors:jersey-apache-connector:2.17 (*)
|    \--- org.glassfish.jersey.core:jersey-client:2.17 (*)
+--- org.hibernate:hibernate-core:4.3.6.Final
|    \--- org.hibernate:hibernate-entitymanager:4.3.6.Final
|         +--- compile
|         \--- org.jadira.usertype:usertype.core:3.2.0.GA
|              \--- compile
\--- org.hibernate:hibernate-entitymanager:4.3.6.Final (*)

(*) - dependencies omitted (listed previously)

buld.gradle

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
apply plugin: 'tomcat'
version = '1.0'
group = 'com.foo'

description = "..."

sourceCompatibility = 1.8
targetCompatibility = 1.8


buildscript {
    repositories { 
        jcenter()
       //mavenLocal()
        //mavenCentral()
    }

    dependencies {
        classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:0.9.9'
    }
}

war {baseName = 'com.foo'}


dependencies {
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
            "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
    tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
        exclude group: "org.eclipse.jdt.core.compiler", module: "ecj"
    }
	compile "com.github.kstyrc:embedded-redis:$embeddedRedisVersion"
    compile ("org.springframework:spring-context:$springVersion"){
    	exclude group: "commons-logging", module: "commons-logging"
    }
    compile "org.springframework:spring-orm:$springVersion"
    compile "org.springframework.amqp:spring-rabbit:$springRabbitVersion"
    compile "org.springframework:spring-jdbc:$springVersion"
    compile "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
    compile "org.springframework:spring-tx:$springVersion"
    compile "org.springframework:spring-web:$springVersion"
    compile "org.springframework:spring-webmvc:$springVersion"
    compile "org.springframework:spring-test:$springVersion"
    
    compile "org.springframework.security:spring-security-config:$springSecurityVersion"
    compile "org.springframework.security:spring-security-web:$springSecurityVersion"
    compile "org.springframework.security:spring-security-crypto:$springSecurityVersion"
    compile "org.springframework.security:spring-security-core:$springSecurityVersion"
    compile "org.springframework.security:spring-security-taglibs:$springSecurityVersion"
    compile "org.springframework.security:spring-security-crypto:$springSecurityVersion"

    compile "org.springframework.social:spring-social-config:$springSocialVersion"
    compile "org.springframework.social:spring-social-core:$springSocialVersion"
    compile "org.springframework.social:spring-social-web:$springSocialVersion"
    compile "org.springframework.social:spring-social-security:$springSocialVersion"
    compile "org.springframework.social:spring-social-facebook:$springSocialFacebookVersion"
    compile "org.springframework.social:spring-social-facebook-web:$springSocialFacebookVersion"
    compile "org.springframework.social:spring-social-twitter:$springSocialTwitterVersion"
    compile "org.springframework.social:spring-social-linkedin:$springSocialLinkedInVersion"
    compile "org.springframework.social:spring-social-yahoo:$springSocialYahooVersion"
	

    compile "org.apache.httpcomponents:httpclient:$httpclientVersion"
    compile "javax.validation:validation-api:$javaxValidationVersion"
    compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
    compile "org.slf4j:slf4j-api:$slf4jVersion"
    compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
    compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
    compile "log4j:log4j:$log4jVersion"
    compile "com.h2database:h2:$h2Version"
    compile "cglib:cglib-nodep:$cglibVersion"
    compile "javax.inject:javax.inject:$javaxInjectVersion"
    compile "commons-codec:commons-codec:$commonsCodecVersion"
    compile "org.apache.tiles:tiles-api:$tilesCoreVersion"
    compile "org.apache.tiles:tiles-core:$tilesCoreVersion"
    
    compile "org.apache.tiles:tiles-extras:$tilesCoreVersion"
    
    compile "org.apache.tiles:tiles-template:$tilesCoreVersion"
    compile "org.apache.tiles:tiles-servlet:$tilesServletVersion"
    compile "com.google.guava:guava:$guavaVersion"
    compile "org.hibernate:hibernate-entitymanager:$hibernateEntityManagerVersion"
    compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
    compile "commons-lang:commons-lang:$commonsLangVersion"
    compile "commons-io:commons-io:$commonsIOVersion"
    compile "org.jadira.usertype:usertype.core:$usertypeCoreVersion"
    compile "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:$persistenceApiVersion"
    compile "org.javassist:javassist:$javassistVersion"
    compile "com.fasterxml.jackson.datatype:jackson-datatype-hibernate4:$jacksonDataTypeHibernateVersion"
    compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jacksonDataTypeJodaVersion"
    compile "mysql:mysql-connector-java:$mysqlConnectorVersion"
    compile "javax.servlet:jstl:$jstlVersion"
    compile "org.apache.tiles:tiles-request-api:$tilesRequestApiVersion"
    compile "org.apache.commons:commons-digester3:$commonsDigester3Version"
    compile "commons-beanutils:commons-beanutils:$commonsBeanutilsVersion"
    
    compile "org.springframework:spring-aop:$springVersion"
    compile "org.quartz-scheduler:quartz:$quartzVersion"
    compile "org.springframework:spring-context-support:$springVersion"    
    providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"    
 	compile "javax.validation:validation-api:$validationApiVersion"
    
    compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
    compile "org.aspectj:aspectjrt:$aspectjrtVersion"
    
    compile("ch.qos.logback:logback-classic:$logbackClassicVersion"){
    	exclude group: "javax.mail", module: "mail"
    	exclude group: "javax.jms", module: "jms"
    	exclude group: "com.sun.jdmk", module: "jmxtools"
    	exclude group: "com.sun.jmx", module: "jmxri"
    }
    
    compile "org.springframework:spring-aspects:$springAspectsVersion"
    compile ("org.thymeleaf:thymeleaf:$thymeleafVersion"){
        exclude group: "org.javassist", module: "javassist"
    }
    compile "org.thymeleaf:thymeleaf-spring4:$thymeleafVersion"
    compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:$thymeleafLayoutVersion"
    compile "org.thymeleaf.extras:thymeleaf-extras-tiles2:$thymeleafExtrasTiles2Version"
    compile "org.thymeleaf.extras:thymeleaf-extras-tiles2-spring4:$thymeleafExtrasTiles2Spring4Version"
    compile "org.thymeleaf.extras:thymeleaf-extras-springsecurity3:$thymeleafExtrasSpringSecurity3Version"

    compile "org.apache.tiles:tiles-core:$tilesCoreVersion"
    compile "org.apache.tiles:tiles-servlet:$tilesServletVersion"
    compile "org.springframework.webflow:spring-js:$springJsVersion"
    compile "joda-time:joda-time:$jodaTimeVersion"
    compile "joda-time:joda-time-hibernate:$jodaTimeHibernateVersion"
    compile "joda-time:joda-time-jsptags:$jodaTimeJspTagsVersion"
    compile "org.jadira.usertype:usertype.core:$usertypeCoreVersion"
    compile "com.rosaloves:bitlyj:$bitlyjVersion"
    compile "org.mockito:mockito-core:$mockitoCoreVersion"
    compile "org.apache.commons:commons-pool2:$commonsPool2Version"
    compile "org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion"   
    compile "net.sf.ehcache:ehcache-core:$ehcacheCoreVersion"
    
    compile "org.springframework.data:spring-data-redis:$springDataRedisVersion"
    compile "org.springframework.data:spring-data-solr:$springDataSolrVersion"
    compile "org.glassfish.jersey.connectors:jersey-apache-connector:$jerseyApacheConnectorVersion"
    compile "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
    compile "dbunit:dbunit:$dbunitVersion"
    compile "org.apache.poi:poi:$poiVersion"
	compile "com.h2database:h2:$h2Version"
	compile "org.javassist:javassist:$javsistVersion"
	compile "redis.clients:jedis:$jedisVersion"
	compile "mysql:mysql-connector-java:$mysqlConnectorJavaVersion"
	testCompile "com.jayway.jsonpath:json-path-assert:$jsonPathAssertVersion"
	testCompile "org.apache.solr:solr-core:$solrCoreVersion"
	providedRuntime "javax.servlet.jsp:jsp-api:$jspApiVersion"
	
	compile "org.springframework.data:spring-data-neo4j-rest:$springDataNeo4jVersion" 
	compile "org.neo4j:neo4j-cypher:$neo4jCypherVersion"
	//compile "org.neo4j:neo4j-cypher:2.3.0-M01"
	//compile ("org.neo4j:neo4j-community:$neo4jCommunityVersion"
	
	compile ("org.neo4j.app:neo4j-server:$neo4jServer:static-web"){
    	exclude group: "org.mortbay.jetty", module: "servlet-api"
    }    
    		   
}

repositories {
    jcenter()
    mavenLocal()
	//mavenCentral()
    maven { url 'http://repo.spring.io/libs-staging-local'}
    maven { url 'http://repo.spring.io/release' }
    maven { url 'http://repo.spring.io/milestone' }
    maven { url 'http://repo.spring.io/snapshot' }
    maven { url 'http://download.java.net/maven/2' }
    maven { url 'http://repository.springsource.com/maven/bundles/release' }
    maven { url 'http://repository.springsource.com/maven/bundles/external' }
    maven { url 'http://repository.springsource.com/maven/bundles/milestone' }
    maven { url 'http://repository.springsource.com/maven/bundles/snapshot' }
    maven { url 'https://repository.jboss.org/nexus/content/repositories/releases' }
    maven { url 'http://maven.springframework.org/snapshot' }
    maven { url 'http://m2.neo4j.org/releases' }    
    maven { url 'http://repo.springsource.org/libs-snapshot' }
    maven { url 'http://repo.spring.io/snapshot' }
    maven { url 'http://repo1.maven.org/maven2/' }
    maven { url 'http://oauth.googlecode.com/svn/code/maven' }
    maven { url 'https://raw.github.com/plechi/spring-security-scribe/mvn-repo/' }

    maven { url = 'http://repo.spring.io/repo/' }
                          
   
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.3'
}


jar {
    manifest {
        attributes 'Implementation-Title': 'Name',
                   'Implementation-Version': version
    }
}


test {
    systemProperties 'property': 'value'
    
}

uploadArchives {
    repositories {
       flatDir {
           dirs 'repos'
       }
    }
}   

gradle.properties

cglibVersion = 2.2
h2Version = 1.3.175
hibernateValidatorVersion = 4.1.0.Final
httpclientVersion = 4.3.1
javaxInjectVersion = 1
javaxValidationVersion = 1.0.0.GA
log4jVersion = 1.2.16
servletApiVersion = 3.0.1
slf4jVersion = 1.7.5
springSecurityVersion = 4.0.1.RELEASE
springSocialVersion = 1.1.0.RELEASE
springSocialFacebookVersion = 2.0.1.RELEASE
springSocialTwitterVersion = 1.1.0.RELEASE
springSocialLinkedInVersion = 1.0.0.RELEASE
springSocialYahooVersion = 1.0-SNAPSHOT
springVersion = 4.1.5.RELEASE
thymeleafVersion = 2.1.2.RELEASE
thymeleafLayoutVersion = 1.2.2
tomcatVersion = 7.0.42
commonsCodecVersion = 1.8
tilesCoreVersion = 2.2.2
tilesServletVersion = 2.2.2
guavaVersion = 18.0
hibernateEntityManagerVersion = 4.3.6.Final
springDataVersion = 1.6.4.RELEASE
springDataJpaVersion=1.8.0.RELEASE
commonsLangVersion = 2.6
commonsIOVersion = 2.4
usertypeCoreVersion = 3.1.0.CR8
persistenceApiVersion = 1.0.0.Final
springDataCommonsVersion = 1.8.0.RELEASE
javassistVersion=3.19.0-GA
jacksonDataTypeHibernateVersion = 2.2.3
jacksonDataTypeJodaVersion = 2.4.0-rc3
mysqlConnectorVersion = 5.1.32
jstlVersion = 1.2
quartzVersion=2.2.1
validationApiVersion=1.1.0.Final
hibernateValidatorVersion=5.0.1.Final
aspectjrtVersion=1.7.3
logbackClassicVersion=1.1.3
springAspectsVersion=4.1.6.RELEASE
thymeleafVersion=2.1.4.RELEASE
thymeleafExtrasTiles2Version=2.1.1.RELEASE
thymeleafExtrasTiles2Spring4Version=2.1.1.RELEASE
thymeleafExtrasSpringSecurity3Version=2.1.2.RELEASE
tilesCoreVersion=2.2.2
tilesServlet=2.2.2
springJsVersion=2.4.1.RELEASE
jodaTimeVersion=2.7
jodaTimeHibernateVersion=1.4
jodaTimeJspTagsVersion=1.1.1
usertypeCoreVersion=3.2.0.GA
bitlyjVersion=2.0.0
mockitoCoreVersion=2.0.6-beta
commonsPool2Version=2.3
springDataNeo4jVersion=3.3.0.RELEASE
neo4jCypherVersion=2.2.1
neo4jServer=2.3.0-M01
//neo4jCommunityVersion=2.3.0-M01
springDataRedisVersion=1.5.0.RELEASE
springDataSolrVersion=1.4.0.RELEASE
jerseyApacheConnectorVersion=2.17
springDataCommonsVersion=1.10.0.RELEASE
dbunitVersion=2.2
poiVersion=3.2-FINAL
h2Version=1.4.187
javsistVersion=3.19.0-GA
jedisVersion=2.7.0
mysqlConnectorJavaVersion=5.1.35
springRabbitVersion=1.4.4.RELEASE
jsonPathAssertVersion=2.0.0
solrCoreVersion=5.1.0
jspApiVersion=2.1
ehcacheCoreVersion=2.6.11
tilesRequestApiVersion=1.0.6
commonsDigester3Version=3.2
commonsBeanutilsVersion=1.9.2
embeddedRedisVersion=0.6

StackTrace

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/app/core/config/JpaContextConfig.class]: Invocation of init method failed; nested exception is org.hibernate.jpa.boot.archive.spi.ArchiveException: Could not build ClassFile
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:747) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) [spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4937) [tomcat-embed-core-7.0.42.jar:7.0.42]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) [tomcat-embed-core-7.0.42.jar:7.0.42]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-7.0.42.jar:7.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [tomcat-embed-core-7.0.42.jar:7.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [tomcat-embed-core-7.0.42.jar:7.0.42]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0]
	at java.lang.Thread.run(Thread.java:744) [na:1.8.0]
Caused by: org.hibernate.jpa.boot.archive.spi.ArchiveException: Could not build ClassFile
	at org.hibernate.jpa.boot.scan.spi.ClassFileArchiveEntryHandler.toClassFile(ClassFileArchiveEntryHandler.java:88) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:65) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:167) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.visitArchive(ExplodedArchiveDescriptor.java:78) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:72) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.scan(EntityManagerFactoryBuilderImpl.java:723) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:219) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:186) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider$1.<init>(SpringHibernateJpaPersistenceProvider.java:49) ~[spring-orm-4.1.5.RELEASE.jar:4.1.5.RELEASE]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:49) ~[spring-orm-4.1.5.RELEASE.jar:4.1.5.RELEASE]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) ~[spring-orm-4.1.5.RELEASE.jar:4.1.5.RELEASE]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.1.5.RELEASE.jar:4.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
	... 21 common frames omitted
20:20:34.527 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed

javassist did something like google-collections (now Guava) did. They changed groups/names between versions.

javassist 3.11.0.GA is located at GAV (group, artifact, version) group: javassist, name: javassist version: 3.11.0.GA
javassist 3.19.0-GA is located at GAV group: org.javassist, name: javassist, version: 3.19.0-GA

Conflict resolution doesn’t kick in because they’re different artifacts. There’s a section in the user guide for how to deal with this sort of conflict: https://gradle.org/docs/current/userguide/dependency_management.html#sec:module_replacement

That solved it. Thanks

What if the new artifact has identical group/artifact description as the old like following?

http://mvnrepository.com/artifact/org.neo4j/neo4j-kernel/2.1.7

I tried adding version number at the end to distinguish the two but this causes the build to fail.

    module("org.neo4j:neo4j-kernel:2.1.7") {
        replacedBy("org.neo4j:neo4j-kernel:2.3.0-M01")
    }

gradle dependencyInsight command

gradle dependencyInsight --configuration compile --dependency neo4j-kernel
:dependencyInsight
org.neo4j:neo4j-kernel:2.3.0-M01 (conflict resolution)
+--- compile
+--- org.neo4j:neo4j:2.3.0-M01
|    +--- org.springframework.data:spring-data-neo4j:3.3.0.RELEASE
|    |    +--- compile
|    |    \--- org.springframework.data:spring-data-neo4j-rest:3.3.0.RELEASE
|    |         \--- compile
|    +--- org.springframework.data:spring-data-neo4j-rest:3.3.0.RELEASE (*)
|    \--- org.neo4j.app:neo4j-server:2.3.0-M01
|         \--- compile
+--- org.neo4j:neo4j-consistency-check:2.3.0-M01
|    \--- org.neo4j:neo4j:2.3.0-M01 (*)
+--- org.neo4j:neo4j-cypher:2.3.0-M01
|    +--- compile
|    +--- org.neo4j.app:neo4j-server:2.3.0-M01 (*)
|    \--- org.neo4j:neo4j:2.3.0-M01 (*)
+--- org.neo4j:neo4j-graph-algo:2.3.0-M01
|    +--- org.neo4j:neo4j:2.3.0-M01 (*)
|    \--- org.neo4j:neo4j-cypher:2.3.0-M01 (*)
+--- org.neo4j:neo4j-graph-matching:2.3.0-M01
|    +--- org.neo4j:neo4j:2.3.0-M01 (*)
|    \--- org.neo4j:neo4j-cypher:2.3.0-M01 (*)
+--- org.neo4j:neo4j-lucene-index:2.3.0-M01
|    +--- org.springframework.data:spring-data-neo4j-rest:3.3.0.RELEASE (*)
|    +--- org.neo4j:neo4j:2.3.0-M01 (*)
|    +--- org.neo4j:neo4j-consistency-check:2.3.0-M01 (*)
|    \--- org.neo4j:neo4j-cypher:2.3.0-M01 (*)
+--- org.neo4j:neo4j-udc:2.3.0-M01
|    \--- org.neo4j:neo4j:2.3.0-M01 (*)
+--- org.neo4j:server-api:2.3.0-M01
|    \--- org.neo4j.app:neo4j-server:2.3.0-M01 (*)
+--- org.neo4j.app:neo4j-browser:2.3.0-M01
|    \--- org.neo4j.app:neo4j-server:2.3.0-M01 (*)
\--- org.neo4j.app:neo4j-server:2.3.0-M01 (*)

org.neo4j:neo4j-kernel:2.1.7 -> 2.3.0-M01
\--- org.springframework.data:spring-data-neo4j-rest:3.3.0.RELEASE
     \--- compile

(*) - dependencies omitted (listed previously)

You wouldn’t use component replacement for that. There are some links and a description of the different ways to resolve conflicts at the end of this section: https://gradle.org/docs/current/userguide/dependency_management.html#sub:version_conflicts

To the OP, for future people who run into this, could you please provide an example of exactly what you did, using Sterling’s advice?

To solve the conflict I removed that dependency and used a older version of the dependency that depended on it.