[ 
https://issues.apache.org/jira/browse/MPLUGIN-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461223#comment-17461223
 ] 

Romain Manni-Bucau commented on MPLUGIN-385:
--------------------------------------------

[~kwin] this is technically only possible if you have a compatibility with past 
*and* future version to respect "Very true, but both version and scope should 
IMHO be determined from the minimum Maven version the plugin claims to be 
compatible with", it is quite unlikely and in terms of testing requires a new 
setup we don't have so just moving to scope=provided is very risky without 
implementing the full story which requires to add to our release metadata we 
don't have yet.

 

Also "True that in case of wrong assumptions of versions it will fail for both 
scopes "provided" and "compile", but my point is actually that "provided" is 
better due to the reasons outlined by you (not unnecessarily downloaded)" is 
not true since the only case which is to discuss is an incompatibility between 
an exported lib where provided is better but for all other cases compile is the 
right one (lib present but not exported, lib missing) so compile is the right 
scope as explained.

 

For extension we enabled to control the classloading strategy (thanks [~gnodet] 
) so we can end up enabling it for mojo - and likely in the plugin definition 
in the pom and not in the plugin _only_ - to solve that properly for all users.

 

Last, the woraround to add in plugin dependencies provided deps is a bad one 
since it breaks existing plugins when they will upgrade and it will not be 
natural for users in most cases whereas compile is.

Now, there is no issue dropping a dependency resolution for mojo when we know 
we will provide the dependency and let it be loaded from maven.core which 
solves your download issue.

> Clarify usage of scope "provided" for Maven artifacts with group id 
> "org.apache.maven"
> --------------------------------------------------------------------------------------
>
>                 Key: MPLUGIN-385
>                 URL: https://issues.apache.org/jira/browse/MPLUGIN-385
>             Project: Maven Plugin Tools
>          Issue Type: Improvement
>          Components: Plugin Plugin
>    Affects Versions: 3.6.2
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Since m-plugin-p 3.6.2 (MPLUGIN-370) all dependencies with group id 
> {{org.apache.maven}} are supposed to be referenced with scope {{provided}}.
> But once turning dependency {{org.apache.maven:maven-archiver:3.5.1}} to 
> scope provided my ITs based on 
> {{org.apache.maven.shared:maven-verifier:1.7.2}} are starting to fail with 
> NCDF errors
> {code}
> java.lang.NoClassDefFoundError: 
> Lorg/apache/maven/archiver/MavenArchiveConfiguration;
> {code}
> Is that a bug in the classloader with maven-verifier? What if I want to use a 
> newer version than shipped with Maven like "maven-archiver 3.5.1"?
> What about group ids starting with "org.apache.maven" like 
> "org.apache.maven.shared"?
> You can reproduce with 
> https://github.com/apache/jackrabbit-filevault-package-maven-plugin.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to