Completely remove log4j - spring-boot

I have a brand new test project from start.spring.io, with the following gradle file:
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
When looking at dependencies, I get the following:
| | +--- org.springframework.boot:spring-boot-starter-logging:2.6.2
| | | +--- ch.qos.logback:logback-classic:1.2.9
| | | | +--- ch.qos.logback:logback-core:1.2.9
| | | | \--- org.slf4j:slf4j-api:1.7.32
| | | +--- org.apache.logging.log4j:log4j-to-slf4j:2.17.0
| | | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
| | | | \--- org.apache.logging.log4j:log4j-api:2.17.0
| | | \--- org.slf4j:jul-to-slf4j:1.7.32
| | | \--- org.slf4j:slf4j-api:1.7.32
How can I completely remove log4j from the project and what should my gradle file look like? I would like to use logback exclusively.

You're already free of log4j.
If your dependencies don't include the log4j core jar, then you're not logging to log4j. The api jar doesn't have any functionality. The api jar together with the log4j-to-slf4j jar make sure that any dependency that is written to use log4j directly has its logging redirected to slf4j, which will use logback.

Related

Replace transitive dependency of Gradle plugin

The axion-release Gradle plugin has a dependency on the unmaintained com.jcraft:jsch:0.1.55 lib. The com.github.mwiede:jsch fork is a drop-in replacement for jcraft jsch providing the same namespace. How can I replace the plugin's dependency?
This does not appear to work:
buildscript {
dependencies {
classpath('pl.allegro.tech.build:axion-release-plugin:1.14.2') {
exclude group: 'com.jcraft', module: 'jsch'
}
}
configurations.classpath {
resolutionStrategy {
force 'com.github.mwiede:jsch:0.2.4'
}
}
}
This will remove com.jcraft.jsch from the classpath but that does not replace it with the maintained lib:
buildscript {
configurations.classpath {
resolutionStrategy {
exclude group: 'com.jcraft', module: 'jsch'
}
}
}
This also does not work
buildscript {
dependencies {
classpath('pl.allegro.tech.build:axion-release-plugin:1.14.2') {
exclude group: 'com.jcraft', module: 'jsch'
}
classpath 'com.github.mwiede:jsch:0.2.4'
}
I have tried substitution
buildscript {
dependencies {
classpath "pl.allegro.tech.build:axion-release-plugin:1.14.2"
}
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("com.jcraft:jsch") using module("com.github.mwiede:jsch:0.2.4") because "of https://stackoverflow.com/q/74355649/2290153"
}
}
}
and buildEnvironment gives:
classpath
\--- pl.allegro.tech.build:axion-release-plugin:1.14.2
+--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r
| +--- com.googlecode.javaewah:JavaEWAH:1.1.13
| \--- org.slf4j:slf4j-api:1.7.30
+--- org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:5.13.1.202206130422-r
| +--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r (*)
| +--- com.jcraft:jsch:0.1.55 -> com.github.mwiede:jsch:0.2.4
| +--- com.jcraft:jzlib:1.1.1
| \--- org.slf4j:slf4j-api:1.7.30
+--- com.jcraft:jsch:0.1.55 -> com.github.mwiede:jsch:0.2.4
+--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.jcraft:jsch.agentproxy.jsch:0.0.9
| +--- com.jcraft:jsch:0.1.49 -> com.github.mwiede:jsch:0.2.4
| \--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.jcraft:jsch.agentproxy.sshagent:0.0.9
| \--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.jcraft:jsch.agentproxy.pageant:0.0.9
| +--- com.jcraft:jsch.agentproxy.core:0.0.9
| +--- net.java.dev.jna:jna:4.1.0
| \--- net.java.dev.jna:jna-platform:4.1.0
| \--- net.java.dev.jna:jna:4.1.0
+--- com.jcraft:jsch.agentproxy.usocket-jna:0.0.9
| +--- com.jcraft:jsch.agentproxy.core:0.0.9
| +--- net.java.dev.jna:jna:4.1.0
| \--- net.java.dev.jna:jna-platform:4.1.0 (*)
+--- com.jcraft:jsch.agentproxy.usocket-nc:0.0.9
| \--- com.jcraft:jsch.agentproxy.core:0.0.9
+--- com.github.zafarkhaja:java-semver:0.9.0
+--- org.eclipse.jgit:org.eclipse.jgit.ssh.apache:5.13.1.202206130422-r
| +--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r (*)
| +--- org.apache.sshd:sshd-osgi:2.7.0
| | +--- org.slf4j:slf4j-api:1.7.30
| | \--- org.slf4j:jcl-over-slf4j:1.7.30
| | \--- org.slf4j:slf4j-api:1.7.30
| +--- org.apache.sshd:sshd-sftp:2.7.0
| | +--- org.apache.sshd:sshd-core:2.7.0
| | | +--- org.apache.sshd:sshd-common:2.7.0
| | | | +--- org.slf4j:slf4j-api:1.7.30
| | | | \--- org.slf4j:jcl-over-slf4j:1.7.30 (*)
| | | +--- org.slf4j:slf4j-api:1.7.30
| | | \--- org.slf4j:jcl-over-slf4j:1.7.30 (*)
| | +--- org.slf4j:slf4j-api:1.7.30
| | \--- org.slf4j:jcl-over-slf4j:1.7.30 (*)
| +--- net.i2p.crypto:eddsa:0.3.0
| \--- org.slf4j:slf4j-api:1.7.30
+--- org.eclipse.jgit:org.eclipse.jgit.ui:5.13.1.202206130422-r
| \--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r (*)
\--- org.eclipse.jgit:org.eclipse.jgit.gpg.bc:5.13.1.202206130422-r
+--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r (*)
+--- org.bouncycastle:bcpg-jdk15on:1.69
| \--- org.bouncycastle:bcprov-jdk15on:1.69
+--- org.bouncycastle:bcprov-jdk15on:1.69
+--- org.bouncycastle:bcutil-jdk15on:1.69
| \--- org.bouncycastle:bcprov-jdk15on:1.69
+--- org.bouncycastle:bcpkix-jdk15on:1.69
| +--- org.bouncycastle:bcprov-jdk15on:1.69
| \--- org.bouncycastle:bcutil-jdk15on:1.69 (*)
\--- org.slf4j:slf4j-api:1.7.30
btw, the transitive dependency comes with jGit, and there was an issue using the fork at https://github.com/mwiede/jsch/issues/85, but it's solved now.

Getting spring application variables into Integration Tests

I've set up integration tests for testing my API and I want my tests to pick up settings from application.yml. The trouble is that my test class never reads the value of ${base-urls.test-url} from the properties file. I've tried using #ContextConfiguration, #TestPropertySource, #PropertySource and #RunWith(SpringRunner.class) without success.
How can I get my integration test to read the properties file?
My project directories look like this:
|____src
| |____test
| | |____resources
| | |____java
| | | |____org
| | | | |____example
| | | | | |____forex
| | | | | | |____controller
| | | | | | | |____CurrencyControllerTest.java
| | | | | | |____service
| | | | | | | |____CurrencyServiceTest.java
| |____integrationTest
| | |____resources
| | | |____application.yml
| | |____java
| | | |____org
| | | | |____example
| | | | | |____forex
| | | | | | |____integration
| | | | | | | |____ApiTests.java
| | | | | | |____domain
| | | | | | | |____CurrencyHelper.java
| |____main
| | |____resources
| | | |____application.yml
| | |____java
| | | |____org
| | | | |____example
| | | | | |____Application.java
| | | | | |____forex
| | | | | | |____repository
| | | | | | | |____CurrencyRepository.java
| | | | | | |____controller
| | | | | | | |____CurrencyController.java
| | | | | | |____service
| | | | | | | |____CurrencyService.java
| | | | | | |____domain
| | | | | | | |____Currency.java
I have an application resource file, src/integrationTest/resources/application.yml and also tried placing it in the same package as ApiTests class. The file contains this:
base-urls:
test-url: ${TEST_URL:http://localhost:8080}
The set up is that I want to have a running application, then run my integration tests with the URL from the #Value annotation. My test class uses Rest Assured and looks like this:
public class ApiTests {
#Value("${base-urls.test-url}")
private String baseUrl;
private Currency dummy;
#Before
public void setup() {
RestAssured.baseURI = baseUrl;
dummy = CurrencyHelper.dummy();
}
My build.gradle file looks like this:
plugins {
id 'java'
id 'application'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'org.springframework.boot' version '2.3.4.RELEASE'
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.springframework.boot'
group 'org.example.forex'
version '1.0-SNAPSHOT'
sourceCompatibility = '1.8'
mainClassName = 'org.example.Application'
sourceSets {
integrationTest {
resources {
srcDir 'src/integrationTest/resources'
}
compileClasspath += sourceSets.main.output + configurations.testRuntime
runtimeClasspath += output + compileClasspath
}
}
def versions = [
postgresql : '42.2.2'
]
repositories {
mavenCentral()
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter"
implementation "org.springframework.boot:spring-boot-starter-web"
implementation'org.springframework.boot:spring-boot-starter-data-jpa'
implementation "org.postgresql:postgresql:${versions.postgresql}"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation group: 'junit', name: 'junit', version: '4.12'
integrationTestImplementation "org.springframework.boot:spring-boot-starter-test"
integrationTestImplementation "org.springframework:spring-test"
integrationTestImplementation 'io.rest-assured:rest-assured:3.3.0'
integrationTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.11.0"
integrationTestImplementation 'junit:junit:4.12'
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
I believe what you're looking for is the SpringBootTest annotation. Add the following annotation atop your test class.
#RunWith(SpringRunner.class)
#SpringBootTest
Should you need, you can pass additional properties into the Spring environment by including them in your SpringBootTest annotation, as in
#SpringBootTest(properties = "com.mycompany.myclass.someproperty=some_value")
If the properties you're trying to load are in a profile specific property file, you can activate that profile with
#ActiveProfiles(value = "my_profile")
Okay. Thanks to #lane.maxwell for the clue, I figured out the missing dependency.
These do work as #lane.maxwell says:
#RunWith(SpringRunner.class)
#SpringBootTest
Basically, my app uses a database and I need to to add the DB dependencies to build.gradle for the integration tests to work:
integrationTestImplementation'org.springframework.boot:spring-boot-starter-data-jpa'
integrationTestImplementation "org.postgresql:postgresql:${versions.postgresql}"

Get list (not tree) of dependencies with Gradle

I have a Gradle project with complex dependencies, which I can see using ./gradlew module-name:dependencies:
[...]
testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- org.apache.logging.log4j:log4j-core -> 2.11.0
| \--- org.apache.logging.log4j:log4j-api:2.11.0
+--- com.google.guava:guava -> 20.0
+--- project :xxx
| +--- org.springframework:spring-tx -> 5.1.7.RELEASE
| | +--- org.springframework:spring-beans:5.1.7.RELEASE
| | | \--- org.springframework:spring-core:5.1.7.RELEASE
| | | \--- org.springframework:spring-jcl:5.1.7.RELEASE
| | \--- org.springframework:spring-core:5.1.7.RELEASE (*)
| +--- org.springframework:spring-context -> 5.1.7.RELEASE
| | +--- org.springframework:spring-aop:5.1.7.RELEASE
| | | +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
| | | \--- org.springframework:spring-core:5.1.7.RELEASE (*)
| | +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
| | +--- org.springframework:spring-core:5.1.7.RELEASE (*)
| | \--- org.springframework:spring-expression:5.1.7.RELEASE
| | \--- org.springframework:spring-core:5.1.7.RELEASE (*)
[...]
When I exclude nested dependencies and include them explicitly, the result might look like this:
[...]
testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- org.apache.logging.log4j:log4j-core -> 2.11.0
| \--- org.apache.logging.log4j:log4j-api:2.11.0
+--- com.google.guava:guava -> 20.0
+--- project :xxx
| +--- org.springframework:spring-context -> 5.1.7.RELEASE
| | +--- org.springframework:spring-aop:5.1.7.RELEASE
| | | +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
| | | \--- org.springframework:spring-core:5.1.7.RELEASE (*)
| | +--- org.springframework:spring-beans:5.1.7.RELEASE (*)
| | +--- org.springframework:spring-core:5.1.7.RELEASE (*)
| | \--- org.springframework:spring-expression:5.1.7.RELEASE
| | \--- org.springframework:spring-core:5.1.7.RELEASE (*)
+--- org.springframework:spring-tx -> 5.1.7.RELEASE
| +--- org.springframework:spring-beans:5.1.7.RELEASE
| | \--- org.springframework:spring-core:5.1.7.RELEASE
| | \--- org.springframework:spring-jcl:5.1.7.RELEASE
| \--- org.springframework:spring-core:5.1.7.RELEASE (*)
[...]
In order to see if the set of dependencies changed, I'd like to compare lists of dependencies. In other words, I'd like to flatten the tree view shown above, so that I can concentrate on differences that are not related to transitive inclusions.
With Maven I can do mvn dependency:tree and mvn dependency:list. How can I do this using Gradle?
I don't think you will find some Gradle core tasks to achieve this (maybe some community plugin exist), but you can write your own custom task to list dependencies in any format you want ( text, csv, ...)
task dependencyList() {
doLast() {
configurations.each { configuration ->
if (configuration.isCanBeResolved()){
println("Configuration $configuration.name ================================")
def files = configuration.resolvedConfiguration.getFiles().sort()
files.forEach{ f -> println(" dep: $f.name")}
}
}
}
}

How can I get the metadata of dependencies in gradle?

I want to get all information I can get from the Gradle about each dependency I added,
I can get the dependency tree by run
grade dependencies
we get something like this
+--- io.springfox:springfox-swagger2:2.9.2
| +--- io.swagger:swagger-annotations:1.5.20
| +--- io.swagger:swagger-models:1.5.20
| | +--- com.fasterxml.jackson.core:jackson-annotations:2.9.5 -> 2.9.0
| | +--- org.slf4j:slf4j-api:1.7.22 -> 1.7.26
| | \--- io.swagger:swagger-annotations:1.5.20
| +--- io.springfox:springfox-spi:2.9.2 (*)
| +--- io.springfox:springfox-schema:2.9.2
| | +--- io.springfox:springfox-core:2.9.2 (*)
| | \--- io.springfox:springfox-spi:2.9.2 (*)
| +--- io.springfox:springfox-swagger-common:2.9.2
| | +--- io.swagger:swagger-annotations:1.5.20
| | +--- io.swagger:swagger-models:1.5.20 (*)
| | +--- io.springfox:springfox-spi:2.9.2 (*)
| | +--- io.springfox:springfox-schema:2.9.2 (*)
| | +--- io.springfox:springfox-spring-web:2.9.2 (*)
| | +--- com.google.guava:guava:20.0
| | +--- com.fasterxml:classmate:1.4.0
| | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
| | +--- org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE (*)
| | \--- org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE (*)
| +--- io.springfox:springfox-spring-web:2.9.2 (*)
| +--- com.google.guava:guava:20.0
| +--- com.fasterxml:classmate:1.4.0
| +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.26
| +--- org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE (*)
| +--- org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE (*)
| \--- org.mapstruct:mapstruct:1.2.0.Final
But can't get all other information about the dependencies
on how can I achieve this?
Update
I want to get information about the creator, date, homepage of the library, library language, license type or any information that can be provided.
Gradle does not offer APIs for doing this.
If your dependencies use Maven POM file or Ivy XML as their metadata, you can access these files through an ArtifactQuery. There is an example in the documentation to do that.
You will however have to decide which information to extract and how to present it.

<<Spring Boot 1.1.6>> Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException

I am new to spring boot and building an application with Spring boot 1.1.6.The basic application was working fine.
But when I added some dependencies, I am unable to start the application and seeing the below exception during staring.
My build.gradle file
` buildscript {
ext {
springBootVersion = '1.1.6.RELEASE'
}
repositories {
maven {
url "http://repo.spring.io/libs-snapshot"
}
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
sourceCompatibility = 1.7
compileJava {
targetCompatibility = 1.7
}
war {
baseName = 'gs-convert-jar-to-war'
version = '0.1.0'
}
repositories {
mavenCentral()
mavenLocal()
maven { url "http://repo.spring.io/libs-snapshot" }
maven { url "http://maven.springframework.org/milestone" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude module: "spring-boot-starter-tomcat"
exclude module:"spring-boot-starter-logging"
}
providedRuntime("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-aop:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")
compile("com.google.guava:guava:17.0")
compile("com.squareup.retrofit:retrofit:1.6.0")
compile("commons-io:commons-io:2.4")
compile("com.local.abdd:abdd-jith912:1.0.4-SNAPSHOT"){
exclude module:"slf4j-api"
}
compile("com.local.abdd:abdd-jith912:1.0.4-SNAPSHOT:tests"){
exclude module:"slf4j-api"
}
testCompile("junit:junit")
compile("org.slf4j:slf4j-api:1.7.7"){
force = true
}
compile("org.slf4j:slf4j-log4j12:1.7.7"){
force=true
}
compile("org.slf4j:slf4j-jdk14:1.7.7"){
force=true
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
`
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: ; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:392)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:305)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:611)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at org.magnum.mobilecloud.video.Application.main(Application.java:27)
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:50)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:82)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:77)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:561)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:736)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:284)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:218)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:435)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:258)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:218)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:435)
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:389)
... 13 more
My gradle dependencies output is too huge that I cannot enter here.
However I find some spring components used as transitive dependencies like
| +--- com.local.infra.thirdparty:oracle-simplefan:11.2.0.2
| | | | | | +--- javax.jms:jms:1.1
| | | | | | +--- org.springframework:spring-jms:3.1.1.RELEASE
| | | | | | | +--- aopalliance:aopalliance:1.0
| | | | | | | +--- org.springframework:spring-aop:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-beans:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-context:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-core:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | \--- org.springframework:spring-tx:3.1.1.RELEASE -> 3.2.2.RELEASE
| | | | | | | +--- aopalliance:aopalliance:1.0
| | | | | | | +--- org.springframework:spring-beans:3.2.2.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | \--- org.springframework:spring-core:3.2.2.RELEASE -> 4.0.7.RELEASE (*)
and
+--- org.springframework.security:spring-security-core:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | +--- org.springframework.security:spring-security-taglibs:3.0.4.RELEASE
| | | | | | | | +--- org.springframework.security:spring-security-web:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | | +--- org.springframework.security:spring-security-acl:3.0.4.RELEASE
| | | | | | | | | +--- org.springframework.security:spring-security-core:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | | | \--- org.springframework:spring-context-support:3.0.3.RELEASE -> 3.2.2.RELEASE (*)
| | | | | | | | \--- org.springframework:spring-web:3.0.3.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework.security:spring-security-config:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
I'm not 100% sure that this will solve your problem, but it will move things in the right direction.
You have a number of dependencies that are out of sync with other dependencies from the same Spring project. For example you have a mix of versions in your Spring Framework dependencies. Most are 4.0.7.RELEASE but a few are 3.x.x.
One way to fix this is to add an explicit, direct dependency on the problematic modules (Spring Boot will provide the right version for you. For example:
dependencies {
compile 'org.springframework:spring-context-support'
compile 'org.springframework:spring-jms'
compile 'org.springframework:spring-tx'
compile 'org.springframework:spring-security-acl'
compile 'org.springframework:spring-security-taglibs'
}
Try making this change and looking at the output of gradle dependencies again. Repeat the process if you spot any other modules with versions that are out of line with their other modules in the same Spring project. Once the versions all look right, try running your app again.

Resources