From 260516f8d287f399845a33f81ba24e397f15bfe0 Mon Sep 17 00:00:00 2001 From: Kenney Westerhof Date: Fri, 22 Dec 2006 17:07:40 +0000 Subject: [PATCH] Re-added 2 dropped methods that were never deprecated: buildSettings() and buildSettings( file ). maven-plugin-testing-tools uses the maven 2.0.x api's, but fails with NoSuchMethodError in 2.1-snapshot git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@489693 13f79535-47bb-0310-9956-ffa450edef68 --- .../settings/DefaultMavenSettingsBuilder.java | 23 ++++++++++++++++++- .../maven/settings/MavenSettingsBuilder.java | 17 +++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java b/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java index e7fa32ec78..14b320bc1d 100644 --- a/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java +++ b/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java @@ -19,7 +19,6 @@ package org.apache.maven.settings; import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.interpolation.EnvarBasedValueSource; import org.codehaus.plexus.util.interpolation.RegexBasedInterpolator; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; @@ -44,6 +43,9 @@ public class DefaultMavenSettingsBuilder // MavenProfilesBuilder Implementation // ---------------------------------------------------------------------- + /** + * @since 2.1 + */ public Settings buildSettings( File userSettingsFile, File globalSettingsFile ) throws IOException, XmlPullParserException { @@ -70,6 +72,25 @@ public class DefaultMavenSettingsBuilder return userSettings; } + /** + * @deprecated + */ + public Settings buildSettings() + throws IOException, XmlPullParserException + { + return buildSettings( new File( new File( System.getProperty( "user.home" ) ), ".m2/settings.xml" ) ); + } + + /** + * @deprecated + */ + public Settings buildSettings( File userSettingsFile ) + throws IOException, XmlPullParserException + { + return buildSettings( userSettingsFile, null ); + } + + private Settings readSettings( File settingsFile ) throws IOException, XmlPullParserException { diff --git a/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java b/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java index eb9e028cc2..7b2e8f4c5c 100644 --- a/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java +++ b/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java @@ -28,7 +28,22 @@ import java.io.IOException; public interface MavenSettingsBuilder { String ROLE = MavenSettingsBuilder.class.getName(); - + + /** + * @deprecated + */ + Settings buildSettings() + throws IOException, XmlPullParserException; + + /** + * @deprecated + */ + Settings buildSettings( File userSettingsFile ) + throws IOException, XmlPullParserException; + + /** + * @since 2.1 + */ Settings buildSettings( File userSettingsFile, File globalSettingsFile ) throws IOException, XmlPullParserException; }