Skip to content

Metadata provided by ImportAware ignores conditions and is dependent on the order of the configuration classes [SPR-12128] #16744

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-12128 and commented

This is related to #16410. It's probably best illustrated with the attached tests.

There are two configuration classes involved: ConfigurationOne and ConfigurationTwo. Both import SomeConfiguration via @EnableSomeConfiguration, however ConfigurationTwo is skipped due to a condition. The problem appears to be that the logic that drives setImportMetadata doesn't consider multiple imports or that some of them may have been skipped: it always passes in the metadata from the last import that was processed. This is illustrated by the two tests in the attached file.

In the event of a single unskipped imported, I'd expect it to provide the metadata and, therefore, for the order in which the configuration classes are processed to make no difference.


Affects: 4.0.6

Reference URL: spring-projects/spring-boot#1451

Attachments:

Issue Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions