目的是什么:
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
无论有没有它,我的应用程序都可以正常工作。我创建的薄罐子在依赖项目中也运行良好。
我问这个问题是因为当我将它包含在本地 build.gradle 中时,该行工作正常。但当我将其推送到云端时,我收到此错误:
在 org.gradle.api.internal.artifacts.dsl.dependency.DefaultDependencyHandler 类型的对象上找不到参数 [org.springframework.boot:spring-boot-autoconfigure-processor] 的方法 commentProcessor()。
所以我想不要它。我没有看到对 Thin jar 或依赖项目有任何影响。
Also, 这一页 https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-auto-configuration.html#boot-features-custom-starter-module-autoconfigure说我在使用 Gradle 4.6 或更高版本时必须在 build.gradle 中使用annotationProcessor。如果我在 Gradle 4.8 中使用compileOnly 选项会怎样?
spring-boot-autoconfigure-processor
是生成文件的注释处理器META-INF/spring-autoconfigure-metadata.properties
包含在您的项目的 jar 中。此文件有助于缩短启动时间,但对于您的应用程序正常运行来说并不是必需的。
From the docs https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-custom-starter-module-autoconfigure:
如果该文件存在,则用于急切过滤
不匹配的自动配置,这将改善启动
时间。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)