-project.ext.springVersion='4.3.0.RELEASE'
+project.ext {
+
+ // Compile dependencies
+ // Spring
+ springVersion='4.3.0.RELEASE'
+ // Spring JPA
+ springJPAVersion='1.10.2.RELEASE'
+ // Spring Envers
+ springDataEnversVersion='1.0.2.RELEASE'
+ hibernateEnversVersion='5.2.1.Final'
+ // Hibernate
+ hibernateValidatorVersion='5.2.4.Final'
+ hibernateEntityManagerVersion='5.2.1.Final'
+ // QueryDSL
+ queryDslAptVersion='4.1.3'
+ // Liquibase or FlyWay
+ liquibaseVersion='3.5.3'
+ flyWayVersion='4.0.3'
+ // Jackson.
+ jacksonVersion='2.8.1'
+ // Validation API. JSR-303
+ validationAPIVersion='1.1.0.Final'
+
+ // LOG4J2 dependencies
+ slf4jVersion='2.7'
+ log4jCoreVersion='2.7'
+ jclOverSlf4jVersion='1.7.22'
+
+ // Unit test dependencies
+ dockerComposeRuleVersion='0.28.1'
+ mockitoVersion='2.4.1'
+ junitVersion='4.12'
+
+ // Integration test dependencies
+ h2DatabaseVersion='1.4.193'
+ mysqlConnectorVersion='6.0.5'
+
+ // Plugins
+ queryDslPluginVersion='1.0.7'
+ dockerComposePluginVersion='0.3.16'
+
+}
+
subprojects {
apply plugin: 'java'
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')
+ compile("org.apache.logging.log4j:log4j-slf4j-impl:${slf4jVersion}")
// 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')
+ compile("org.apache.logging.log4j:log4j-core:${log4jCoreVersion}")
// 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.slf4j:jcl-over-slf4j:${jclOverSlf4jVersion}")
compile("org.springframework:spring-context:${springVersion}") {
// Unit tests
- testCompile('junit:junit:4.12')
- testCompile('org.mockito:mockito-core:2.4.1')
+ testCompile("junit:junit:${junitVersion}")
+ testCompile("org.mockito:mockito-core:${mockitoVersion}")
}
buildscript {
dependencies {
- classpath 'gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:1.0.7'
- classpath 'com.avast.gradle:docker-compose-gradle-plugin:0.3.16'
+ classpath "gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:${queryDslPluginVersion}"
+ classpath "com.avast.gradle:docker-compose-gradle-plugin:${dockerComposePluginVersion}"
}
}
// Required JPA dependencies with hibernate
compile("org.springframework:spring-orm:${springVersion}")
- compile('org.springframework.data:spring-data-jpa:1.10.2.RELEASE') {
+ compile("org.springframework.data:spring-data-jpa:${springJPAVersion}") {
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-jdbc'
exclude group: 'org.springframework', module: 'spring-orm'
exclude group: 'org.springframework', module: 'spring-context'
exclude group: 'commons-logging', module: 'commons-logging'
}
- compile('org.hibernate:hibernate-entitymanager:5.2.1.Final')
+ compile("org.hibernate:hibernate-entitymanager:${hibernateEntityManagerVersion}")
// Auditory using Hibernate Envers
- compile('org.springframework.data:spring-data-envers:1.0.2.RELEASE')
- compile('org.hibernate:hibernate-envers:5.2.1.Final')
+ compile("org.springframework.data:spring-data-envers:${springDataEnversVersion}")
+ compile("org.hibernate:hibernate-envers:${hibernateEnversVersion}")
// Required by spring-context for using JSR-303. See LocalValidatorFactoryBean
// in rest-config.xml
- compile('javax.validation:validation-api:1.1.0.Final')
- compile('org.hibernate:hibernate-validator:5.2.4.Final')
+ compile("javax.validation:validation-api:${validationAPIVersion}")
+ compile("org.hibernate:hibernate-validator:${hibernateValidatorVersion}")
// Jackson JSON Processor, required by spring-webmvc. See messageConverters
// in rest-config.xml
- compile('com.fasterxml.jackson.core:jackson-databind:2.8.1')
+ compile("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
// Loading data base in run time either using liquibase
- compile('org.liquibase:liquibase-core:3.5.3')
+ compile("org.liquibase:liquibase-core:${liquibaseVersion}")
// or flyway
- compile('org.flywaydb:flyway-core:4.0.3')
+ compile("org.flywaydb:flyway-core:${flyWayVersion}")
// Jackson Java time support
- compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.1')
+ compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}")
// Using Querydsl
- compile('com.querydsl:querydsl-apt:4.1.3')
- compile('com.querydsl:querydsl-jpa:4.1.3')
+ compile("com.querydsl:querydsl-apt:${queryDslAptVersion}")
+ compile("com.querydsl:querydsl-jpa:${queryDslAptVersion}")
// Integration tests
}
// Either using H2
- testCompile('com.h2database:h2:1.4.193')
+ testCompile("com.h2database:h2:${h2DatabaseVersion}")
// or MYSQL with docker :)
- testCompile('mysql:mysql-connector-java:6.0.5')
+ testCompile("mysql:mysql-connector-java:${mysqlConnectorVersion}")
// DockerComposeRule DOES NOT WORK FOR THESE REASONS:
// 1. Spring context is loaded before the DockerComposeRule
// We will have to run our tests always from the Suite not being able to run
// just one Test from the IDE :(
// See: AdDescriptionRepositoryDockerComposeRuleShould
- testCompile 'com.palantir.docker.compose:docker-compose-rule:0.28.1'
+ testCompile "com.palantir.docker.compose:docker-compose-rule:${dockerComposeRuleVersion}"
}
querydsl {
- library = 'com.querydsl:querydsl-apt:4.1.3'
+ library = "com.querydsl:querydsl-apt:${queryDslAptVersion}"
querydslSourcesDir = "$buildDir/generated-sources/querydsl"
jpa = true
}