configure paths and sites in pom instead of hardcoding Map in source

git-svn-id: https://svn.apache.org/repos/asf/maven/sandbox/trunk@1538768 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dist-tools/dist-tool-plugin/pom.xml b/dist-tools/dist-tool-plugin/pom.xml
index ebe0b78..577e78d 100644
--- a/dist-tools/dist-tool-plugin/pom.xml
+++ b/dist-tools/dist-tool-plugin/pom.xml
@@ -272,6 +272,15 @@
             <ignoreDistFailure>apache-jar-resource-bundle:1.4</ignoreDistFailure>
             <ignoreDistFailure>apache-license-header-resource-bundle:1.1</ignoreDistFailure>
           </ignoreDistFailures>
+          <sites>
+            <apache>http://maven.apache.org/pom/asf/</apache>
+            <maven-parent>http://maven.apache.org/pom/maven/</maven-parent>
+          </sites>
+          <paths>
+            <apache>/asf/</apache>
+            <maven-parent>/maven/</maven-parent>
+            <maven-skins>/skins/</maven-skins>
+          </paths>
         </configuration>
         <reportSets>
           <reportSet>
diff --git a/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckIndexPageMojo.java b/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckIndexPageMojo.java
index 8d9c801..5b537b7 100644
--- a/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckIndexPageMojo.java
+++ b/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckIndexPageMojo.java
@@ -58,8 +58,17 @@
 
     private static final Map<String, IndexPage> INDEX_PAGES_REF;
 
-    // artifact-id -> path when path is not the classical /artifact-id/
-    private static final Map<String, String> ARTIFACT_PATHS;
+    /**
+     * Path in index page mapping, when path is not the classical /artifact-id/ 
+     * The configuration looks like this:
+     * <pre>
+     *   &lt;paths&gt;
+     *     &lt;artifact-id&gt;/directory/&lt;/artifact-id&gt;
+     *   &lt;/paths&gt;
+     * </pre>
+     */
+    @Parameter
+    private Map<String, String> paths;
 
     private static class IndexPage
     {
@@ -86,12 +95,6 @@
             aMap.put(  ip.url, ip );
         }
         INDEX_PAGES_REF = Collections.unmodifiableMap( aMap );
-
-        Map<String, String> path = new HashMap<>();
-        path.put( "apache", "/asf/" );
-        path.put( "maven-parent", "/maven/" );
-        path.put( "maven-skins", "/skins/" );
-        ARTIFACT_PATHS = Collections.unmodifiableMap( path );
     }
 
     /**
@@ -297,7 +300,7 @@
 
         Elements a = doc.select( "tr > td > a[href]:not(.externalLink)" );
 
-        String path = ARTIFACT_PATHS.get( cli.getArtifactId() );
+        String path = paths.get( cli.getArtifactId() );
         if ( path == null )
         {
             path = '/' + cli.getArtifactId() + '/';
diff --git a/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java b/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
index 726631c..46fb065 100644
--- a/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
+++ b/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -101,16 +100,17 @@
      */
     protected static final int HTTP_OK = 200;
 
-    // artifact-id -> url when site url read in pom doesn't get the expected value
-    private static final Map<String, String> ARTIFACT_SITE_URLS;
-
-    static
-    {
-        Map<String, String> urls = new HashMap<>();
-        urls.put( "apache", "http://maven.apache.org/pom/asf/" );
-        urls.put( "maven-parent", "http://maven.apache.org/pom/maven/" );
-        ARTIFACT_SITE_URLS = Collections.unmodifiableMap( urls );
-    }
+    /**
+     * Site url mapping, when site url read in pom doesn't get the expected value 
+     * The configuration looks like this:
+     * <pre>
+     *   &lt;sites&gt;
+     *     &lt;artifact-id&gt;site url&lt;/artifact-id&gt;
+     *   &lt;/sites&gt;
+     * </pre>
+     */
+    @Parameter
+    private Map<String, String> sites;
 
     @Override
     boolean isIndexPageCheck()
@@ -433,7 +433,7 @@
             MavenProject artifactProject =
                 mavenProjectBuilder.buildFromRepository( artifact, artifactRepositories, localRepository, false );
 
-            String siteUrl = ARTIFACT_SITE_URLS.get( cli.getArtifactId() );
+            String siteUrl = sites.get( cli.getArtifactId() );
             if ( siteUrl == null )
             {
                 siteUrl = artifactProject.getUrl();