mirror of https://github.com/apache/maven.git
Adding system/execution property maven.mode.standalone that will reflect whether maven started via MavenCli or not.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@651080 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
12a125bcad
commit
0c2243d407
|
@ -21,6 +21,7 @@ package org.apache.maven.cli;
|
|||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.maven.MavenTransferListener;
|
||||
import org.apache.maven.embedder.MavenEmbedder;
|
||||
import org.apache.maven.execution.DefaultMavenExecutionRequest;
|
||||
import org.apache.maven.execution.MavenExecutionRequest;
|
||||
import org.codehaus.plexus.util.cli.CommandLineUtils;
|
||||
|
@ -253,6 +254,9 @@ public final class CLIRequestUtils
|
|||
|
||||
static void populateProperties( CommandLine commandLine, Properties executionProperties, Properties userProperties )
|
||||
{
|
||||
System.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
|
||||
executionProperties.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
|
||||
|
||||
// add the env vars to the property set, with the "env." prefix
|
||||
// XXX support for env vars should probably be removed from the ModelInterpolator
|
||||
try
|
||||
|
|
|
@ -126,6 +126,8 @@ public class MavenEmbedder
|
|||
public static final File DEFAULT_GLOBAL_SETTINGS_FILE =
|
||||
new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), "conf/settings.xml" );
|
||||
|
||||
public static final String STANDALONE_MODE = "maven.mode.standalone";
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -206,6 +206,13 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
request.setProperties( requestProperties );
|
||||
}
|
||||
|
||||
if ( requestProperties.getProperty( MavenEmbedder.STANDALONE_MODE ) == null )
|
||||
{
|
||||
// TODO: Remove this!
|
||||
System.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
|
||||
requestProperties.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
|
||||
}
|
||||
|
||||
Properties userProperties = request.getUserProperties();
|
||||
if ( userProperties != null )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue