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

Maven 3.9.2 plugin warnings #1691

Closed
bmarwell opened this issue Jun 13, 2023 · 17 comments · May be fixed by #1692
Closed

Maven 3.9.2 plugin warnings #1691

bmarwell opened this issue Jun 13, 2023 · 17 comments · May be fixed by #1692

Comments

@bmarwell
Copy link
Contributor

Some oversights from my previous issue:
#1651

Actual behaviour

Will issue th efollowing warnings

[WARNING]  * io.openliberty.tools:liberty-maven-plugin:3.8
[WARNING]   Declared at location(s):
[WARNING]    * my.domain.package:my-module-integrationtests-openliberty:3.0.2-SNAPSHOT (my-module-integrationtests/openliberty/pom.xml) @ line 177
[WARNING]   Used in module(s):
[WARNING]    * my.domain.package:my-module-integrationtests-openliberty:3.0.2-SNAPSHOT (my-module-integrationtests/openliberty/pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-artifact:3.8.6, org.apache.maven:maven-plugin-api:3.8.6, org.apache.maven:maven-model:3.8.6]

Expected behaviour

No warnings

Resolution

PR follows

@bmarwell
Copy link
Contributor Author

Blocked by OpenLiberty/ci.common#404

@cherylking
Copy link
Member

@bmarwell I created a 3.8.3-SNAPSHOT for you to test with that includes the changes I made in ci.common to remove the maven-artifact dependency. Will that resolve the need for the workaround PR #1692 ?

@bmarwell
Copy link
Contributor Author

Hey @cherylking, that doesn't quite cut it:

[WARNING]  * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT
[WARNING]   Declared at location(s):
[WARNING]    * invalid.company.project:myapp-integrationtests-openliberty:3.0.3-SNAPSHOT (myapp-integrationtests/openliberty/pom.xml) @ line 182
[WARNING]   Used in module(s):
[WARNING]    * invalid.company.project:myapp-integrationtests-openliberty:3.0.3-SNAPSHOT (myapp-integrationtests/openliberty/pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin mixes multiple Maven versions: [3.6.3, 3.5.0]
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-plugin-api:3.5.0, org.apache.maven:maven-modulel:3.5.0, org.apache.maven:maven-artifact:3.6.3]

You can see these messages by running:

# needs Maven 3.9.2
# add clean/other goals goals/no build cache/profiles as needed
mvn verify -Dmaven.plugin.validation=VERBOSE

@cherylking
Copy link
Member

@bmarwell Ok, the warnings have changed though. The maven-artifact is no longer included in ci.common. So what accounts for the mix of multiple Maven versions? Where else does provided scope need to get added?

@cherylking
Copy link
Member

@bmarwell I just ran that command from the plugin project itself (I believe you ran it from a project that is configured to use our plugin instead). It flagged multiple plugins that we are using as a problem.

Problem 1:

[WARNING] Plugin validation issues were detected in 4 plugin(s)
[WARNING] 
[WARNING]  * org.apache.maven.plugins:maven-plugin-plugin:3.6.0
[WARNING]   Declared at location(s):
[WARNING]    * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT (pom.xml) @ line 85
[WARNING]   Used in module(s):
[WARNING]    * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT (pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin depends on the deprecated Maven 2.x compatibility layer, which may not be supported in Maven 4.x
...

Problem 2:

[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING]   Declared at location(s):
[WARNING]    * org.apache.maven:maven-core:3.9.2:default-lifecycle-bindings @ line -1
[WARNING]   Used in module(s):
[WARNING]    * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT (pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-plugin-api:3.2.5, org.apache.maven:maven-model:3.2.5, org.apache.maven:maven-core:3.2.5, org.apache.maven:maven-settings:3.2.5, org.apache.maven:maven-model-builder:3.2.5, org.apache.maven:maven-repository-metadata:3.2.5, org.apache.maven:maven-aether-provider:3.2.5, org.apache.maven:maven-settings-builder:3.2.5, org.apache.maven:maven-artifact:3.2.5]

Problem 3:

[WARNING]  * org.codehaus.mojo:animal-sniffer-maven-plugin:1.22
[WARNING]   Declared at location(s):
[WARNING]    * io.openliberty.tools:liberty-maven:3.8.3-SNAPSHOT (/Users/cherylking/gitForks/ci.maven/pom.xml) @ line 66
[WARNING]   Used in module(s):
[WARNING]    * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT (pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin is a Maven 2.x plugin, which will be not supported in Maven 4.x
...

Problem 4:

[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]   Declared at location(s):
[WARNING]    * org.apache.maven:maven-core:3.9.2:default-lifecycle-bindings @ line -1
[WARNING]   Used in module(s):
[WARNING]    * io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT (pom.xml)
[WARNING]   Mojo issue(s):
[WARNING]    * Mojo resources:resources (org.apache.maven.plugins.resources.ResourcesMojo)
[WARNING]      - Implements `Contextualizable` interface from Plexus Container, which is EOL.
...

I would think those would need to get resolved first? If plugins we are using have issues, then our plugin has those same issues.

@bmarwell
Copy link
Contributor Author

No, because the plugins you use for compilation are not part of the dependency tree. I will test my workaround next week in the trail to JCon. 😉

@cstamas
Copy link
Contributor

cstamas commented Jun 16, 2023

Please update your build: maven-plugin-plugin performs checks and emit (build time) these warnings starting with 3.6.2 version, while you use 3.6.0. Still, do NOT update to 3.6.2, rather go and update your plugin to latest, as there are known bugs in 3.6.2, so best to go straight to latest, currently 3.9.0.

We try our best to track these issues on "both ends" (build time and runtime), but if build time plugin versions are lagging, not much we can do...

@cherylking
Copy link
Member

cherylking commented Jun 21, 2023

fyi...I refreshed the 3.8.3-SNAPSHOT after merging PR #1695.

@cstamas The maven-plugin-plugin is now at 3.9.0 in the latest snapshot.

@cstamas
Copy link
Contributor

cstamas commented Jun 21, 2023

Here, this one fully gets rid of any warning (this build and downstream builds using this plugin) #1697

@cstamas
Copy link
Contributor

cstamas commented Jun 21, 2023

And related #1698

@jwalcorn
Copy link

jwalcorn commented Sep 8, 2023

FWIW, I'm seeing this too. A normal "mvn package" gives me this:

image

If I do a "mvn -D maven.plugin.validation=VERBOSE package", I see this:

image

I tried explicitly adding such plugin dependencies to my dependency list, but that didn't make the big yellow WARNING go away. So I'm following the guidance from the Maven output to "please notify plugin maintainers about reported issues".

@jwalcorn
Copy link

jwalcorn commented Sep 8, 2023

@cherylking
Copy link
Member

@jwalcorn You would need to use the 3.8.3-SNAPSHOT to have all the latest changes since our June release 3.8.2. We should be putting out a new release in the next couple of weeks. Hopefully it will resolve this issue.

@cherylking
Copy link
Member

We recently released version 3.10. I would love any feedback on whether all the warnings have been resolved at this point.

@bmarwell @jwalcorn @cstamas

@bmarwell
Copy link
Contributor Author

@cherylking sorry for the late reply. Yes, as far as I can tell they are gone for good. Thanks! :)

@cherylking
Copy link
Member

Based on the last comment, I am going to close this issue. If additional warnings pop up, please open a new issue. And thanks for all of your help on the changes needed for this!

@bmarwell
Copy link
Contributor Author

@cherylking maybe the last thing to do to silence all warnings:
#1693

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 a pull request may close this issue.

4 participants