Remove the use of more deprecated methods
Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6c53bbb2 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6c53bbb2 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6c53bbb2 Branch: refs/heads/master Commit: 6c53bbb293f7453cfb53f4c6da6b0926f6092cb3 Parents: 7d5ca3e Author: Jason van Zyl <ja...@tesla.io> Authored: Thu Apr 16 08:39:14 2015 -0400 Committer: Jason van Zyl <ja...@tesla.io> Committed: Thu Apr 16 08:39:36 2015 -0400 ---------------------------------------------------------------------- .../maven/lifecycle/internal/MojoExecutor.java | 20 ++++++++++---------- .../PluginParameterExpressionEvaluator.java | 12 +++++++++++- 2 files changed, 21 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/6c53bbb2/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java index fedb462..a6ba752 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java @@ -19,6 +19,15 @@ package org.apache.maven.lifecycle.internal; * under the License. */ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.CumulativeScopeArtifactFilter; @@ -40,15 +49,6 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.StringUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - /** * Executes an individual mojo * @@ -169,7 +169,7 @@ public class MojoExecutor throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); } - if ( mojoDescriptor.isProjectRequired() && !session.isUsingPOMsFromFilesystem() ) + if ( mojoDescriptor.isProjectRequired() && !session.getRequest().isProjectPresent() ) { Throwable cause = new MissingProjectException( "Goal requires a project to execute" http://git-wip-us.apache.org/repos/asf/maven/blob/6c53bbb2/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java index b5cdc18..9199ba5 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -100,9 +100,16 @@ public class PluginParameterExpressionEvaluator { this.session = session; this.mojoExecution = mojoExecution; - this.properties = session.getExecutionProperties(); + this.properties = new Properties(); this.project = session.getCurrentProject(); + // + // Maven4: We may want to evaluate how this is used but we add these separate as the + // getExecutionProperties is deprecated in MavenSession. + // + this.properties.putAll( session.getUserProperties() ); + this.properties.putAll( session.getSystemProperties() ); + String basedir = null; if ( project != null ) @@ -129,12 +136,14 @@ public class PluginParameterExpressionEvaluator this.basedir = basedir; } + @Override public Object evaluate( String expr ) throws ExpressionEvaluationException { return evaluate( expr, null ); } + @Override public Object evaluate( String expr, Class<?> type ) throws ExpressionEvaluationException { @@ -445,6 +454,7 @@ public class PluginParameterExpressionEvaluator return expr; } + @Override public File alignToBaseDirectory( File file ) { // TODO: Copied from the DefaultInterpolator. We likely want to resurrect the PathTranslator or at least a