From 635a30a36f9927c608e55f309aac0447347edda7 Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Fri, 17 Apr 2009 17:16:55 +0000 Subject: [PATCH] Moved interpolator classes into their own package. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@766088 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugin/DefaultPluginManager.java | 8 ++++---- .../apache/maven/mercury/MavenDependencyProcessor.java | 6 +++--- .../interpolator}/DefaultInterpolator.java | 4 +++- .../builder => model/interpolator}/Interpolator.java | 4 +++- .../interpolator}/InterpolatorProperty.java | 2 +- .../builder => model/interpolator}/ModelProperty.java | 5 +++-- .../interpolator}/PomInterpolatorTag.java | 2 +- .../org/apache/maven/profiles/DefaultProfileManager.java | 4 ++-- .../org/apache/maven/profiles/ProfileManagerInfo.java | 2 +- .../apache/maven/profiles/matchers/DefaultMatcher.java | 2 +- .../org/apache/maven/profiles/matchers/FileMatcher.java | 2 +- .../org/apache/maven/profiles/matchers/JdkMatcher.java | 2 +- .../apache/maven/profiles/matchers/ProfileMatcher.java | 2 +- .../apache/maven/profiles/matchers/PropertyMatcher.java | 2 +- .../apache/maven/project/DefaultMavenProjectBuilder.java | 8 ++++---- .../apache/maven/profiles/matchers/JdkMatcherTest.java | 2 +- .../org/apache/maven/project/harness/PomTestWrapper.java | 9 --------- 17 files changed, 31 insertions(+), 35 deletions(-) rename maven-model-builder/src/main/java/org/apache/maven/{project/builder => model/interpolator}/DefaultInterpolator.java (99%) rename maven-model-builder/src/main/java/org/apache/maven/{project/builder => model/interpolator}/Interpolator.java (76%) rename maven-model-builder/src/main/java/org/apache/maven/{project/builder => model/interpolator}/InterpolatorProperty.java (99%) rename maven-model-builder/src/main/java/org/apache/maven/{project/builder => model/interpolator}/ModelProperty.java (99%) rename maven-model-builder/src/main/java/org/apache/maven/{project/builder => model/interpolator}/PomInterpolatorTag.java (70%) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index e345f8605e..32592e190e 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -60,6 +60,10 @@ import org.apache.maven.model.Dependency; import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.ReportPlugin; +import org.apache.maven.model.interpolator.DefaultInterpolator; +import org.apache.maven.model.interpolator.Interpolator; +import org.apache.maven.model.interpolator.InterpolatorProperty; +import org.apache.maven.model.interpolator.PomInterpolatorTag; import org.apache.maven.monitor.event.EventDispatcher; import org.apache.maven.monitor.event.MavenEvents; import org.apache.maven.monitor.logging.DefaultLog; @@ -72,10 +76,6 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.artifact.InvalidDependencyVersionException; -import org.apache.maven.project.builder.DefaultInterpolator; -import org.apache.maven.project.builder.Interpolator; -import org.apache.maven.project.builder.InterpolatorProperty; -import org.apache.maven.project.builder.PomInterpolatorTag; import org.apache.maven.project.path.PathTranslator; import org.apache.maven.realm.MavenRealmManager; import org.apache.maven.realm.RealmManagementException; diff --git a/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDependencyProcessor.java b/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDependencyProcessor.java index 69d0fcb4d8..cc630293ea 100644 --- a/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDependencyProcessor.java +++ b/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDependencyProcessor.java @@ -29,10 +29,10 @@ import org.apache.maven.mercury.builder.api.DependencyProcessor; import org.apache.maven.mercury.builder.api.DependencyProcessorException; import org.apache.maven.mercury.builder.api.MetadataReader; import org.apache.maven.mercury.builder.api.MetadataReaderException; -import org.apache.maven.project.builder.DefaultInterpolator; +import org.apache.maven.model.interpolator.DefaultInterpolator; +import org.apache.maven.model.interpolator.InterpolatorProperty; +import org.apache.maven.model.interpolator.PomInterpolatorTag; import org.apache.maven.project.builder.DomainModel; -import org.apache.maven.project.builder.InterpolatorProperty; -import org.apache.maven.project.builder.PomInterpolatorTag; import org.apache.maven.project.builder.ProcessorContext; import org.codehaus.plexus.component.annotations.Component; diff --git a/maven-model-builder/src/main/java/org/apache/maven/project/builder/DefaultInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/DefaultInterpolator.java similarity index 99% rename from maven-model-builder/src/main/java/org/apache/maven/project/builder/DefaultInterpolator.java rename to maven-model-builder/src/main/java/org/apache/maven/model/interpolator/DefaultInterpolator.java index 08ee915a8e..839464b5b6 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/project/builder/DefaultInterpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/DefaultInterpolator.java @@ -1,4 +1,4 @@ -package org.apache.maven.project.builder; +package org.apache.maven.model.interpolator; import java.io.ByteArrayInputStream; import java.io.File; @@ -25,6 +25,8 @@ import org.apache.maven.model.Build; import org.apache.maven.model.Model; import org.apache.maven.model.Reporting; import org.apache.maven.model.Resource; +import org.apache.maven.project.builder.PomClassicDomainModel; +import org.apache.maven.project.builder.ProjectUri; import org.codehaus.plexus.component.annotations.Component; @Component(role=Interpolator.class) diff --git a/maven-model-builder/src/main/java/org/apache/maven/project/builder/Interpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/Interpolator.java similarity index 76% rename from maven-model-builder/src/main/java/org/apache/maven/project/builder/Interpolator.java rename to maven-model-builder/src/main/java/org/apache/maven/model/interpolator/Interpolator.java index 8562d8e2eb..3811b0f8ea 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/project/builder/Interpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/Interpolator.java @@ -1,8 +1,10 @@ -package org.apache.maven.project.builder; +package org.apache.maven.model.interpolator; import java.io.IOException; import java.util.List; +import org.apache.maven.project.builder.PomClassicDomainModel; + public interface Interpolator { diff --git a/maven-model-builder/src/main/java/org/apache/maven/project/builder/InterpolatorProperty.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/InterpolatorProperty.java similarity index 99% rename from maven-model-builder/src/main/java/org/apache/maven/project/builder/InterpolatorProperty.java rename to maven-model-builder/src/main/java/org/apache/maven/model/interpolator/InterpolatorProperty.java index df2f7f7f09..f82197f68c 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/project/builder/InterpolatorProperty.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/InterpolatorProperty.java @@ -1,4 +1,4 @@ -package org.apache.maven.project.builder; +package org.apache.maven.model.interpolator; import java.util.*; diff --git a/maven-model-builder/src/main/java/org/apache/maven/project/builder/ModelProperty.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/ModelProperty.java similarity index 99% rename from maven-model-builder/src/main/java/org/apache/maven/project/builder/ModelProperty.java rename to maven-model-builder/src/main/java/org/apache/maven/model/interpolator/ModelProperty.java index b96115096e..8b2f5f9671 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/project/builder/ModelProperty.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/ModelProperty.java @@ -1,4 +1,4 @@ -package org.apache.maven.project.builder; +package org.apache.maven.model.interpolator; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -24,10 +24,11 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; + /** * Maps a URI to a string value, which may be null. This class is immutable. */ -public final class ModelProperty +final class ModelProperty { /** diff --git a/maven-model-builder/src/main/java/org/apache/maven/project/builder/PomInterpolatorTag.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/PomInterpolatorTag.java similarity index 70% rename from maven-model-builder/src/main/java/org/apache/maven/project/builder/PomInterpolatorTag.java rename to maven-model-builder/src/main/java/org/apache/maven/model/interpolator/PomInterpolatorTag.java index 5f7693550e..18c1057e8f 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/project/builder/PomInterpolatorTag.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolator/PomInterpolatorTag.java @@ -1,4 +1,4 @@ -package org.apache.maven.project.builder; +package org.apache.maven.model.interpolator; public enum PomInterpolatorTag diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java index f3ad21941c..3e72552e34 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java @@ -22,6 +22,8 @@ package org.apache.maven.profiles; import org.apache.maven.model.Activation; import org.apache.maven.model.Model; import org.apache.maven.model.Profile; +import org.apache.maven.model.interpolator.InterpolatorProperty; +import org.apache.maven.model.interpolator.PomInterpolatorTag; import org.apache.maven.profiles.ProfileActivationContext; import org.apache.maven.profiles.ProfileActivationException; import org.apache.maven.profiles.ProfileManager; @@ -30,8 +32,6 @@ import org.apache.maven.profiles.matchers.FileMatcher; import org.apache.maven.profiles.matchers.JdkMatcher; import org.apache.maven.profiles.matchers.ProfileMatcher; import org.apache.maven.profiles.matchers.PropertyMatcher; -import org.apache.maven.project.builder.InterpolatorProperty; -import org.apache.maven.project.builder.PomInterpolatorTag; import java.util.ArrayList; import java.util.Arrays; diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/ProfileManagerInfo.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/ProfileManagerInfo.java index 90c4fe9335..9f8fefc8c1 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/ProfileManagerInfo.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/ProfileManagerInfo.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; public class ProfileManagerInfo { diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/DefaultMatcher.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/DefaultMatcher.java index bffeb2051d..5c979ed93a 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/DefaultMatcher.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/DefaultMatcher.java @@ -22,7 +22,7 @@ package org.apache.maven.profiles.matchers; import java.util.List; import org.apache.maven.model.Profile; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; public class DefaultMatcher implements ProfileMatcher { diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/FileMatcher.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/FileMatcher.java index 353a4b93d2..7136d6bada 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/FileMatcher.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/FileMatcher.java @@ -5,7 +5,7 @@ import java.util.List; import org.apache.maven.model.ActivationFile; import org.apache.maven.model.Profile; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; public class FileMatcher implements ProfileMatcher { diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/JdkMatcher.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/JdkMatcher.java index 922d7aa19a..80e817fc28 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/JdkMatcher.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/JdkMatcher.java @@ -5,7 +5,7 @@ import java.util.Arrays; import java.util.List; import org.apache.maven.model.Profile; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; public class JdkMatcher implements ProfileMatcher diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/ProfileMatcher.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/ProfileMatcher.java index 293b372652..a0a7f56c93 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/ProfileMatcher.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/ProfileMatcher.java @@ -21,8 +21,8 @@ package org.apache.maven.profiles.matchers; import java.util.List; -import org.apache.maven.project.builder.InterpolatorProperty; import org.apache.maven.model.Profile; +import org.apache.maven.model.interpolator.InterpolatorProperty; public interface ProfileMatcher { diff --git a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/PropertyMatcher.java b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/PropertyMatcher.java index 3d606fdd24..4daa9fb916 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/PropertyMatcher.java +++ b/maven-model-builder/src/main/java/org/apache/maven/profiles/matchers/PropertyMatcher.java @@ -22,7 +22,7 @@ package org.apache.maven.profiles.matchers; import java.util.List; import org.apache.maven.model.Profile; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; public class PropertyMatcher implements ProfileMatcher { diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 39113b83cc..dd70be06ab 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -38,19 +38,19 @@ import org.apache.maven.artifact.resolver.ResolutionErrorHandler; import org.apache.maven.model.Build; import org.apache.maven.model.Model; import org.apache.maven.model.Profile; +import org.apache.maven.model.interpolator.DefaultInterpolator; +import org.apache.maven.model.interpolator.Interpolator; +import org.apache.maven.model.interpolator.InterpolatorProperty; +import org.apache.maven.model.interpolator.PomInterpolatorTag; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.profiles.DefaultProfileManager; import org.apache.maven.profiles.ProfileActivationException; import org.apache.maven.profiles.ProfileManagerInfo; import org.apache.maven.profiles.ProfileManager; import org.apache.maven.project.artifact.InvalidDependencyVersionException; -import org.apache.maven.project.builder.DefaultInterpolator; import org.apache.maven.project.builder.DomainModel; -import org.apache.maven.project.builder.Interpolator; -import org.apache.maven.project.builder.InterpolatorProperty; import org.apache.maven.project.builder.ModelEventListener; import org.apache.maven.project.builder.PomClassicDomainModel; -import org.apache.maven.project.builder.PomInterpolatorTag; import org.apache.maven.project.builder.ProcessorContext; import org.apache.maven.project.validation.ModelValidationResult; import org.apache.maven.project.validation.ModelValidator; diff --git a/maven-project/src/test/java/org/apache/maven/profiles/matchers/JdkMatcherTest.java b/maven-project/src/test/java/org/apache/maven/profiles/matchers/JdkMatcherTest.java index f21eac01bd..42a3353b9d 100644 --- a/maven-project/src/test/java/org/apache/maven/profiles/matchers/JdkMatcherTest.java +++ b/maven-project/src/test/java/org/apache/maven/profiles/matchers/JdkMatcherTest.java @@ -4,7 +4,7 @@ import java.util.Collections; import org.apache.maven.model.Activation; import org.apache.maven.model.Profile; -import org.apache.maven.project.builder.InterpolatorProperty; +import org.apache.maven.model.interpolator.InterpolatorProperty; import junit.framework.TestCase; diff --git a/maven-project/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java b/maven-project/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java index e4c40bf71e..a8d07c4a60 100644 --- a/maven-project/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java +++ b/maven-project/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java @@ -20,22 +20,13 @@ package org.apache.maven.project.harness; */ import java.io.*; -import java.util.HashMap; import java.util.Iterator; -import java.util.List; -import java.util.Map; import org.apache.commons.jxpath.JXPathContext; import org.apache.commons.jxpath.JXPathNotFoundException; import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl; -import org.apache.maven.model.Model; -import org.apache.maven.model.io.xpp3.MavenXpp3Writer; -import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.project.builder.ModelProperty; import org.apache.maven.project.builder.PomClassicDomainModel; import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.WriterFactory; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; public class PomTestWrapper {