Skip to content

Conversation

wickdynex
Copy link
Contributor

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

  • Refactor feature
  • Modify related tests
  • Documentation update

Checklist

  • I have reviewed the code for any potential issues or improvements.
  • I have run tests locally and they are passing.
  • I have followed the coding style and conventions of the project.

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~

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 15, 2024
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 15, 2024
@philwebb philwebb added this to the 3.2.x milestone Nov 15, 2024
@wickdynex wickdynex force-pushed the fix/remove-deprecated-getFiles-warning branch 3 times, most recently from 6a08d2f to 553f7f2 Compare November 17, 2024 08:10
@mhalbritter mhalbritter self-assigned this Nov 19, 2024
@mhalbritter
Copy link
Contributor

Thanks @wickdynex !

@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.2.12 Nov 19, 2024
@wickdynex
Copy link
Contributor Author

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🥳.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants