[
https://issues.apache.org/jira/browse/MNG-7349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joep Weijers updated MNG-7349:
------------------------------
Description:
In the
[commit|https://github.com/apache/maven/commit/a1ba33069fad1fb9c6e9cd458ad233ff3a74aadd]
that solved MNG-7253, the check for relocations was moved from the
DefaultProjectDependenciesResolver to the DefaultArtifactDescriptorReader. This
means that the relocation messages are not only shown on project dependencies,
but on any artifact that is read.
This may lead to unfixable WARNINGS in the output if a plugin transitively uses
a relocated artifact.
This can be reproduced by calling {{mvn dependency:tree}} with a simple, empty
{{{}pom.xml{}}}. This will give the following warning:
{code:java}
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to
xml-apis:xml-apis:jar:1.0.b2
{code}
The default maven-dependency-plugin version is 2.8 and it depends on
{{{}org.apache.maven.reporting:maven-reporting-impl:2.0.5{}}}, which depends on
{{commons-validator:commons-validator:1.2.0}} which depends on
{{{}xml-apis:xml-apis:2.0.2{}}}.
In this particular case, updating to a recent maven-dependency-plugin version
solves the issue. But since the transitive dependencies of plugins are not
under the control of the end users, I don't think this warning should be shown.
*Workaround:*
Stay on Maven 3.8.2 or disable logging on the DefaultArtifactDescriptorReader:
{code:java}
-Dorg.slf4j.simpleLogger.log.org.apache.maven.repository.internal.DefaultArtifactDescriptorReader=error
{code}
Although this disables all relocation messages, including the ones you might be
interested in.
was:
In the
[commit|https://github.com/apache/maven/commit/a1ba33069fad1fb9c6e9cd458ad233ff3a74aadd]
that solved MNG-7253, the check for relocations was moved from the
DefaultProjectDependenciesResolver to the DefaultArtifactDescriptorReader. This
means that the relocation messages are not only shown on project dependencies,
but on any artifact that is read.
This may lead to unfixable WARNINGS in the output if a plugin transitively uses
a relocated artifact.
This can be reproduced by calling {{mvn dependency:tree}} with a simple, empty
{{{}pom.xml{}}}. This will give the following warning:
{code:java}
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to
xml-apis:xml-apis:jar:1.0.b2
{code}
The default maven-dependency-plugin version is 2.8 and it depends on
{{{}org.apache.maven.reporting:maven-reporting-impl:2.0.5{}}}, which depends on
{{commons-validator:commons-validator:1.2.0}} which depends on
{{{}xml-apis:xml-apis:2.0.2{}}}.
In this particular case, updating to a recent maven-dependency-plugin version
solves the issue. But since the transitive dependencies of plugins are not
under the control of the end users, I don't think this warning should be shown.
*Workaround:*
Disable logging on the DefaultArtifactDescriptorReader:
{code:java}
-Dorg.slf4j.simpleLogger.log.org.apache.maven.repository.internal.DefaultArtifactDescriptorReader=error
{code}
Although this disables all relocation messages, including the ones you might be
interested in.
> Superfluous relocation warning messages
> ----------------------------------------
>
> Key: MNG-7349
> URL: https://issues.apache.org/jira/browse/MNG-7349
> Project: Maven
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.8.3, 3.8.4
> Reporter: Joep Weijers
> Priority: Minor
>
> In the
> [commit|https://github.com/apache/maven/commit/a1ba33069fad1fb9c6e9cd458ad233ff3a74aadd]
> that solved MNG-7253, the check for relocations was moved from the
> DefaultProjectDependenciesResolver to the DefaultArtifactDescriptorReader.
> This means that the relocation messages are not only shown on project
> dependencies, but on any artifact that is read.
> This may lead to unfixable WARNINGS in the output if a plugin transitively
> uses a relocated artifact.
> This can be reproduced by calling {{mvn dependency:tree}} with a simple,
> empty {{{}pom.xml{}}}. This will give the following warning:
> {code:java}
> [WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to
> xml-apis:xml-apis:jar:1.0.b2
> {code}
> The default maven-dependency-plugin version is 2.8 and it depends on
> {{{}org.apache.maven.reporting:maven-reporting-impl:2.0.5{}}}, which depends
> on {{commons-validator:commons-validator:1.2.0}} which depends on
> {{{}xml-apis:xml-apis:2.0.2{}}}.
> In this particular case, updating to a recent maven-dependency-plugin version
> solves the issue. But since the transitive dependencies of plugins are not
> under the control of the end users, I don't think this warning should be
> shown.
> *Workaround:*
> Stay on Maven 3.8.2 or disable logging on the DefaultArtifactDescriptorReader:
> {code:java}
> -Dorg.slf4j.simpleLogger.log.org.apache.maven.repository.internal.DefaultArtifactDescriptorReader=error
> {code}
> Although this disables all relocation messages, including the ones you might
> be interested in.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)