From: Gustavo Martin Morcuende Date: Wed, 18 Jan 2017 21:44:00 +0000 (+0100) Subject: gradle multi project, WIP X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=1a148a0daa0849faed2ef174189ab3bc347a5708;p=JavaForFun gradle multi project, WIP --- diff --git a/SpringJava/Gradle/build.gradle b/SpringJava/Gradle/build.gradle index c6f6aba..ba5257d 100644 --- a/SpringJava/Gradle/build.gradle +++ b/SpringJava/Gradle/build.gradle @@ -1,3 +1,5 @@ +project.ext.springVersion='4.3.0.RELEASE' + subprojects { apply plugin: 'java' apply plugin: 'idea' @@ -10,13 +12,37 @@ subprojects { targetCompatibility = 1.8 sourceCompatibility = 1.8 - + repositories { mavenCentral() maven { url 'https://dl.bintray.com/palantir/releases' } } + dependencies { + // 1/3 Required dependency for log4j 2 with slf4j: binding between log4j2 and slf4j + compile('org.apache.logging.log4j:log4j-slf4j-impl:2.7') + // 2/3 Required dependency for log4j 2 with slf4j: log4j 2 maven plugin (it is the log4j 2 implementation) + compile('org.apache.logging.log4j:log4j-core:2.7') + // 3/3 Required dependency for getting rid of commons logging. This is the BRIDGE (no binding) between Jakarta Commons Logging (used by Spring) + // and whatever I am using for logging (in this case I am using log4j 2) See: http://www.slf4j.org/legacy.html + // We need exclusions in every dependency using Jakarta Commons Logging (see Spring dependencies below) + compile('org.slf4j:jcl-over-slf4j:1.7.22') + + + compile("org.springframework:spring-context:${springVersion}") { + exclude group: 'commons-logging', module: 'commons-logging' + } + compile('javax.inject:javax.inject:1') + compile('cglib:cglib:3.2.4') + + + // Unit tests + testCompile('junit:junit:4.12') + testCompile('org.mockito:mockito-core:2.4.1') + } + + buildscript { repositories { mavenCentral() diff --git a/SpringJava/Gradle/spring-jpa-persistence/build.gradle b/SpringJava/Gradle/spring-jpa-persistence/build.gradle index 25b3053..61f1096 100644 --- a/SpringJava/Gradle/spring-jpa-persistence/build.gradle +++ b/SpringJava/Gradle/spring-jpa-persistence/build.gradle @@ -10,25 +10,9 @@ apply plugin: 'com.ewerk.gradle.plugins.querydsl' apply plugin: 'docker-compose' dependencies { - // 1/3 Required dependency for log4j 2 with slf4j: binding between log4j2 and slf4j - compile('org.apache.logging.log4j:log4j-slf4j-impl:2.7') - // 2/3 Required dependency for log4j 2 with slf4j: log4j 2 maven plugin (it is the log4j 2 implementation) - compile('org.apache.logging.log4j:log4j-core:2.7') - // 3/3 Required dependency for getting rid of commons logging. This is the BRIDGE (no binding) between Jakarta Commons Logging (used by Spring) - // and whatever I am using for logging (in this case I am using log4j 2) See: http://www.slf4j.org/legacy.html - // We need exclusions in every dependency using Jakarta Commons Logging (see Spring dependencies below) - compile('org.slf4j:jcl-over-slf4j:1.7.22') - - - compile('org.springframework:spring-context:4.3.0.RELEASE') { - exclude group: 'commons-logging', module: 'commons-logging' - } - compile('javax.inject:javax.inject:1') - compile('cglib:cglib:3.2.4') - // Required JPA dependencies with hibernate - compile('org.springframework:spring-orm:4.3.0.RELEASE') + compile("org.springframework:spring-orm:${springVersion}") compile('org.springframework.data:spring-data-jpa:1.10.2.RELEASE') { exclude group: 'org.springframework', module: 'spring-beans' exclude group: 'org.springframework', module: 'spring-jdbc' @@ -72,15 +56,11 @@ dependencies { compile('com.querydsl:querydsl-jpa:4.1.3') - // Unit tests - testCompile('junit:junit:4.12') - testCompile('org.mockito:mockito-core:2.4.1') - testCompile('org.springframework:spring-test:4.3.0.RELEASE') { + // Integration tests + testCompile("org.springframework:spring-test:${springVersion}") { exclude group: 'commons-logging', module: 'commons-logging' } - - // Integration tests // Either using H2 testCompile('com.h2database:h2:1.4.193') // or MYSQL with docker :)