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

Gradle Plugin "Getting Started" documentation section out of date #40954

Closed
SimoneGiusso opened this issue May 30, 2024 · 3 comments
Closed

Gradle Plugin "Getting Started" documentation section out of date #40954

SimoneGiusso opened this issue May 30, 2024 · 3 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@SimoneGiusso
Copy link

Here it is suggested to apply the io.spring.dependency-management plugin using a legacy method to apply the plugin (source -> here).

Apply the plugin in this way, doesn't give access to the API the plugin offers to access for instance, the managedVersions as explained here.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 30, 2024
@SimoneGiusso SimoneGiusso changed the title [Documentation] Gradle Plugin Getting Started documentation section out of date [Documentation] Gradle Plugin "Getting Started" documentation section out of date May 30, 2024
@wilkinsona
Copy link
Member

There are pros and cons to the two approaches. As the dependency management plugin is a dependency of Spring Boot's plugin, using apply allows the plugin to be applied without specifying its version. The alternative is discussed elsewhere in the documentation.

Apply the plugin in this way, doesn't give access to the API the plugin offers

I'm not aware of any differences in terms of the API that's available when using one of the two methods of applying the plugin. Can you please provide a minimal example that reproduces the behavior you've described?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label May 30, 2024
@SimoneGiusso
Copy link
Author

SimoneGiusso commented May 30, 2024

I'm not aware of any differences in terms of the API that's available when using one of the two methods of applying the plugin. Can you please provide a minimal example that reproduces the behavior you've described?

You can use this project and simply add dependencyManagement.managedVersions["org.springframework:spring-core"]!! here, between line 53 and 54 and run ./gradlew clean build assemble. It should fail.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 30, 2024
@wilkinsona
Copy link
Member

Thanks. That's a limitation of the Kotlin DSL that's briefly mentioned in Gradle's documentation. As shown in the documentation for Boot's Gradle plugin that I linked to above, you need to use the the<T>() function:

the<io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension>().managedVersions["org.springframework:spring-core"]

Given this, and the pros and cons discussed above, I don't think we should make a change here. This may change in the future depending on spring-io/initializr#1428.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@wilkinsona wilkinsona changed the title [Documentation] Gradle Plugin "Getting Started" documentation section out of date Gradle Plugin "Getting Started" documentation section out of date May 30, 2024
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants