From 97c51071d9fcf8e05f0e73653572a1f99fe67d43 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 3 Dec 2019 15:58:28 -0500 Subject: [PATCH] Upgrade dependencies; change logging to Log4j2 (#55) * Upgrade dependencies; change logging to Log4j2 * * Fix dependency versions and modernize some of them * * Bring `junit` dependency back into `spring-rabbit-stocks` sample since it is an `optional` with `spring-rabbit-test` * Remove `test` dependencies from `spring-rabbit-helloworld` sample since there is no tests in this sample at all --- helloworld/pom.xml | 115 ++---------------- .../main/resources/commons-logging.properties | 7 -- .../src/main/resources/log4j.properties | 11 -- helloworld/src/main/resources/log4j2.xml | 14 +++ log4j2/pom.xml | 2 +- spring-rabbit-confirms-returns/pom.xml | 2 +- spring-rabbit-global-errorhandler/pom.xml | 2 +- spring-rabbit-json/pom.xml | 2 +- stocks/pom.xml | 107 ++++++---------- stocks/src/main/resources/log4j.properties | 11 -- stocks/src/main/resources/log4j2.xml | 14 +++ .../test/resources/commons-logging.properties | 7 -- stocks/src/test/resources/log4j.properties | 11 -- 13 files changed, 79 insertions(+), 226 deletions(-) delete mode 100644 helloworld/src/main/resources/commons-logging.properties delete mode 100644 helloworld/src/main/resources/log4j.properties create mode 100644 helloworld/src/main/resources/log4j2.xml delete mode 100644 stocks/src/main/resources/log4j.properties create mode 100644 stocks/src/main/resources/log4j2.xml delete mode 100644 stocks/src/test/resources/commons-logging.properties delete mode 100644 stocks/src/test/resources/log4j.properties diff --git a/helloworld/pom.xml b/helloworld/pom.xml index 064792a..f5b8232 100644 --- a/helloworld/pom.xml +++ b/helloworld/pom.xml @@ -16,7 +16,6 @@ true - 5.2.0.RELEASE 2.2.1.RELEASE UTF-8 1.8 @@ -24,111 +23,16 @@ - - - org.springframework.amqp - spring-amqp - ${spring.amqp.version} - - - org.springframework - spring-core - - - org.springframework.amqp spring-rabbit ${spring.amqp.version} - - - org.springframework - spring-core - - - org.springframework - spring-messaging - - - org.springframework - spring-tx - - - org.springframework - spring-context - - - org.springframework - spring-core - ${spring.framework.version} - - - - commons-logging - commons-logging - - - - - org.springframework - spring-context - ${spring.framework.version} - - - org.springframework - spring-messaging - ${spring.framework.version} - - - org.springframework - spring-tx - ${spring.framework.version} - - - org.springframework - spring-test - ${spring.framework.version} - test - - - cglib - cglib-nodep - 2.2 - runtime - - - - - junit - junit - 4.12 - test - - - - org.slf4j - slf4j-api - 1.7.22 - - - org.slf4j - jcl-over-slf4j - 1.7.22 - runtime - - - org.slf4j - slf4j-log4j12 - 1.7.22 - runtime - - - log4j - log4j - 1.2.14 + org.apache.logging.log4j + log4j-jcl + 2.12.0 runtime @@ -137,11 +41,6 @@ - - com.springsource.bundlor - com.springsource.bundlor.maven - 1.0.0.M1B - maven-assembly-plugin false @@ -157,16 +56,16 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.8.1 - 1.5 - 1.5 + 1.8 + 1.8 org.apache.maven.plugins maven-surefire-plugin - 2.9 + 2.22.2 diff --git a/helloworld/src/main/resources/commons-logging.properties b/helloworld/src/main/resources/commons-logging.properties deleted file mode 100644 index 51cd942..0000000 --- a/helloworld/src/main/resources/commons-logging.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Use Log4j -priority=1 -org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl -org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger - -# Configuration file of the log -#log4j.configuration=file:log4j-rabbit-stocks.properties diff --git a/helloworld/src/main/resources/log4j.properties b/helloworld/src/main/resources/log4j.properties deleted file mode 100644 index abbb5c2..0000000 --- a/helloworld/src/main/resources/log4j.properties +++ /dev/null @@ -1,11 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -#log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n -log4j.appender.stdout.layout.ConversionPattern=%-5p [%40.40c{4}]: %m%n - -log4j.category.org.springframework.amqp.rabbit=INFO -log4j.category.org.springframework.beans.factory=INFO - diff --git a/helloworld/src/main/resources/log4j2.xml b/helloworld/src/main/resources/log4j2.xml new file mode 100644 index 0000000..43654ed --- /dev/null +++ b/helloworld/src/main/resources/log4j2.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/log4j2/pom.xml b/log4j2/pom.xml index b9097f1..c9c5352 100644 --- a/log4j2/pom.xml +++ b/log4j2/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.0.M3 + 2.2.1.RELEASE diff --git a/spring-rabbit-confirms-returns/pom.xml b/spring-rabbit-confirms-returns/pom.xml index 06db5fc..d4f71cf 100644 --- a/spring-rabbit-confirms-returns/pom.xml +++ b/spring-rabbit-confirms-returns/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.0.RELEASE + 2.2.1.RELEASE diff --git a/spring-rabbit-global-errorhandler/pom.xml b/spring-rabbit-global-errorhandler/pom.xml index 8700c52..f5062bb 100644 --- a/spring-rabbit-global-errorhandler/pom.xml +++ b/spring-rabbit-global-errorhandler/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.0.RELEASE + 2.2.1.RELEASE diff --git a/spring-rabbit-json/pom.xml b/spring-rabbit-json/pom.xml index 429020a..45afc87 100644 --- a/spring-rabbit-json/pom.xml +++ b/spring-rabbit-json/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.0.RELEASE + 2.2.1.RELEASE diff --git a/stocks/pom.xml b/stocks/pom.xml index 6fcfb96..499cdd6 100644 --- a/stocks/pom.xml +++ b/stocks/pom.xml @@ -22,74 +22,36 @@ false - + + + + com.fasterxml.jackson + jackson-bom + 2.10.1 + import + pom + + + - - org.springframework.amqp - spring-amqp - ${spring.amqp.version} - - - org.springframework - spring-core - - - + org.springframework.amqp spring-rabbit ${spring.amqp.version} - - - org.springframework - spring-core - - - org.springframework - spring-messaging - - - org.springframework - spring-tx - - - org.springframework - spring-context - - - org.springframework - spring-web - - - - org.springframework - spring-test - ${spring.framework.version} - test - org.springframework spring-context-support ${spring.framework.version} runtime - - org.springframework - spring-aop - ${spring.framework.version} - org.springframework spring-oxm ${spring.framework.version} - - org.springframework - spring-messaging - ${spring.framework.version} - org.springframework spring-tx @@ -119,43 +81,54 @@ jar runtime - - cglib - cglib-nodep - 2.2 - org.aspectj aspectjrt - 1.5.4 + 1.9.4 org.aspectj aspectjweaver - 1.5.4 + 1.9.4 com.fasterxml.jackson.core jackson-databind - 2.9.10.1 runtime + + org.springframework.amqp + spring-rabbit-test + ${spring.amqp.version} + test + + junit junit - 4.8.1 + 4.12 test - log4j - log4j - 1.2.14 - runtime + org.apache.logging.log4j + log4j-core + 2.12.1 + + org.apache.logging.log4j + log4j-jcl + 2.12.1 + runtime + + + org.apache.logging.log4j + log4j-slf4j-impl + 2.12.1 + com.jgoodies forms @@ -192,16 +165,16 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.8.1 - 1.5 - 1.5 + 1.8 + 1.8 org.apache.maven.plugins maven-surefire-plugin - 2.9 + 2.22.2 diff --git a/stocks/src/main/resources/log4j.properties b/stocks/src/main/resources/log4j.properties deleted file mode 100644 index 1343d41..0000000 --- a/stocks/src/main/resources/log4j.properties +++ /dev/null @@ -1,11 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -#log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n -log4j.appender.stdout.layout.ConversionPattern=%-5p %8t [%40.40c{4}]: %m%n - -log4j.category.org.springframework.amqp.rabbit=DEBUG -log4j.category.org.springframework.beans.factory=INFO - diff --git a/stocks/src/main/resources/log4j2.xml b/stocks/src/main/resources/log4j2.xml new file mode 100644 index 0000000..ecac594 --- /dev/null +++ b/stocks/src/main/resources/log4j2.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/stocks/src/test/resources/commons-logging.properties b/stocks/src/test/resources/commons-logging.properties deleted file mode 100644 index 51cd942..0000000 --- a/stocks/src/test/resources/commons-logging.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Use Log4j -priority=1 -org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl -org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger - -# Configuration file of the log -#log4j.configuration=file:log4j-rabbit-stocks.properties diff --git a/stocks/src/test/resources/log4j.properties b/stocks/src/test/resources/log4j.properties deleted file mode 100644 index 9687c70..0000000 --- a/stocks/src/test/resources/log4j.properties +++ /dev/null @@ -1,11 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -#log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n -log4j.appender.stdout.layout.ConversionPattern=%-5p [%40.40c{4}]: %m%n - -log4j.category.org.springframework.amqp.rabbit=DEBUG -log4j.category.org.springframework.beans.factory=INFO -