[ 
https://issues.apache.org/jira/browse/MNG-6732?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomo Suzuki updated MNG-6732:
-----------------------------
    Description: 
h1. Problem

Sometimes my Maven enforcer rule does not receive resolved artifact list 
because of missing artifact even when the missing artifact does not appear in 
the final dependency graph. 
h1. Background

Artifact xerces:xerces-impl:2.6.2 is not published in Maven Central.

My enforcer rule can retrieve artifact list through 
DefaultProjectDependenciesResolver.resolve when applied to 
[https://github.com/suztomo/spring-cloud-gcp/tree/v1.1.2-linkage-checker] 
project even though it outputs "[WARNING] The POM for 
xerces:xerces-impl:jar:2.6.2 is missing, no dependency information available". 
The missing artifact does not appear in final dependency graph.

On the other hand, the enforcer rule fails to retrieve artifact list when 
applied to 
[grpc-java-by-example/chat-example/chat-vaadin-client|https://github.com/saturnism/grpc-java-by-example/tree/master/chat-example/chat-vaadin-client]
 because of the missing xerces:xerces-impl:2.6.2, even though the artifact 
should not appear in the final dependency graph.

 

[https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/834]
h1. Diagnosis

Currently DefaultArtifactDescriptorReader.loadPom method checks 
"ArtifactDescriptorPolicy.IGNORE_MISSING" policy upon 
ArtifactNotFoundException. This allows 
DefaultProjectDependenciesResolver.resolve calls repoSystem.resolveDependencies 
to obtain partially resolved artifact list even when there is a missing 
artifact (such as xerces:xerces-impl:2.6.2)

However, when there is a retired Maven repository is involved (such as 
[http://repository.codehaus.org/] ), DefaultArtifactDescriptorReader.loadPom 
method gets an ArtifactTransferException and throws ArtifactDescriptorException 
without checking "ArtifactDescriptorPolicy.IGNORE_MISSING" policy, and thus 
DefaultProjectDependenciesResolver.resolve does not return partially resolved 
artifact list.


{code:java}
// Some comments here
public String getFoo()
{
    return foo;
}
{code}


ArtifactNotFoundException is a special case of 
[ArtifactTransferException|https://maven.apache.org/resolver/apidocs/org/eclipse/aether/transfer/ArtifactTransferException.html].

Example project to demonstrate the diagnosis: 
[https://github.com/suztomo/maven-missing-artifact] . Even though module-b and 
module-c have the same dependency section, module-c fails to run Maven because 
of repository section.

  was:
h1. Problem

Sometimes my Maven enforcer rule does not receive resolved artifact list 
because of missing artifact even when the missing artifact does not appear in 
the final dependency graph. 
h1. Background

Artifact xerces:xerces-impl:2.6.2 is not published in Maven Central.

My enforcer rule can retrieve artifact list when applied to 
[https://github.com/suztomo/spring-cloud-gcp/tree/v1.1.2-linkage-checker] 
project even though it outputs "[WARNING] The POM for 
xerces:xerces-impl:jar:2.6.2 is missing, no dependency information available".

On the other hand, the enforcer rule fails to retrieve artifact list when 
applied to 
[grpc-java-by-example/chat-example/chat-vaadin-client|https://github.com/saturnism/grpc-java-by-example/tree/master/chat-example/chat-vaadin-client]
 because of the missing xerces:xerces-impl:2.6.2.

 

[https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/834]
h1. Diagnosis

Currently DefaultArtifactDescriptorReader.loadPom method checks 
"ArtifactDescriptorPolicy.IGNORE_MISSING" policy upon 
ArtifactNotFoundException. This allows 
DefaultProjectDependenciesResolver.resolve calls repoSystem.resolveDependencies 
to obtain partially resolved artifact list even when there is a missing 
artifact (such as xerces:xerces-impl:2.6.2)

However, when there is a retired Maven repository is involved (such as 
[http://repository.codehaus.org/] ), DefaultArtifactDescriptorReader.loadPom 
method throws ArtifactDescriptorException without checking 
"ArtifactDescriptorPolicy.IGNORE_MISSING" policy, and thus 
DefaultProjectDependenciesResolver.resolve does not return partially resolved 
artifact list.

 

Example project to demonstrate the diagnosis: 
[https://github.com/suztomo/maven-missing-artifact] . Even though module-b and 
module-c have the same dependency section, module-c fails to run Maven because 
of repository section.


> DefaultArtifactDescriptorReader.loadPom to check IGNORE_MISSING policy upon 
> ArtifactTransferException
> -----------------------------------------------------------------------------------------------------
>
>                 Key: MNG-6732
>                 URL: https://issues.apache.org/jira/browse/MNG-6732
>             Project: Maven
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.6.1
>            Reporter: Tomo Suzuki
>            Priority: Major
>         Attachments: 62884438-89260580-bd04-11e9-8c4a-897d4b736dc7.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> h1. Problem
> Sometimes my Maven enforcer rule does not receive resolved artifact list 
> because of missing artifact even when the missing artifact does not appear in 
> the final dependency graph. 
> h1. Background
> Artifact xerces:xerces-impl:2.6.2 is not published in Maven Central.
> My enforcer rule can retrieve artifact list through 
> DefaultProjectDependenciesResolver.resolve when applied to 
> [https://github.com/suztomo/spring-cloud-gcp/tree/v1.1.2-linkage-checker] 
> project even though it outputs "[WARNING] The POM for 
> xerces:xerces-impl:jar:2.6.2 is missing, no dependency information 
> available". The missing artifact does not appear in final dependency graph.
> On the other hand, the enforcer rule fails to retrieve artifact list when 
> applied to 
> [grpc-java-by-example/chat-example/chat-vaadin-client|https://github.com/saturnism/grpc-java-by-example/tree/master/chat-example/chat-vaadin-client]
>  because of the missing xerces:xerces-impl:2.6.2, even though the artifact 
> should not appear in the final dependency graph.
>  
> [https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/834]
> h1. Diagnosis
> Currently DefaultArtifactDescriptorReader.loadPom method checks 
> "ArtifactDescriptorPolicy.IGNORE_MISSING" policy upon 
> ArtifactNotFoundException. This allows 
> DefaultProjectDependenciesResolver.resolve calls 
> repoSystem.resolveDependencies to obtain partially resolved artifact list 
> even when there is a missing artifact (such as xerces:xerces-impl:2.6.2)
> However, when there is a retired Maven repository is involved (such as 
> [http://repository.codehaus.org/] ), DefaultArtifactDescriptorReader.loadPom 
> method gets an ArtifactTransferException and throws 
> ArtifactDescriptorException without checking 
> "ArtifactDescriptorPolicy.IGNORE_MISSING" policy, and thus 
> DefaultProjectDependenciesResolver.resolve does not return partially resolved 
> artifact list.
> {code:java}
> // Some comments here
> public String getFoo()
> {
>     return foo;
> }
> {code}
> ArtifactNotFoundException is a special case of 
> [ArtifactTransferException|https://maven.apache.org/resolver/apidocs/org/eclipse/aether/transfer/ArtifactTransferException.html].
> Example project to demonstrate the diagnosis: 
> [https://github.com/suztomo/maven-missing-artifact] . Even though module-b 
> and module-c have the same dependency section, module-c fails to run Maven 
> because of repository section.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to