[MCOMPILER-320] Introduce additionalClasspathElements property
diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
index 78d3908..0f46c07 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
@@ -124,6 +124,14 @@
     @Parameter
     private boolean multiReleaseOutput;
 
+    /**
+     * A list of additional filesystem paths to include on the compile class path beyond the resolved dependency
+     * set.  This is useful in conjunction with the dependency plugin for cases where there are items that must not
+     * be included in other phases of the build, but are nevertheless required during compilation.
+     */
+    @Parameter
+    private List<String> additionalClasspathElements = new ArrayList<>();
+
     @Component
     private LocationManager locationManager;
 
@@ -275,7 +283,9 @@
                         }
                     }
                 }
-                
+
+                classpathElements.addAll( additionalClasspathElements );
+
                 for ( File file : resolvePathsResult.getModulepathElements().keySet() )
                 {
                     modulepathElements.add( file.getPath() );
@@ -292,7 +302,10 @@
         }
         else
         {
-            classpathElements = compilePath;
+            List<String> list = new ArrayList<>( compilePath.size() + additionalClasspathElements.size() );
+            list.addAll( compilePath );
+            list.addAll( additionalClasspathElements );
+            classpathElements = list;
             modulepathElements = Collections.emptyList();
         }
     }
diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
index 5b0518b..16cf038 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
@@ -163,6 +163,14 @@
     @Component
     private LocationManager locationManager;
 
+    /**
+     * A list of additional filesystem paths to include on the compile class path beyond the resolved dependency
+     * set.  This is useful in conjunction with the dependency plugin for cases where there are items that must not
+     * be included in other phases of the build, but are nevertheless required during compilation.
+     */
+    @Parameter
+    private List<String> additionalClasspathElements = new ArrayList<>();
+
     private Map<String, JavaModuleDescriptor> pathElements;
     
     private Collection<String> classpathElements;
@@ -306,7 +314,10 @@
             {
                 pathElements = Collections.emptyMap();
                 modulepathElements = Collections.emptyList();
-                classpathElements = testPath;
+                List<String> list = new ArrayList<>( testPath.size() + additionalClasspathElements.size() );
+                list.addAll( testPath );
+                list.addAll( additionalClasspathElements );
+                classpathElements = list;
                 return;
             }
         }
@@ -314,14 +325,17 @@
         {
             pathElements = Collections.emptyMap();
             modulepathElements = Collections.emptyList();
-            classpathElements = testPath;
+            List<String> list = new ArrayList<>( testPath.size() + additionalClasspathElements.size() );
+            list.addAll( testPath );
+            list.addAll( additionalClasspathElements );
+            classpathElements = list;
             return;
         }
             
         if ( testModuleDescriptor != null )
         {
             modulepathElements = testPath;
-            classpathElements = Collections.emptyList();
+            classpathElements = new ArrayList<>( additionalClasspathElements );
 
             if ( mainModuleDescriptor != null )
             {
@@ -392,6 +406,10 @@
                 {
                     patchModuleValue.append( root ).append( PS );
                 }
+                for ( String item : additionalClasspathElements )
+                {
+                    patchModuleValue.append( item ).append( PS );
+                }
                 
                 compilerArgs.add( patchModuleValue.toString() );
                 
@@ -401,7 +419,10 @@
             else
             {
                 modulepathElements = Collections.emptyList();
-                classpathElements = testPath;
+                List<String> list = new ArrayList<>( compilePath.size() + additionalClasspathElements.size() );
+                list.addAll( compilePath );
+                list.addAll( additionalClasspathElements );
+                classpathElements = list;
             }
         }
     }