Browse Source

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
pull/9890/head
Stephane Nicoll 9 years ago
parent
commit
49d249bdf4
  1. 3
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/aop/AopAutoConfiguration.java

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

@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.aop; @@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.aop;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.Advice;
import org.aspectj.weaver.AnnotatedElement;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -39,7 +40,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; @@ -39,7 +40,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
* @see EnableAspectJAutoProxy
*/
@Configuration
@ConditionalOnClass({ EnableAspectJAutoProxy.class, Aspect.class, Advice.class })
@ConditionalOnClass({ EnableAspectJAutoProxy.class, Aspect.class, Advice.class, AnnotatedElement.class })
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
public class AopAutoConfiguration {

Loading…
Cancel
Save