I have changed Gradle build script to use Spring 2.0.1 instead 1.5.9. When I run gradle build
, I get error: cannot find symbol Logger logger = Logger.getLogger(this.getClass().getName())
. It worked well with previous Spring Boot version. Code uses import org.apache.log4j.Logger;
. How to solve this problem?
build.gradle
file:
buildscript {
ext {
springBootVersion = '2.0.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'war'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
bootRun {
sourceResources sourceSets.main
}
sourceSets {
main {
java {
srcDirs = ["src/main/java", "src/generated/main/java"]
}
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.boot:spring-boot-starter'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.springframework.boot:spring-boot-starter-velocity:1.4.7.RELEASE'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
compile 'com.ryantenney.metrics:metrics-spring:3.1.3'
compile 'com.github.ben-manes.caffeine:caffeine:2.6.2'
compile 'org.hibernate:hibernate-java8'
compile 'org.postgresql:postgresql'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'commons-codec:commons-codec:1.9'
compile 'io.springfox:springfox-swagger2:2.6.1'
compile 'io.springfox:springfox-swagger-ui:2.6.1'
compile 'javax.mail:mail:1.4.7'
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'com.restfb:restfb:1.37.0'
compile 'com.google.apis:google-api-services-oauth2:v2-rev134-1.23.0'
compile 'eu.bitwalker:UserAgentUtils:1.19'
compile 'com.twilio.sdk:twilio:7.17.+'
testCompile('com.h2database:h2')
testCompile("org.springframework.boot:spring-boot-starter-test")
compile fileTree(dir: 'libs', include: '*.jar')
}