After having lost many hours I finally found where the problem is likely to be... :-(

maven is using aether for dependency resolution, but aether has not a concept of packaging and extension as maven has. it only has extension.

as a workaround maven is saving the packaging type inside the aether's DefaultArtifact properties map field. that is ok...

But the values saved in aether's class is not being used properly when converting again to maven Artifact after resolution. Instead of searching for an existent ArtifactHandle instance in the current ArtifactHandlerManager instance a new one is being created in RepositoryUtils:

       org.apache.maven.artifact.Artifact toArtifact( Artifact artifact ){

            ArtifactHandler handler = newHandler( artifact );

-------------------------------------------------------------------------------------

           public static ArtifactHandler newHandler( Artifact artifact )
        {
            String type = artifact.getProperty(
   ArtifactProperties.TYPE, artifact.getExtension() );
   *DefaultArtifactHandler handler = new DefaultArtifactHandler( type );*

It is a bug or it was intentionally done this way?


Reply via email to