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

MNG-5577 convert most of maven core to jsr330 annotations #332

Conversation

josephw
Copy link
Contributor

@josephw josephw commented Apr 1, 2020

The aim of this PR is to get git grep 'org.codehaus.plexus.component.annotations' maven-core/src/main/java/ down as low as possible; it covers everything except DefaultLifecyclePluginAnalyzer.

(For DefaultLifecyclePluginAnalyzer, switching @Requirement to @Inject for lifecycleMappings means it's no longer wired up with a RealmFilteredBeans, and MNG-4385 regresses.)

Tests are also simplified, to avoid injection in tests of concrete classes, and remove some no-longer-used mocks.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • [ x Format the pull request title like [MNG-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MNG-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

josephw added 3 commits April 2, 2020 00:36
- Reduce the use of wiring in unit tests
- Enable class scanning for tests that require it.
- Remove test and wiring that's not used.
This class was deleted, but retained in tests. We don't need
it anymore, so drop it.
Convert (almost) all Plexus components in maven-core to JSR 330
annotations.
@slachiewicz
Copy link
Member

I found one issue with Intellij check this stacktrace:
https://gist.github.com/slachiewicz/56bab10ce43c8da6a548002fb9a31bbc

Copy link
Member

@slachiewicz slachiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 all our ITs passed ok, Jenkins is Green also for each separate commit. https://builds.apache.org/job/maven-box/job/maven/job/MNG-5577/3/

@olamy
Copy link
Member

olamy commented Apr 2, 2020

core IT?

@slachiewicz
Copy link
Member

Yes, core it is green

@michael-o
Copy link
Member

Folks, do have have a way to run this PR against all Plugin ITs? I'd like to avoid the same situation as with the multiple POM loads against Maven Shade Plugin.

@rfscholte
Copy link
Contributor

Why do we keep changing maven-compat? By showing it is maintained it will be harder to convince projects to drop it.

@michael-o no, unless somebody has it all on his system, he can easily make an aggregator for it. But I'm not so worried about this. The loop was caused by new implementations, this is a clear replacement. Plugins that might be hit are more likely the tiles-maven-plugin and polyglot-maven-plugin.

@michael-o
Copy link
Member

Running ITs here too...

@josephw
Copy link
Contributor Author

josephw commented Apr 2, 2020

Why do we keep changing maven-compat?

The changes to maven-compat are test-only; a couple are necessary to wire up the classes from maven-core after this change, another couple are simplifications.

I'd be delighted if the module wasn't there at all, and would also support formally WONTFIX'ing MNG-6687.

@slachiewicz
Copy link
Member

It's worth to do change also in maven-compat as we have few implementation beans that are required for maven to run.

Quick check - rename maven-compat.jar in Maven installation and try to run something. ;-)

I have few more commits almost ready to get rid off plexus annotations that we can review later.

@rfscholte
Copy link
Contributor

I issued https://issues.apache.org/jira/browse/MNG-5995 so I am aware of the awkward compat situation. However this shouldn't be solved in compat, but in core. mven-compat should be conisdered dead code, it was there to keep Maven2 plugins compatible with Maven 3. I prefer to spend energy on the other modules.

@asfgit asfgit closed this in 9567da2 Apr 2, 2020
asfgit pushed a commit that referenced this pull request Jun 21, 2020
Convert (almost) all Plexus components in maven-core to JSR 330 annotations

Closes #332
gnodet pushed a commit to gnodet/maven that referenced this pull request Nov 20, 2024
Adds an IT that verifies that "ide" WorkspaceReader is used by Maven.
Relates to fix apache@3f47580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants