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

Layered bootJar task causes warnings when custom source set is present in the project #22200

Closed
dmurat opened this issue Jul 2, 2020 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@dmurat
Copy link

dmurat commented Jul 2, 2020

I'm using bootJar task with a layered feature enabled on a project with the custom source set - testIntegration. Everything works as expected and there are no errors of any kind. However, Gradle produces warnings in the output like in the following truncated example:

The testIntegrationCompile configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0 ...
The testIntegrationCompileOnly configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0 ...
The testIntegrationRuntime configuration has been deprecated for resolution. This will fail with an error in Gradle 7.0 ...

After some debugging, I was able to pin the cause at the LayerResolver.processConfiguration() private method. It uses the DEPRECATED_FOR_RESOLUTION_CONFIGURATIONS for filtering Configurations that should not be resolved for dependencies. Since my project contains a custom source set with corresponding configurations extended from testImplementation and testRuntimeOnly, deprecated configurations sneak-in via Gradle's configuration hierarchy.

As bootJar tasks already filters-out hardcoded set of deprecated configuration names, maybe it makes sense to expand this filtering for custom configurations whose names end with Compile, CompileOnly and Runtime. When Gradle 7.0 will be released, I guess warnings will not be present since I'm expecting that Gradle will not include deprecated configurations in the hierarchy built with extendsFrom.

I don't have a simple example for demonstrating the issue, but you can check out this project project and run ./gradlew -p cargotracker/cargotracker-booking-queryside-rdbms-projection-app clean bootJar --warning-mode all from project root. Related build.gradle is here.

Spring Boot: 2.3.1.RELEASE
Gradle: 6.5
JDK: 11.0.7

Tnx.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 2, 2020
@wilkinsona wilkinsona changed the title Gradle Plugin - layered bootJar tasks causes warnings when custom source set is present in the project Layered bootJar task causes warnings when custom source set is present in the project Jul 2, 2020
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 2, 2020
@wilkinsona wilkinsona added this to the 2.3.x milestone Jul 2, 2020
@wilkinsona wilkinsona self-assigned this Jul 2, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.3.2 Jul 2, 2020
dmurat added a commit to croz-ltd/klokwrk-project that referenced this issue Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants