Author: jdcasey
Date: Wed Apr 23 14:49:49 2008
New Revision: 651080

URL: http://svn.apache.org/viewvc?rev=651080&view=rev
Log:
Adding system/execution property maven.mode.standalone that will reflect 
whether maven started via MavenCli or not.

Modified:
    
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIRequestUtils.java
    
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
    
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java

Modified: 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIRequestUtils.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIRequestUtils.java?rev=651080&r1=651079&r2=651080&view=diff
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIRequestUtils.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIRequestUtils.java
 Wed Apr 23 14:49:49 2008
@@ -21,6 +21,7 @@
 
 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 @@
 
     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

Modified: 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?rev=651080&r1=651079&r2=651080&view=diff
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
 Wed Apr 23 14:49:49 2008
@@ -126,6 +126,8 @@
     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";
+
 
     // 
----------------------------------------------------------------------------
     //

Modified: 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java?rev=651080&r1=651079&r2=651080&view=diff
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
 Wed Apr 23 14:49:49 2008
@@ -206,6 +206,13 @@
             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 )
         {


Reply via email to