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

Tamás Cservenák commented on MPLUGIN-385:
-----------------------------------------

{quote}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{}}}.
{quote}
Nope, this is wrong: it is the m-plugin-p 3.6.2 warning is the one that is 
wrong.

The plugin (your project) is the one who should "know" best what it needs to be 
run (like maven-archiver for example), but it is actually the log message in 
m-plugin-p that is noisy and too broad. Now I do see it was somewhat a hasty 
thing to do.

Still, in general, 95% of plugins are fine with having maven internals on 
provided scope, and IMO that change is good (otherwise maven downloads them, 
but does not put them onto classpath anyway, so is just a loss in time and 
transfer). But for these edge cases like maven-archiver (where am aligned with 
[~michael-o] : simply put the groupId is wrong, just like maven-jxr is also) 
the "warning message" tells you the wrong thing.

So nothing is enforced, but the log message (WARNING) is too eager, scary and 
has too broad filter. We will need to fix this, possibly simply by removing it.

Still, the "best practice" is given: use public APIs of Maven (as defined by 
[~romain.manni-bucau] ), and scope does not really matter here (ie. maven-core 
as compile or provided), as if compile, it will be downloaded, but NOT added to 
classpath, basically if maven-core has some binary incompatible change that you 
intend to use, despite your version downloads, you will still get the changed 
one, so you will kaboom.

> 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