maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r682324 - /maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java
Date Mon, 04 Aug 2008 11:15:23 GMT
Author: vsiveton
Date: Mon Aug  4 04:15:23 2008
New Revision: 682324

URL: http://svn.apache.org/viewvc?rev=682324&view=rev
Log:
o merged from r682323
Issue id: o merge

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java?rev=682324&r1=682323&r2=682324&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java
Mon Aug  4 04:15:23 2008
@@ -275,4 +275,32 @@
         policy.setChecksumPolicy( settingsPolicy.getChecksumPolicy() );
         return policy;
     }
+
+    /**
+     * @param settings could be null
+     * @return a new instance of settings or null if settings was null.
+     */
+    public static Settings copySettings( Settings settings )
+    {
+        if ( settings == null )
+        {
+            return null;
+        }
+
+        Settings clone = new Settings();
+        clone.setActiveProfiles( settings.getActiveProfiles() );
+        clone.setInteractiveMode( settings.isInteractiveMode() );
+        clone.setLocalRepository( settings.getLocalRepository() );
+        clone.setMirrors( settings.getMirrors() );
+        clone.setModelEncoding( settings.getModelEncoding() );
+        clone.setOffline( settings.isOffline() );
+        clone.setPluginGroups( settings.getPluginGroups() );
+        clone.setProfiles( settings.getProfiles() );
+        clone.setProxies( settings.getProxies() );
+        clone.setServers( settings.getServers() );
+        clone.setSourceLevel( settings.getSourceLevel() );
+        clone.setUsePluginRegistry( settings.isUsePluginRegistry() );
+
+        return clone;
+    }
 }



Mime
View raw message