pedantic-pom-enforcers icon indicating copy to clipboard operation
pedantic-pom-enforcers copied to clipboard

Allow updating POM automatically to match rules

Open electrum opened this issue 3 years ago • 1 comments
trafficstars

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.

electrum avatar Nov 25 '21 15:11 electrum

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.

ferstl avatar Dec 07 '21 06:12 ferstl