Skip to content
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

Excludes applied on @ImportAutoConfiguration are not consistently applied #12586

Closed
snicoll opened this issue Mar 21, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@snicoll
Copy link
Member

commented Mar 21, 2018

Excludes applied on AutoConfigurationImportSelector implementations (@EnableAutoConfiguration or @ImportAutoConfiguration) are only applied for the auto-configurations they're locally importing. They don't exclude anything added by another import.

Fixing this requires fixing #12366 first

@snicoll snicoll added this to the Backlog milestone Mar 21, 2018

@snicoll snicoll self-assigned this Apr 17, 2018

@snicoll

This comment has been minimized.

Copy link
Member Author

commented May 28, 2018

To fix this one we probably need to expand what AutoConfigurationGroup does by calling a dedicated method that keeps track of what was retrieved for each instance of the group, applying the excludes and filtering at the very end. This also means that one event would be fired (rather than one per annotation at the moment). We could also keep firing separate events if we kept track of the instance of the selector though this is not really interesting (compared to the root class where the annotation was added).

@philwebb philwebb changed the title excludes applied on @ImportAutoConfiguration are not consistently applied Excludes applied on @ImportAutoConfiguration are not consistently applied May 29, 2018

@snicoll

This comment has been minimized.

Copy link
Member Author

commented Jul 17, 2018

Interesting side effect. If you're running a test with @SpringBootTest and @AutoConfigureMockMvc and you've excluded Spring Security, the security applies anyway as the mock mvc auto-config is secured by default and imports the security bits again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.