Allow updating POM automatically to match rules
electrum opened this issue · comments
As an example, the https://mycila.carbou.me/license-maven-plugin/ has the license:format
goal to update license headers in project files, in addition to the license:check
goal. This probably requires an additional Mojo in addition to the Enforcer rule, and is likely a lot of work, but would be nice.
Hi, I can assure you that this is a lot of work bevause I have already tried. Unfortunately, the implementation never made it further than alpha stadium. There are quite a few challenges to deal with:
- Walking up the POM hierarchy manually to gather all information
- Moving sections between different POM files, e.g. when fixing complaints of the PedanticDependencyManagementLocationEnforcer.
- Some things are impossible to fix, e.g. when POM sections need to be moved but the target POM is not part of the same maven project
- Preserving the POM formatting including comments
- …
In combination with me having a very limited amount of spare time to work on Open Source projects I think this feature will not get implemented soon. Probably never.