Skip to content

Commit 49d249b

Browse files
committed
Disable Aop auto-config if aspectjweaver is not present
This commit adds an additional class check to AopAutoConfiguration as it is main role is to configure `@EnableAspectJAutoProxy` which won't work properly if `aspectjweaver` is not present. Closes gh-9880
1 parent edee342 commit 49d249b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/aop/AopAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.aspectj.lang.annotation.Aspect;
2020
import org.aspectj.lang.reflect.Advice;
21+
import org.aspectj.weaver.AnnotatedElement;
2122

2223
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2324
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -39,7 +40,7 @@
3940
* @see EnableAspectJAutoProxy
4041
*/
4142
@Configuration
42-
@ConditionalOnClass({ EnableAspectJAutoProxy.class, Aspect.class, Advice.class })
43+
@ConditionalOnClass({ EnableAspectJAutoProxy.class, Aspect.class, Advice.class, AnnotatedElement.class })
4344
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
4445
public class AopAutoConfiguration {
4546

0 commit comments

Comments
 (0)