maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Fradin (JIRA)" <>
Subject [jira] (MNG-5491) Resolve artifact failed because of using repo url instead of repo ID
Date Thu, 04 Jul 2013 07:52:05 GMT


David Fradin commented on MNG-5491:

Current bypass : to avoid this problem, we have given the same repository ID for the two repositories
that has the same URL.
But we always have to change plugin repository ID when we switch to another plugin repository.
> Resolve artifact failed because of using repo url instead of repo ID 
> ---------------------------------------------------------------------
>                 Key: MNG-5491
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.0.5
>         Environment: On several systems as Linux Redhat and Windows Vista
>            Reporter: David Fradin
>         Attachments: settings.xml
> We have develop a MOJO that downloads a list of artefacts and makes that operations on
them. It works in Maven 3.0.3 but failed in Maven 3.0.5 on resolveArtifact method. It seems
to be a regression on Maven 3.0.5 (we don't test on Maven 3.0.4).
> In attached file, find our settings.xml (we have remove internal information).
> You can see we have a plugin repository ID and a repository ID that use the same URL
> When we use our plugin, Maven downloads its dependencies and for example download
(it makes the same problem on all common artifacts).
> On local repository, we can see in
> cat repository/javax/xml/stream/stax-api/1.0-2/_maven.repositories :
> #NOTE: This is an internal implementation file, its format can be changed without prior
> #Wed Jul 03 13:30:47 CEST 2013
> stax-api-1.0-2.jar>plugin-repository=
> stax-api-1.0-2.pom>plugin-repository=
> Then Maven execute our plugin that has to download a list of artifacts.
> But it failed to download 
> Reason is that is present on local repository, so
it found by Maven but when it tests if it is up-to-date it failed because this file comes
from another repository.
> Explanation :
> Class : DefaultArtifactResolver
> Method : private List<ArtifactResult> resolve( RepositorySystemSession session,
>                                           Collection<? extends ArtifactRequest>
requests )
> Call
> Class : DefaultUpdateCheckManager
> Method :    public void checkArtifact( RepositorySystemSession session, UpdateCheck<Artifact,
ArtifactTransferException> check )
>     {
> [...]
> 	if ( isAlreadyUpdated( session.getData(), updateKey ) )
> updateKey contains repository.getUrl() and not repository.getID()
> So isAlreadyUpdated answers yes because artefact as already been downloaded from this
> But when Maven reads _maven.repositories, it sees that repository ID public-repository
is not here so the plugin is considered as unavailable.
> So we have an artifact that is present in local repository but considered as unavailable
by resolve and present by isAlreadyUpdated. 
> So artifact is never updated so the repository ID is not added to _maven.repositories
> Is it clear ?
> I hope...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message