You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/07/30 18:55:57 UTC

svn commit: r980888 - /maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java

Author: bentmann
Date: Fri Jul 30 16:55:57 2010
New Revision: 980888

URL: http://svn.apache.org/viewvc?rev=980888&view=rev
Log:
o Improved backward-compat

Modified:
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java?rev=980888&r1=980887&r2=980888&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java Fri Jul 30 16:55:57 2010
@@ -19,6 +19,7 @@ package org.apache.maven.execution;
  * under the License.
  */
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -48,7 +49,14 @@ class SettingsAdapter
     public SettingsAdapter( MavenExecutionRequest request )
     {
         this.request = request;
-        this.runtimeInfo = new RuntimeInfo( request.getUserSettingsFile() );
+
+        /*
+         * NOTE: Plugins like maven-release-plugin query the path to the settings.xml to pass it into a forked Maven and
+         * the CLI will fail when called with a non-existing settings, so be sure to only point at actual files. Having
+         * a null file should be harmless as this case matches general Maven 2.x behavior...
+         */
+        File userSettings = request.getUserSettingsFile();
+        this.runtimeInfo = new RuntimeInfo( ( userSettings != null && userSettings.isFile() ) ? userSettings : null );
     }
 
     @Override