什么是 spring-boot-configuration-processor ?为什么人们将图书馆排除在外?为什么它在依赖树中不可见? [英] What is the spring-boot-configuration-processor ? Why do people exclude libraries from it? Why is it invisible in dependency tree?

查看:26
本文介绍了什么是 spring-boot-configuration-processor ?为什么人们将图书馆排除在外?为什么它在依赖树中不可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

于是我注意到 jhipster 项目的 gradle 文件中有以下一行:

So I noticed the following line in the gradle file of the jhipster project:

annotationProcessor ("org.springframework.boot:spring-boot-configuration-processor") {
        exclude group: 'com.vaadin.external.google', module: 'android-json'
    }

https://github.com/jhipster/jhipster-sample-app-gradle/blob/9e9c3db8f3bedba4b1efd85ecb6ff3f12a5f596a/build.gradle#L230

我们在另一个项目中也使用了Maven中相同的配置来解决以下问题:Maven瞬态依赖(library/jar vaadin json)没有被排除在外

We also used the same configuration in Maven for another project to solve the following problem: Maven transient dependency (library/jar vaadin json) is not being excluded

现在我有以下问题:

  • spring-boot-configuration-processor 依赖有什么作用?
  • 为什么有时需要从处理器中排除依赖项?
  • 为什么处理器不一定出现在 mvn 依赖树中?
  • 为什么在很难排除依赖项的情况下将排除与处理器一起使用?

推荐答案

spring-boot-configuration-processor 是一个注解处理器,用于生成有关应用程序中使用 进行注解的类的元数据@ConfigurationProperties.IDE(Eclipse、IntelliJ 或 NetBeans)使用此元数据在编辑 application.propertiesapplication.yaml 文件时为属性提供自动完成和文档.您可以在 Spring Boot 参考文档的相关部分.

spring-boot-configuration-processor is an annotation processor that generates metadata about classes in your application that are annotated with @ConfigurationProperties. This metadata is used by your IDE (Eclipse, IntelliJ, or NetBeans) to provide auto-completion and documentation for the properties when editing application.properties and application.yaml files. You can learn a bit more about it in the relevant section of Spring Boot's reference documentation.

自 Spring Boot 1.5.10 起,不再需要排除,因为 com.vaadin.external.google:android-json 不再是 spring-boot-configuration- 的依赖项处理器.

Since Spring Boot 1.5.10, the exclusion is no longer necessary as com.vaadin.external.google:android-json is no longer a dependency of spring-boot-configuration-processor.

这篇关于什么是 spring-boot-configuration-processor ?为什么人们将图书馆排除在外?为什么它在依赖树中不可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆