From 5ad174e3d65fd86edd20d9513e08f5148ef4aa5f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 24 Jul 2009 22:37:39 +0000 Subject: [PATCH] [MNG-4247] Displaying which artifacts are downloaded and from which repo Only displaying a simple : [INFO] Downloaded http://x.x.x.x:x/....... As there is so much places where ArtifactResolutionRequest is created without any access to mavenExecutionRequest.getTransferListener() Issue id: MNG-4247 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@797678 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/artifact/resolver/ArtifactResolutionRequest.java | 5 +++++ .../apache/maven/repository/legacy/DefaultWagonManager.java | 3 +++ .../apache/maven/DefaultProjectDependenciesResolver.java | 3 ++- .../java/org/apache/maven/plugin/DefaultPluginManager.java | 3 ++- .../org/apache/maven/project/DefaultProjectBuilder.java | 4 ++-- .../apache/maven/project/DefaultProjectBuildingHelper.java | 3 ++- .../org/apache/maven/project/ProjectBuildingRequest.java | 6 ++++++ .../org/apache/maven/project/RepositoryModelResolver.java | 2 +- 8 files changed, 23 insertions(+), 6 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java index a70bf7ca1e..a9d2e51771 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java @@ -43,6 +43,11 @@ public class ArtifactResolutionRequest private boolean resolveTransitively = false; + public ArtifactResolutionRequest( ) + { + // nothing here + } + public Artifact getArtifact() { return artifact; diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java index cc0cdde536..f620488a81 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java @@ -346,6 +346,9 @@ public class DefaultWagonManager if ( downloaded ) { + + logger.info( "Downloaded " + repository.getUrl() + remotePath ); + // keep the checksum files from showing up on the download monitor... if ( downloadMonitor != null ) { diff --git a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java index 917426a047..e08beea15e 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java @@ -81,7 +81,8 @@ public class DefaultProjectDependenciesResolver .setRemoteRepostories( remoteRepositories ) .setManagedVersionMap( project.getManagedVersionMap() ) .setFilter( filter ); - + // FIXME setTransferListener + ArtifactResolutionResult result = repositorySystem.resolve( request ); resolutionErrorHandler.throwErrors( request, result ); project.setArtifacts( result.getArtifacts() ); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index cfc4c14c45..f66a19c06e 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -133,7 +133,7 @@ public class DefaultPluginManager .setLocalRepository( localRepository ) .setRemoteRepostories( remoteRepositories ) .setResolveTransitively( false ); - + // FIXME setTransferListener ArtifactResolutionResult result = repositorySystem.resolve( request ); try @@ -275,6 +275,7 @@ public class DefaultPluginManager .setFilter( filter ) .setResolveTransitively( true ); //.setResolveRoot( false ); + // FIXME setTransferListener ArtifactResolutionResult result = repositorySystem.resolve( request ); resolutionErrorHandler.throwErrors( request, result ); 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 cb446adc64..abc82649fd 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 @@ -231,7 +231,7 @@ public class DefaultProjectBuilder .setArtifact( artifact ) .setLocalRepository( configuration.getLocalRepository() ) .setRemoteRepostories( configuration.getRemoteRepositories() ); - + // FIXME setTransferListener ArtifactResolutionResult result = repositorySystem.resolve( request ); try @@ -307,7 +307,7 @@ public class DefaultProjectBuilder .setLocalRepository( request.getLocalRepository() ) .setRemoteRepostories( project.getRemoteArtifactRepositories() ) .setManagedVersionMap( project.getManagedVersionMap() ); - + // FIXME setTransferListener ArtifactResolutionResult result; ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java index 3e1c51ad81..920d898172 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java @@ -187,7 +187,8 @@ public class DefaultProjectBuildingHelper request.setFilter( artifactFilterManager.getCoreArtifactFilter() ); request.setLocalRepository( localRepository ); request.setRemoteRepostories( remoteRepositories ); - + // FIXME setTransferListener + ArtifactResolutionResult result = repositorySystem.resolve( request ); resolutionErrorHandler.throwErrors( request, result ); 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 0b42383336..3c9d69e689 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 @@ -23,9 +23,11 @@ import java.util.Date; import java.util.List; import java.util.Properties; +import org.apache.maven.MavenTransferListener; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Profile; import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.wagon.events.TransferListener; public interface ProjectBuildingRequest { @@ -140,5 +142,9 @@ public interface ProjectBuildingRequest * @return This request, never {@code null}. */ void setBuildStartTime( Date buildStartTime ); + + // TODO ? + //TransferListener getTransferListener(); + //void setTransferListener ( TransferListener 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 bdb08c5664..f88e2d5a32 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 @@ -116,7 +116,7 @@ class RepositoryModelResolver request.setArtifact( artifactParent ); request.setLocalRepository( localRepository ); request.setRemoteRepostories( remoteRepositories ); - + // FIXME setTransferListener ArtifactResolutionResult result = repositorySystem.resolve( request ); try