diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 661e757f99..5ceeafc740 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -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 ); } diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 82055b2d37..6a7812afd4 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -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 ); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index 8e6a1bd46b..163ba85570 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -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 ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java index 4980a4edf6..283544dab5 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -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 ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java index be0951a15e..0b62ed7e61 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java @@ -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 ); diff --git a/pom.xml b/pom.xml index 90826d3082..8c9c21f339 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 1.4 1.4 1.3 - 1.7 + 1.8 true