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-7667] Fix Bootstrap IT #230

Merged
merged 4 commits into from
Jan 12, 2023
Merged

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Jan 12, 2023

This change extends Bootstrap IT (1st IT that fills in local repo) to hunt down some plugins that are bound in lifecycles provided by Maven under test.

Changes:

  • the Bootstrap IT invokes only the phase where DownloadMojo is bound
  • DownloadMojo (the "bootstrap") changed to do "this or that": it either resolves all artifacts from provided file OR collects plugins for given project packaging plugin versions provided by tested Maven default lifecycle.
  • Split more Bootstrap project POMs, now we have 4 modules, we can add more (even extension if needed)

https://issues.apache.org/jira/browse/MNG-7667

This change hunts down m-install-p and m-deploy-p versions from
tested Maven (the one bound in default lifecycle) and resolves them
and their dependencies. This makes IT pass for me with both, non
updated Maven 3.9.0 and updated 3.9.0 re lifecycle plugins.

The ITs exectute this mojo in Bootstrap IT that executes with
pom that has packaging=pom, but the m-install-p and m-deploy-p
are still present. The "proper" fix would be to somehow grab the
versions of ALL plugins in all lifecycles burned in currently
tested Maven, but unsure how to achieve that.
@cstamas
Copy link
Member Author

cstamas commented Jan 12, 2023

This fixes the original issue, but now (with apache/maven#956) we face other issue: all the ITs that use maven-plugin packaging and do verifier.verifyErrorFreeLog will fail, as m-plugin-p emits ERRORs that should be WARNs instead...

Example:

[INFO]
[INFO] --- plugin:3.7.0:descriptor (default-descriptor) @ plugin-extension ---
[ERROR]

Some dependencies of Maven Plugins are expected to be in provided scope.
Please make sure that dependencies listed below declared in POM
have set '<scope>provided</scope>' as well.

The following dependencies are in wrong scope:
 * org.apache.maven:maven-model:jar:3.8.6:compile
 * org.apache.maven:maven-artifact:jar:3.8.6:compile
 * org.apache.maven:maven-resolver-provider:jar:3.8.6:compile
 * org.apache.maven:maven-model-builder:jar:3.8.6:compile
 * org.apache.maven:maven-builder-support:jar:3.8.6:compile
 * org.apache.maven:maven-repository-metadata:jar:3.8.6:compile



[INFO] Using 'UTF-8' encoding to read mojo source files.
[INFO] java-annotations mojo extractor found 0 mojo descriptor.
[INFO] java-javadoc mojo extractor found 1 mojo descriptor.
[WARNING]
[WARNING] Deprecated extractor java-javadoc extracted 1 descriptor. Upgrade your Mojo definitions.
[WARNING] You should use Mojo Annotations instead of Javadoc tags.
[WARNING]
[INFO] ant mojo extractor found 0 mojo descriptor.
[INFO] bsh mojo extractor found 0 mojo descriptor.
[INFO]
[INFO] --- resources:3.3.0:testResources (default-testResources) @ plugin-extension ---

This is logged as https://issues.apache.org/jira/browse/MPLUGIN-452

@cstamas cstamas changed the title [MNG-7667] Partial fix that "works for me" [MNG-7667] Fix Bootstrap IT Jan 12, 2023
Finish the PoC, split properly and explain what is happening,
@cstamas cstamas marked this pull request as ready for review January 12, 2023 20:27
@cstamas cstamas merged commit b730d33 into apache:master Jan 12, 2023
@cstamas cstamas deleted the MNG-7667-partial-fix branch January 12, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants