Skip to content

Use Spring Boot autoconfigure-processor to optimize auto-configurations #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bclozel opened this issue Jul 5, 2018 · 2 comments
Closed
Milestone

Comments

@bclozel
Copy link
Contributor

bclozel commented Jul 5, 2018

As explained in the its reference documentation, Spring Boot provides a spring-boot-autoconfigure-processor.

This should be added as an optional dependency to the module that contains the AutoConfiguration classes (and contains the spring.factories file declaring them).

Once configured, this annotation processor will generate metadata at compile time and will help Spring Boot process those auto-configurations without loading the actual classes in some cases.

In this project, the spring-cloud-openfeign-core module declares auto-configurations but doesn't use this annotation processor. Could you add it to the build file of this module?

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-autoconfigure-processor</artifactId>
	<optional>true</optional>
</dependency>

Once added, this should generate a spring-autoconfigure-metadata.properties file in the target/classes/META-INF folder.

See spring-cloud/spring-cloud-commons#377

@ryanjbaxter
Copy link
Contributor

I thought I added this to all of our projects but I must have missed this one, thanks!

@ryanjbaxter ryanjbaxter added this to the 2.0.1.RELEASE milestone Jul 9, 2018
@hexiaogou
Copy link

As explained in the its reference documentation, Spring Boot provides a spring-boot-autoconfigure-processor.

This should be added as an optional dependency to the module that contains the AutoConfiguration classes (and contains the spring.factories file declaring them).

Once configured, this annotation processor will generate metadata at compile time and will help Spring Boot process those auto-configurations without loading the actual classes in some cases.

In this project, the spring-cloud-openfeign-core module declares auto-configurations but doesn't use this annotation processor. Could you add it to the build file of this module?

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-autoconfigure-processor</artifactId>
	<optional>true</optional>
</dependency>

Once added, this should generate a spring-autoconfigure-metadata.properties file in the target/classes/META-INF folder.

See spring-cloud/spring-cloud-commons#377

Thank you for your advice to the author, so the spring-autoconfigure-metadata.properties contained the feign configuration information ever since Finchley.SR2 version. I found this problem when I used IDEA IDE for studing Spring-Cloud-Feign knowledge with no auto tip during setting application.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants