mirror of https://github.com/apache/maven.git
Remove the use of more deprecated methods
This commit is contained in:
parent
7d5ca3e5b3
commit
6c53bbb293
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue