mirror of https://github.com/apache/maven.git
[MNG-4883] [regression] Dependency resolution does not fail for artifact with over-constrained version ranges
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1036663 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0bfec136db
commit
6af651b2b4
|
@ -44,6 +44,7 @@ import org.apache.maven.model.building.ModelProblem;
|
|||
import org.apache.maven.model.resolution.UnresolvableModelException;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryException;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
|
@ -264,7 +265,7 @@ public class DefaultArtifactDescriptorReader
|
|||
{
|
||||
if ( e.getCause() instanceof ArtifactNotFoundException )
|
||||
{
|
||||
missingDescriptor( session, artifact );
|
||||
missingDescriptor( session, artifact, (Exception) e.getCause() );
|
||||
if ( session.isIgnoreMissingArtifactDescriptor() )
|
||||
{
|
||||
return null;
|
||||
|
@ -422,12 +423,14 @@ public class DefaultArtifactDescriptorReader
|
|||
return new RepositoryPolicy( enabled, updates, checksums );
|
||||
}
|
||||
|
||||
private void missingDescriptor( RepositorySystemSession session, Artifact artifact )
|
||||
private void missingDescriptor( RepositorySystemSession session, Artifact artifact, Exception exception )
|
||||
{
|
||||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, artifact );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_MISSING, session );
|
||||
event.setArtifact( artifact );
|
||||
event.setException( exception );
|
||||
listener.artifactDescriptorMissing( event );
|
||||
}
|
||||
}
|
||||
|
@ -437,7 +440,8 @@ public class DefaultArtifactDescriptorReader
|
|||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, artifact );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_INVALID, session );
|
||||
event.setArtifact( artifact );
|
||||
event.setException( exception );
|
||||
listener.artifactDescriptorInvalid( event );
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
|
@ -241,7 +242,8 @@ public class DefaultVersionRangeResolver
|
|||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, metadata );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session );
|
||||
event.setMetadata( metadata );
|
||||
event.setException( exception );
|
||||
event.setRepository( repository );
|
||||
listener.metadataInvalid( event );
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.codehaus.plexus.util.IOUtil;
|
|||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.ConfigurationProperties;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.util.artifact.SubArtifact;
|
||||
|
@ -331,7 +332,8 @@ public class DefaultVersionResolver
|
|||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, metadata );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session );
|
||||
event.setMetadata( metadata );
|
||||
event.setException( exception );
|
||||
event.setRepository( repository );
|
||||
listener.metadataInvalid( event );
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.apache.maven.plugin.prefix.PluginPrefixResult;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
|
@ -276,7 +277,8 @@ public class DefaultPluginPrefixResolver
|
|||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, metadata );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session );
|
||||
event.setMetadata( metadata );
|
||||
event.setException( exception );
|
||||
event.setRepository( repository );
|
||||
listener.metadataInvalid( event );
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
|
@ -178,7 +179,8 @@ public class DefaultPluginVersionResolver
|
|||
RepositoryListener listener = session.getRepositoryListener();
|
||||
if ( listener != null )
|
||||
{
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( session, metadata );
|
||||
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session );
|
||||
event.setMetadata( metadata );
|
||||
event.setException( exception );
|
||||
event.setRepository( repository );
|
||||
listener.metadataInvalid( event );
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -50,7 +50,7 @@
|
|||
<cipherVersion>1.4</cipherVersion>
|
||||
<modelloVersion>1.4</modelloVersion>
|
||||
<jxpathVersion>1.3</jxpathVersion>
|
||||
<aetherVersion>1.7</aetherVersion>
|
||||
<aetherVersion>1.8</aetherVersion>
|
||||
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
|
||||
</properties>
|
||||
|
||||
|
|
Loading…
Reference in New Issue