Skip to content

spring-boot-security brings test dependencies #47813

@marcrohlfs

Description

@marcrohlfs

module/spring-boot-security/build.gradle declares api(project(":core:spring-boot-test-autoconfigure")). I think it should rather be scoped with testImplementation. This api scoping transitively brings the spring-boot-test and spring-test into production dependencies, too.

We noticed this, because we're banning test dependencies from non-test classpaths and got the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.6.2:enforce (enforce-onerepo-rules) on project foo-bar:
[ERROR] Rule 2: com.coremedia.maven.enforcer.BannedDependenciesRule(bannedDependencies) failed with message:
[ERROR] com.acme:foo-bar:jar:1.0-SNAPSHOT
[ERROR]    org.springframework.boot:spring-boot-security:jar:4.0.0-RC1
[ERROR]       org.springframework.boot:spring-boot-test-autoconfigure:jar:4.0.0-RC1
[ERROR]          org.springframework.boot:spring-boot-test:jar:4.0.0-RC1 <--- banned via the exclude/include list

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions