From 962586d6a6fe437182ed1377097169545efc69e0 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Thu, 30 Apr 2009 21:53:23 +0000 Subject: [PATCH] o restoring method in model builder, i can't fix them all in old plugins because there are 3.x classes i won't backport git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@770460 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/lifecycle/DefaultLifecycleExecutor.java | 10 +++++++++- .../maven/project/DefaultMavenProjectBuilder.java | 9 ++++++++- .../org/apache/maven/project/MavenProjectBuilder.java | 7 ++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index 99dd78e54e..0e0807b689 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -121,7 +121,6 @@ public class DefaultLifecycleExecutor for ( String goal : goals ) { String target = currentProject.getId() + " ( " + goal + " )"; - System.out.println( "target: " + target ); executeGoalAndHandleFailures( goal, session, currentProject, buildStartTime, target ); } } @@ -179,6 +178,7 @@ public class DefaultLifecycleExecutor { try { + logger.info( executionDescription( mojoExecution ) ); pluginManager.executeMojo( session, mojoExecution ); } catch ( PluginExecutionException e ) @@ -193,6 +193,14 @@ public class DefaultLifecycleExecutor } } } + + private String executionDescription( MojoExecution me ) + { + PluginDescriptor pd = me.getMojoDescriptor().getPluginDescriptor(); + StringBuffer sb = new StringBuffer(); + sb.append( pd.getArtifactId() + ":" + pd.getVersion() + ":" + me.getMojoDescriptor().getGoal() ); + return sb.toString(); + } // 1. Find the lifecycle given the phase (default lifecycle when given install) // 2. Find the lifecycle mapping that corresponds to the project packaging (jar lifecycle mapping given the jar packaging) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 9cee2425ac..d2a5c1758e 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -323,7 +323,14 @@ public class DefaultMavenProjectBuilder return null; } - + + + public MavenProject buildFromRepository( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository ) + throws ProjectBuildingException + { + return buildFromRepository( artifact, new DefaultProjectBuilderConfiguration( localRepository, remoteRepositories ) ); + } + public MavenProject buildFromRepository(Artifact artifact, ProjectBuilderConfiguration configuration ) throws ProjectBuildingException { diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/MavenProjectBuilder.java index 8ad181ec0c..8156c65da8 100644 --- a/maven-core/src/main/java/org/apache/maven/project/MavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/MavenProjectBuilder.java @@ -16,6 +16,7 @@ package org.apache.maven.project; */ import java.io.File; +import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; @@ -26,7 +27,11 @@ public interface MavenProjectBuilder // site MavenProject build( File project, ArtifactRepository localRepository, ProfileManager profileManager ) throws ProjectBuildingException; - + + // remote-resources-plugin + MavenProject buildFromRepository( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository ) + throws ProjectBuildingException; + MavenProject build( File project, ProjectBuilderConfiguration configuration ) throws ProjectBuildingException;