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
This commit is contained in:
parent
edee342d80
commit
49d249bdf4
|
|
@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.aop;
|
||||||
|
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.reflect.Advice;
|
import org.aspectj.lang.reflect.Advice;
|
||||||
|
import org.aspectj.weaver.AnnotatedElement;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
|
@ -39,7 +40,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
* @see EnableAspectJAutoProxy
|
* @see EnableAspectJAutoProxy
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@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)
|
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
|
||||||
public class AopAutoConfiguration {
|
public class AopAutoConfiguration {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue