From 9eaa8f4dffaeeadd9f02ebe6ce0db57d70805b38 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Thu, 30 Dec 2021 20:39:11 +0530 Subject: [PATCH 1/2] JAVA-8280: Split or move spring-aop module --- pom.xml | 2 + spring-aop-2/README.md | 10 ++++ spring-aop-2/pom.xml | 60 +++++++++++++++++++ .../main/java/com/baeldung/Application.java | 12 ++++ .../com/baeldung/method/info/Account.java | 0 .../method/info/AccountOperation.java | 0 .../method/info/BankAccountAspect.java | 0 .../method/info/BankAccountService.java | 0 .../method/info/WithdrawLimitException.java | 0 .../performancemonitor/AopConfiguration.java | 0 .../MyPerformanceMonitorInterceptor.java | 0 .../performancemonitor/PerfomanceApp.java | 0 .../baeldung/performancemonitor/Person.java | 0 .../performancemonitor/PersonService.java | 0 .../undeclared/SomeCheckedException.java | 0 .../baeldung/undeclared/ThrowUndeclared.java | 0 .../undeclared/UndeclaredApplication.java | 0 .../baeldung/undeclared/UndeclaredAspect.java | 0 .../undeclared/UndeclaredService.java | 0 spring-aop-2/src/main/resources/logback.xml | 23 +++++++ .../java/com/baeldung/SpringContextTest.java | 15 +++++ .../BankAccountServiceIntegrationTest.java | 0 ...aredThrowableExceptionIntegrationTest.java | 0 .../UndeclaredThrowableExceptionUnitTest.java | 0 spring-aop/README.md | 4 +- spring-aop/src/main/resources/logback.xml | 4 -- 26 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 spring-aop-2/README.md create mode 100644 spring-aop-2/pom.xml create mode 100644 spring-aop-2/src/main/java/com/baeldung/Application.java rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/method/info/Account.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/method/info/AccountOperation.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/method/info/BankAccountAspect.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/method/info/BankAccountService.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/method/info/WithdrawLimitException.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/performancemonitor/AopConfiguration.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/performancemonitor/MyPerformanceMonitorInterceptor.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/performancemonitor/PerfomanceApp.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/performancemonitor/Person.java (100%) rename {spring-aop => spring-aop-2}/src/main/java/com/baeldung/performancemonitor/PersonService.java (100%) rename {spring-aop/src/test => spring-aop-2/src/main}/java/com/baeldung/undeclared/SomeCheckedException.java (100%) rename {spring-aop/src/test => spring-aop-2/src/main}/java/com/baeldung/undeclared/ThrowUndeclared.java (100%) rename {spring-aop/src/test => spring-aop-2/src/main}/java/com/baeldung/undeclared/UndeclaredApplication.java (100%) rename {spring-aop/src/test => spring-aop-2/src/main}/java/com/baeldung/undeclared/UndeclaredAspect.java (100%) rename {spring-aop/src/test => spring-aop-2/src/main}/java/com/baeldung/undeclared/UndeclaredService.java (100%) create mode 100644 spring-aop-2/src/main/resources/logback.xml create mode 100644 spring-aop-2/src/test/java/com/baeldung/SpringContextTest.java rename {spring-aop => spring-aop-2}/src/test/java/com/baeldung/method/info/BankAccountServiceIntegrationTest.java (100%) rename {spring-aop => spring-aop-2}/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java (100%) rename {spring-aop => spring-aop-2}/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java (100%) diff --git a/pom.xml b/pom.xml index ad002650d7..be02eea2d4 100644 --- a/pom.xml +++ b/pom.xml @@ -624,6 +624,7 @@ spring-akka spring-amqp spring-aop + spring-aop-2 spring-apache-camel spring-batch @@ -1094,6 +1095,7 @@ spring-akka spring-amqp spring-aop + spring-aop-2 spring-apache-camel spring-batch diff --git a/spring-aop-2/README.md b/spring-aop-2/README.md new file mode 100644 index 0000000000..a9694ac236 --- /dev/null +++ b/spring-aop-2/README.md @@ -0,0 +1,10 @@ +## Spring AOP + +This module contains articles about Spring aspect oriented programming (AOP) + +### Relevant articles + +- [Spring Performance Logging](https://www.baeldung.com/spring-performance-logging) +- [When Does Java Throw UndeclaredThrowableException?](https://www.baeldung.com/java-undeclaredthrowableexception) +- [Get Advised Method Info in Spring AOP](https://www.baeldung.com/spring-aop-get-advised-method-info) +- More articles: [[<-- prev]](/spring-aop) \ No newline at end of file diff --git a/spring-aop-2/pom.xml b/spring-aop-2/pom.xml new file mode 100644 index 0000000000..457f3eae6d --- /dev/null +++ b/spring-aop-2/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + spring-aop-2 + spring-aop-2 + war + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + org.aspectj + aspectjrt + + + org.aspectj + aspectjweaver + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.boot + spring-boot-starter-test + test + + + org.mockito + mockito-core + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${project.basedir}/src/main/resources/logback.xml + + + + + + + + 1.11 + + + \ No newline at end of file diff --git a/spring-aop-2/src/main/java/com/baeldung/Application.java b/spring-aop-2/src/main/java/com/baeldung/Application.java new file mode 100644 index 0000000000..c0490d50c6 --- /dev/null +++ b/spring-aop-2/src/main/java/com/baeldung/Application.java @@ -0,0 +1,12 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/spring-aop/src/main/java/com/baeldung/method/info/Account.java b/spring-aop-2/src/main/java/com/baeldung/method/info/Account.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/method/info/Account.java rename to spring-aop-2/src/main/java/com/baeldung/method/info/Account.java diff --git a/spring-aop/src/main/java/com/baeldung/method/info/AccountOperation.java b/spring-aop-2/src/main/java/com/baeldung/method/info/AccountOperation.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/method/info/AccountOperation.java rename to spring-aop-2/src/main/java/com/baeldung/method/info/AccountOperation.java diff --git a/spring-aop/src/main/java/com/baeldung/method/info/BankAccountAspect.java b/spring-aop-2/src/main/java/com/baeldung/method/info/BankAccountAspect.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/method/info/BankAccountAspect.java rename to spring-aop-2/src/main/java/com/baeldung/method/info/BankAccountAspect.java diff --git a/spring-aop/src/main/java/com/baeldung/method/info/BankAccountService.java b/spring-aop-2/src/main/java/com/baeldung/method/info/BankAccountService.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/method/info/BankAccountService.java rename to spring-aop-2/src/main/java/com/baeldung/method/info/BankAccountService.java diff --git a/spring-aop/src/main/java/com/baeldung/method/info/WithdrawLimitException.java b/spring-aop-2/src/main/java/com/baeldung/method/info/WithdrawLimitException.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/method/info/WithdrawLimitException.java rename to spring-aop-2/src/main/java/com/baeldung/method/info/WithdrawLimitException.java diff --git a/spring-aop/src/main/java/com/baeldung/performancemonitor/AopConfiguration.java b/spring-aop-2/src/main/java/com/baeldung/performancemonitor/AopConfiguration.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/performancemonitor/AopConfiguration.java rename to spring-aop-2/src/main/java/com/baeldung/performancemonitor/AopConfiguration.java diff --git a/spring-aop/src/main/java/com/baeldung/performancemonitor/MyPerformanceMonitorInterceptor.java b/spring-aop-2/src/main/java/com/baeldung/performancemonitor/MyPerformanceMonitorInterceptor.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/performancemonitor/MyPerformanceMonitorInterceptor.java rename to spring-aop-2/src/main/java/com/baeldung/performancemonitor/MyPerformanceMonitorInterceptor.java diff --git a/spring-aop/src/main/java/com/baeldung/performancemonitor/PerfomanceApp.java b/spring-aop-2/src/main/java/com/baeldung/performancemonitor/PerfomanceApp.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/performancemonitor/PerfomanceApp.java rename to spring-aop-2/src/main/java/com/baeldung/performancemonitor/PerfomanceApp.java diff --git a/spring-aop/src/main/java/com/baeldung/performancemonitor/Person.java b/spring-aop-2/src/main/java/com/baeldung/performancemonitor/Person.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/performancemonitor/Person.java rename to spring-aop-2/src/main/java/com/baeldung/performancemonitor/Person.java diff --git a/spring-aop/src/main/java/com/baeldung/performancemonitor/PersonService.java b/spring-aop-2/src/main/java/com/baeldung/performancemonitor/PersonService.java similarity index 100% rename from spring-aop/src/main/java/com/baeldung/performancemonitor/PersonService.java rename to spring-aop-2/src/main/java/com/baeldung/performancemonitor/PersonService.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/SomeCheckedException.java b/spring-aop-2/src/main/java/com/baeldung/undeclared/SomeCheckedException.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/SomeCheckedException.java rename to spring-aop-2/src/main/java/com/baeldung/undeclared/SomeCheckedException.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/ThrowUndeclared.java b/spring-aop-2/src/main/java/com/baeldung/undeclared/ThrowUndeclared.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/ThrowUndeclared.java rename to spring-aop-2/src/main/java/com/baeldung/undeclared/ThrowUndeclared.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredApplication.java b/spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredApplication.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredApplication.java rename to spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredApplication.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredAspect.java b/spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredAspect.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredAspect.java rename to spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredAspect.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredService.java b/spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredService.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredService.java rename to spring-aop-2/src/main/java/com/baeldung/undeclared/UndeclaredService.java diff --git a/spring-aop-2/src/main/resources/logback.xml b/spring-aop-2/src/main/resources/logback.xml new file mode 100644 index 0000000000..4eaa556705 --- /dev/null +++ b/spring-aop-2/src/main/resources/logback.xml @@ -0,0 +1,23 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-aop-2/src/test/java/com/baeldung/SpringContextTest.java b/spring-aop-2/src/test/java/com/baeldung/SpringContextTest.java new file mode 100644 index 0000000000..13c1c162f1 --- /dev/null +++ b/spring-aop-2/src/test/java/com/baeldung/SpringContextTest.java @@ -0,0 +1,15 @@ +package com.baeldung; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class) +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + } +} diff --git a/spring-aop/src/test/java/com/baeldung/method/info/BankAccountServiceIntegrationTest.java b/spring-aop-2/src/test/java/com/baeldung/method/info/BankAccountServiceIntegrationTest.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/method/info/BankAccountServiceIntegrationTest.java rename to spring-aop-2/src/test/java/com/baeldung/method/info/BankAccountServiceIntegrationTest.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java b/spring-aop-2/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java rename to spring-aop-2/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionIntegrationTest.java diff --git a/spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java b/spring-aop-2/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java similarity index 100% rename from spring-aop/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java rename to spring-aop-2/src/test/java/com/baeldung/undeclared/UndeclaredThrowableExceptionUnitTest.java diff --git a/spring-aop/README.md b/spring-aop/README.md index b49c2bd457..4ef8c35fde 100644 --- a/spring-aop/README.md +++ b/spring-aop/README.md @@ -6,11 +6,9 @@ This module contains articles about Spring aspect oriented programming (AOP) - [Implementing a Custom Spring AOP Annotation](https://www.baeldung.com/spring-aop-annotation) - [Intro to AspectJ](https://www.baeldung.com/aspectj) -- [Spring Performance Logging](https://www.baeldung.com/spring-performance-logging) - [Introduction to Spring AOP](https://www.baeldung.com/spring-aop) - [Introduction to Pointcut Expressions in Spring](https://www.baeldung.com/spring-aop-pointcut-tutorial) - [Introduction to Advice Types in Spring](https://www.baeldung.com/spring-aop-advice-tutorial) -- [When Does Java Throw UndeclaredThrowableException?](https://www.baeldung.com/java-undeclaredthrowableexception) -- [Get Advised Method Info in Spring AOP](https://www.baeldung.com/spring-aop-get-advised-method-info) - [Advise Methods on Annotated Classes With AspectJ](https://www.baeldung.com/aspectj-advise-methods) - [Joinpoint vs. ProceedingJoinPoint in AspectJ](https://www.baeldung.com/aspectj-joinpoint-proceedingjoinpoint) +- More articles: [[next -->]](/spring-aop-2) diff --git a/spring-aop/src/main/resources/logback.xml b/spring-aop/src/main/resources/logback.xml index 84885fae62..fe4dfdee56 100644 --- a/spring-aop/src/main/resources/logback.xml +++ b/spring-aop/src/main/resources/logback.xml @@ -13,10 +13,6 @@ - - - - From cbf74d1a943474ed17b2728bbde2757b5437a281 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 3 Jan 2022 22:54:14 +0530 Subject: [PATCH 2/2] JAVA-8280: remove surefire plugin --- spring-aop-2/pom.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/spring-aop-2/pom.xml b/spring-aop-2/pom.xml index 457f3eae6d..76e4780e72 100644 --- a/spring-aop-2/pom.xml +++ b/spring-aop-2/pom.xml @@ -39,20 +39,6 @@ - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${project.basedir}/src/main/resources/logback.xml - - - - - - 1.11