From be6703f6da2fad641c8dbf6f6e623ed643129097 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Thu, 21 Apr 2005 16:26:57 +0000 Subject: [PATCH] disperse constants only used in one place git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164081 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/MavenConstants.java | 31 ------------------- .../project/DefaultMavenProjectBuilder.java | 6 ++-- .../settings/DefaultMavenSettingsBuilder.java | 6 ++-- 3 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 maven-core/src/main/java/org/apache/maven/MavenConstants.java diff --git a/maven-core/src/main/java/org/apache/maven/MavenConstants.java b/maven-core/src/main/java/org/apache/maven/MavenConstants.java deleted file mode 100644 index 374a7f03f0..0000000000 --- a/maven-core/src/main/java/org/apache/maven/MavenConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.apache.maven; - -/* ==================================================================== - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -public class MavenConstants -{ - public static final String MAVEN_MODEL_VERSION = "4.0.0"; - - // ---------------------------------------------------------------------- - // Maven cli - // ---------------------------------------------------------------------- - - public static final String MAVEN_USER_CONFIGURATION_DIRECTORY = ".m2"; - - public static final String MAVEN_REPOSITORY = "repository"; -} diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 5045b212cb..6699601183 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -16,10 +16,8 @@ * limitations under the License. */ -import org.apache.maven.MavenConstants; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.MavenMetadataSource; -import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; @@ -99,6 +97,8 @@ public class DefaultMavenProjectBuilder private final Map modelCache = new HashMap(); + public static final String MAVEN_MODEL_VERSION = "4.0.0"; + public void initialize() { modelReader = new MavenXpp3Reader(); @@ -554,7 +554,7 @@ public MavenProject buildStandaloneSuperProject( ArtifactRepository localReposit private Model getSuperModel() throws ProjectBuildingException { - URL url = DefaultMavenProjectBuilder.class.getResource( "pom-" + MavenConstants.MAVEN_MODEL_VERSION + ".xml" ); + URL url = DefaultMavenProjectBuilder.class.getResource( "pom-" + MAVEN_MODEL_VERSION + ".xml" ); return readModel( url ); } diff --git a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java index 33b5f37179..5aeb711f41 100644 --- a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java @@ -16,7 +16,6 @@ * limitations under the License. */ -import org.apache.maven.MavenConstants; import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; @@ -96,8 +95,7 @@ public Settings buildSettings() if ( settings.getActiveProfile() == null ) { - File mavenUserConfigurationDirectory = new File( userHome, - MavenConstants.MAVEN_USER_CONFIGURATION_DIRECTORY ); + File mavenUserConfigurationDirectory = new File( userHome, ".m2" ); if ( !mavenUserConfigurationDirectory.exists() ) { if ( !mavenUserConfigurationDirectory.mkdirs() ) @@ -106,7 +104,7 @@ public Settings buildSettings() } } - String localRepository = new File( mavenUserConfigurationDirectory, MavenConstants.MAVEN_REPOSITORY ).getAbsolutePath(); + String localRepository = new File( mavenUserConfigurationDirectory, "repository" ).getAbsolutePath(); settings.initializeActiveProfile( localRepository ); }