Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pmd-compat6 module for maven-pmd-plugin #4741

Merged
merged 8 commits into from Nov 18, 2023

Conversation

adangel
Copy link
Member

@adangel adangel commented Nov 9, 2023

This makes it possible to use PMD7 with maven-pmd-plugin

Describe the PR

This is now a different approach, the idea is from @kohlschuetter (see #4609).

I could successfully run now maven-pmd-plugin 3.21.2 with PMD 7.0.0-rc4, by just adding this module as an additional dependency.

My plans for this module:

  • Once this is merged, manually release just this module as version 7.0.0-rc4, so that it is available as net.sourceforge.pmd:pmd-compat6:7.0.0-rc4 in maven central for everybody.
  • Then change the version of this module to 7.0.0-SNAPSHOT. It will be part of the main build.
  • It will be released together with final 7.0.0 (or another rc, whatever comes first)
  • It's only necessary, until maven-pmd-plugin is updated to use by default PMD 7. As changing defaults is considered a breaking change, the maven-pmd-plugin would also need a major version bump. In any case, with this module, we are decoupled now a bit more.
  • We might already dump this module, after we released 7.0.0, not sure, how long we really want to maintain backwards compatibility. Maybe we should make this very clear.
  • This module seems to be a good candidate to collect our @DeprecatedUntil700 annotated methods/classes.
  • The module is intended to be used by maven-pmd-plugin users, but it might be useful in other contexts (although no guarantee is given, that it works)

Note: In no way, this module restores compatibility on the AST level - that means, that users have to migrate their rules/Xpaths in order to use PMD 7.

Some downsides of this approach:

  • A couple of classes are duplicated now in pmd-compat6. If we change them in pmd-core, we should also change them now in pmd-compat6. pmd-compat6 contains a couple of integration tests to be sure, that maven can still execute PMD, so we should be able to catch the most obvious problems.

Advantages:

  • We can update to 7.0.0-rc4 when running maven-pmd-plugin in our build. I tested it locally, and it worked.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)
  • Release notes update
  • Migration guide (this module is a shortcut and may allow to postpone the migration for a while)

This makes it possible to use PMD7 with maven-pmd-plugin
@adangel adangel added the an:enhancement An improvement on existing features / rules label Nov 9, 2023
@adangel adangel added this to the 7.0.0 milestone Nov 9, 2023
@pmd-test
Copy link

pmd-test commented Nov 9, 2023

1 Message
📖 No regression tested rules have been changed.

Generated by 🚫 Danger

pom.xml Show resolved Hide resolved
@adangel
Copy link
Member Author

adangel commented Nov 18, 2023

FYI - I'm going to merge this now and release net.sourceforge.pmd:pmd-compat6:7.0.0-rc4

adangel added a commit to adangel/pmd that referenced this pull request Nov 18, 2023
Add pmd-compat6 module for maven-pmd-plugin pmd#4741
@adangel adangel merged commit aed95e6 into pmd:master Nov 18, 2023
3 checks passed
@adangel adangel deleted the pmd-compat6-module branch November 18, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants