diff --git a/README.md b/README.md index ae4babb..87e2780 100644 --- a/README.md +++ b/README.md @@ -51,19 +51,19 @@ mica auto 采用 Annotation Processor,她不是什么新技术,在 jdk 1.6 net.dreamlu mica-auto - 2.3.1 + 2.3.2 provided ``` ### gradle >= 5.x ```groovy -annotationProcessor("net.dreamlu:mica-auto:2.3.1") +annotationProcessor("net.dreamlu:mica-auto:2.3.2") ``` ### gradle < 5.x ```groovy -compileOnly "net.dreamlu:mica-auto:2.3.1" +compileOnly "net.dreamlu:mica-auto:2.3.2" ``` ## 原理 diff --git a/README_EN.md b/README_EN.md index 5705e2a..cf472d6 100644 --- a/README_EN.md +++ b/README_EN.md @@ -49,19 +49,19 @@ It is mainly used to avoid the inconsistency between the Spring Boot main projec net.dreamlu mica-auto - 2.3.1 + 2.3.2 provided ``` ### gradle >= 5.x ```gradle -annotationProcessor("net.dreamlu:mica-auto:2.3.1") +annotationProcessor("net.dreamlu:mica-auto:2.3.2") ``` ### gradle < 5.x ```gradle -compileOnly "net.dreamlu:mica-auto:2.3.1" +compileOnly "net.dreamlu:mica-auto:2.3.2" ``` ## Principle diff --git a/build.gradle b/build.gradle index 1e8b8ef..1ef4db2 100644 --- a/build.gradle +++ b/build.gradle @@ -3,10 +3,10 @@ apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle" ext { javaVersion = JavaVersion.VERSION_1_8 - springBootVersion = "2.7.0" + springBootVersion = "2.7.7" lombokVersion = "1.18.24" googleAutoVersion = "1.0.1" - compileTestingVersion = "0.19" + compileTestingVersion = '0.21.0' incapVersion = "0.3" } diff --git a/gradle.properties b/gradle.properties index 78c31da..d58a4ea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION=2.3.1 +VERSION=2.3.2 GROUPID=net.dreamlu NEXUS_OSS_USER_NAME=*** diff --git a/src/main/java/net/dreamlu/mica/auto/common/BootAutoType.java b/src/main/java/net/dreamlu/mica/auto/common/BootAutoType.java index 180eb4b..4bffd35 100644 --- a/src/main/java/net/dreamlu/mica/auto/common/BootAutoType.java +++ b/src/main/java/net/dreamlu/mica/auto/common/BootAutoType.java @@ -32,7 +32,7 @@ public enum BootAutoType { /** * Component,组合注解,添加到 spring.factories */ - COMPONENT("org.springframework.stereotype.Component", "org.springframework.boot.autoconfigure.EnableAutoConfiguration"), + COMPONENT(BootAutoType.COMPONENT_ANNOTATION, "org.springframework.boot.autoconfigure.EnableAutoConfiguration"), /** * ApplicationContextInitializer 添加到 spring.factories */ @@ -90,4 +90,6 @@ public enum BootAutoType { private final String annotation; private final String configureKey; + public static final String COMPONENT_ANNOTATION = "org.springframework.stereotype.Component"; + } diff --git a/src/main/java/net/dreamlu/mica/auto/factories/AutoFactoriesProcessor.java b/src/main/java/net/dreamlu/mica/auto/factories/AutoFactoriesProcessor.java index ea869de..5e5732a 100644 --- a/src/main/java/net/dreamlu/mica/auto/factories/AutoFactoriesProcessor.java +++ b/src/main/java/net/dreamlu/mica/auto/factories/AutoFactoriesProcessor.java @@ -148,8 +148,8 @@ private void processAnnotations(Set annotations, RoundEnv log("读取到新配置 spring.factories factoryName:" + factoryName); factories.put(FEIGN_AUTO_CONFIGURE_KEY, factoryName); } else { - // 1. 生成 2.7.x 的 @AutoConfiguration - if (isAnnotation(elementUtils, typeElement, AUTO_CONFIGURATION)) { + // 1. 生成 2.7.x 的 spi + if (isAnnotation(elementUtils, typeElement, BootAutoType.COMPONENT_ANNOTATION)) { String autoConfigurationBeanName = typeElement.getQualifiedName().toString(); autoConfigurationImportsSet.add(autoConfigurationBeanName); log("读取到自动配置 @AutoConfiguration:" + autoConfigurationBeanName);