Skip to content

Scope of some dependencies has changed from compile to runtime #21507

@michael-simons

Description

@michael-simons

The scope of org.springframework.boot:spring-boot-test has been changed from compile to runtime from 2.2.x to 2.3. spring-boot-test comes as dependency of spring-boot-test-autoconfigure.

[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.6.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-test:jar:2.2.6.RELEASE:compile

vs

[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.3.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.3.0.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-test:jar:2.3.0.RELEASE:runtime

This is a breaking change for library developers providing custom test autoconfiguration. For example, using SpringBootTestContextBootstrapper to provide additional properties.

SpringBootTestContextBootstrapper is considered public API:

{@link TestContextBootstrapper} for Spring Boot. Provides support for
{@link SpringBootTest @SpringBootTest} and may also be used directly or subclassed.

As a workaround I can change the scope back to compile again in our Maven build or include the dependency manually, but the change came as a surprise to us.

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions