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

Please fix the scopes to provided that are provided by maven itself #275

Closed
hazendaz opened this issue Jun 22, 2023 · 5 comments · Fixed by #290
Closed

Please fix the scopes to provided that are provided by maven itself #275

hazendaz opened this issue Jun 22, 2023 · 5 comments · Fixed by #290
Milestone

Comments

@hazendaz
Copy link

Per maven they require scopes provided. At the moment, I'm using helger copy latest but it has same issue. While this one appears slightly different in setup, over on that one the following 4 are scoped incorrectly as compile scope and need to be provided scope: maven artifact, maven model, maven plugin api, and maven settings. You should see these very obvious in running any recent maven, but try maven 3.9.2 for most immediate feedback on the issue to resolve.

@laurentschoelens
Copy link
Collaborator

Not tryed on maven 3.9 branch to build this project but this issue will be treated on 2.x branch (so before jakarta migration)

@laurentschoelens
Copy link
Collaborator

@hazendaz : could you tell me more about this issue.
I've seen when building that maven complains itself that scopes aren't provided as expected but build is OK, even with maven 3.9
I've also tested to use plugin with maven 3.9 and no issue running the plugin itself.
Is this issue "just solving provided scope" to me more consistant with maven-plugin-plugin

[INFO] --- maven-plugin-plugin:3.7.1:descriptor (default-descriptor) @ jaxb-maven-plugin ---
[WARNING] 

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-plugin-api:jar:2.0.9:compile
 * org.apache.maven:maven-project:jar:2.0.9:compile
 * org.apache.maven:maven-settings:jar:2.0.9:compile
 * org.apache.maven:maven-profile:jar:2.0.9:compile
 * org.apache.maven:maven-model:jar:2.0.9:compile
 * org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
 * org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
 * org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
 * org.apache.maven:maven-artifact:jar:2.0.9:compile

@hazendaz
Copy link
Author

hazendaz commented Jul 3, 2023

@laurentschoelens A plugin is ran in a version of maven such as 3.8.1. Maven already provides all the dependencies its flagging in the maven distribution (easy to take a look inside maven distribution). So its doing two things wrong, 1) loading extra libraries into m2/repository that just waste space and 2) forcing older behaviour of maven within the plugin.

All those you listed indicate maven 2 usage and are from 2008 which isn't appropriate in any maven 3. Most likely when you make them provided you will discover support is anywhere from 3.2.5 to 4.0.0 without any trouble give or take depending on your other plugin usage to build. You should use the latest official maven release versions though (3.9.3). Maven 3 still allows that abuse but maven 4 blocks it so if the plugin is truly dependent on maven 2 artifacts it will break in maven 4. So effectively what you end up doing is 2 fold, allows maven to work better based off the provided maven used and to not include additional downloads into m2 cache unnecessarily. The unnecessary downloads IMO is more important since most CI systems start with no cache these days so every extra unnecessary download that is not pulled is a benefit.

Nearly all mainstream (highly used) maven plugins have already been fixed. Finding the one off ones are a bit more difficult. I track some 150 or so plugins in a supper pom including the jaxb plugins and had too preemptive steps early in 2022 to simply override the inclusions to latest maven version being used by the build. When I raised this ticket, I also raised ticket on probably 20 or so various plugins more so as I figured maybe faster than me forking all of them and doing the work. Eventually I want to remove the overrides I put in place for the space savings outright.

@laurentschoelens
Copy link
Collaborator

Thanks @hazendaz from your long and complete answer to my question.
We'll try to fix this as soon as possible (already treated with 2.x version the renaming of the plugin from maven-jaxb2-plugin to jaxb-maven-plugin)

@laurentschoelens
Copy link
Collaborator

@hazendaz : issue fixed in release v2.0.4

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.

3 participants