spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.35k stars 40.72k forks source link

Remove deprecated getFiles() instead of getResolvedArtifacts() #43191

Closed wickdynex closed 6 days ago

wickdynex commented 1 week ago

Description

This PR removes the usage of the deprecated getFiles() method in CheckBom.class and replaces it with the newer getResolvedArtifacts() method. The getFiles() method was deprecated due to its potential for incorrect behavior and its reliance on legacy API, while getResolvedArtifacts() provides a more reliable and modern approach to resolving dependencies.

Backward compatibility

This change is fully backward-compatible and does not affect the existing functionality of the BOM resolution process. The getResolvedArtifacts() method is a direct replacement for getFiles() and provides the same functionality but with updated API usage.


Related Issue

Fixed #43142


Type of Change


Checklist


Screenshots

Run Tests

image

Remove Warning

Before

image

After

image

Additional Notes

To display warning correctly, I modified the build.gradle file, and use command ./gradlew :buildSrc:compileJava --rerun-tasks -Duser.language=en to show the warning obviously. But, I did't find the test class named CheckBomTests, but BomPluginIntegrationTests instead. I don't know whether it covers the method resolveBom() in CheckBom, so TDD workflow doesn't work. If there's some mistake, please leave a comment. Thanks~

mhalbritter commented 6 days ago

Thanks @wickdynex !

wickdynex commented 6 days ago

Thanks @wickdynex !

You're welcome! It's glad to help with this issue, and work in this community🥰. I also appreciate you for polishing my PR🥳.