Skip to content

Conversation

@slawekjaranowski
Copy link
Member

@slawekjaranowski slawekjaranowski commented Oct 14, 2025

  • Add support for Maven 4 PluginDescriptor.getRequiredJavaVersion() method

This commit enhances the PluginDescriptorHelper class to support the getRequiredJavaVersion() and setRequiredJavaVersion() methods directly on the PluginDescriptor class in Maven 4.

The implementation:

  1. Uses reflection to check if the methods exist in the current Maven version
  2. Tries to use the direct methods first if available (Maven 4)
  3. Falls back to the existing wrapper approach if needed (Maven 3)

This approach ensures backward compatibility while taking advantage of the new methods in Maven 4.

  • Add missing files

(cherry picked from commit b939390)

* Add support for Maven 4 PluginDescriptor.getRequiredJavaVersion() method

This commit enhances the PluginDescriptorHelper class to support the getRequiredJavaVersion()
and setRequiredJavaVersion() methods directly on the PluginDescriptor class in Maven 4.

The implementation:
1. Uses reflection to check if the methods exist in the current Maven version
2. Tries to use the direct methods first if available (Maven 4)
3. Falls back to the existing wrapper approach if needed (Maven 3)

This approach ensures backward compatibility while taking advantage of the new methods in Maven 4.

* Add missing files

(cherry picked from commit b939390)
@slawekjaranowski slawekjaranowski added this to the 3.15.2 milestone Oct 14, 2025
@slawekjaranowski slawekjaranowski added the bug Something isn't working label Oct 14, 2025
@slawekjaranowski slawekjaranowski self-assigned this Oct 14, 2025
@slawekjaranowski
Copy link
Member Author

@gnodet I'm not sure if we should label it as bug ... rather it is enhancement or maintenance

@slawekjaranowski slawekjaranowski added maintenance and removed bug Something isn't working labels Oct 17, 2025
@slawekjaranowski slawekjaranowski merged commit facedc9 into apache:maven-plugin-tools-3.x Oct 17, 2025
20 checks passed
@slawekjaranowski slawekjaranowski deleted the cp-401 branch October 17, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants