diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 5b7fad3a69..75c58ef0f9 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -26,6 +26,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ResolutionErrorHandler; +import org.apache.maven.artifact.resolver.TransferListenerAdapter; import org.apache.maven.model.Build; import org.apache.maven.model.Model; import org.apache.maven.model.Profile; @@ -142,7 +143,7 @@ public class DefaultProjectBuilder .setOffline( configuration.isOffline() ) .setForceUpdate( configuration.isForceUpdate() ) .setManagedVersionMap( project.getManagedVersionMap() ); - // FIXME setTransferListener + artifactRequest.setTransferListener( TransferListenerAdapter.newAdapter( configuration.getTransferListener() ) ); artifactResult = repositorySystem.resolve( artifactRequest ); @@ -205,7 +206,8 @@ public class DefaultProjectBuilder .setRemoteRepositories( configuration.getRemoteRepositories() ) .setOffline( configuration.isOffline() ) .setForceUpdate( configuration.isForceUpdate() ); - // FIXME setTransferListener + request.setTransferListener( TransferListenerAdapter.newAdapter( configuration.getTransferListener() ) ); + ArtifactResolutionResult result = repositorySystem.resolve( request ); try diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java index 8259c92fb6..cbc7db175e 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java @@ -29,6 +29,7 @@ import org.apache.maven.artifact.repository.RepositoryCache; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.model.building.ModelEventListener; +import org.apache.maven.repository.ArtifactTransferListener; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; @@ -77,6 +78,8 @@ public class DefaultProjectBuildingRequest private boolean resolveDependencies; + private ArtifactTransferListener transferListener; + public DefaultProjectBuildingRequest() { processPlugins = true; @@ -394,4 +397,14 @@ public class DefaultProjectBuildingRequest this.buildStartTime = buildStartTime; } + public ArtifactTransferListener getTransferListener() + { + return transferListener; + } + + public void setTransferListener( ArtifactTransferListener transferListener ) + { + this.transferListener = transferListener; + } + } diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java index e6ea14cdf7..7165290bd0 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java @@ -27,6 +27,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.RepositoryCache; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.repository.ArtifactTransferListener; import org.apache.maven.settings.Mirror; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; @@ -173,9 +174,9 @@ public interface ProjectBuildingRequest * @return This request, never {@code null}. */ void setBuildStartTime( Date buildStartTime ); - - // TODO ? - //TransferListener getTransferListener(); - //void setTransferListener ( TransferListener transferListener ); + + ArtifactTransferListener getTransferListener(); + + void setTransferListener( ArtifactTransferListener transferListener ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/RepositoryModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/RepositoryModelResolver.java index 0412ad92d6..23ee91ecb0 100644 --- a/maven-core/src/main/java/org/apache/maven/project/RepositoryModelResolver.java +++ b/maven-core/src/main/java/org/apache/maven/project/RepositoryModelResolver.java @@ -30,6 +30,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ResolutionErrorHandler; +import org.apache.maven.artifact.resolver.TransferListenerAdapter; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; import org.apache.maven.model.building.ModelSource; @@ -136,7 +137,8 @@ class RepositoryModelResolver request.setLocalRepository( projectBuildingRequest.getLocalRepository() ); request.setOffline( projectBuildingRequest.isOffline() ); request.setCache( projectBuildingRequest.getRepositoryCache() ); - // FIXME setTransferListener + request.setTransferListener( TransferListenerAdapter.newAdapter( projectBuildingRequest.getTransferListener() ) ); + ArtifactResolutionResult result = repositorySystem.resolve( request ); try