This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git

commit 7fd8450623cf75c1f6de64caf8c16d2b2340e7b5
Author: David Blevins <[email protected]>
AuthorDate: Sun May 2 21:33:52 2021 -0700

    Ability to add maven coordinates to the compile phase
---
 .../main/java/org/apache/tomee/patch/plugin/PatchMojo.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java 
b/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
index 0d3365a..cbea52e 100644
--- 
a/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
+++ 
b/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
@@ -46,6 +46,7 @@ import org.tomitribe.jkta.util.Paths;
 import org.tomitribe.swizzle.stream.StreamBuilder;
 import org.tomitribe.util.Files;
 import org.tomitribe.util.IO;
+import org.tomitribe.util.Mvn;
 import org.tomitribe.util.Zips;
 
 import java.io.File;
@@ -83,6 +84,9 @@ public class PatchMojo extends AbstractMojo {
     @Parameter
     private List<String> sourceExcludes = new ArrayList<>();
 
+    @Parameter
+    private List<String> dependencies = new ArrayList<>();
+
     /**
      * Regex to identify which archives should be matched
      */
@@ -413,6 +417,12 @@ public class PatchMojo extends AbstractMojo {
                 .map(File::getAbsolutePath)
                 .forEach(compilerConfiguration::addClasspathEntry);
 
+
+        dependencies.stream()
+                .map(Mvn::mvn)
+                .map(File::getAbsolutePath)
+                .forEach(compilerConfiguration::addClasspathEntry);
+
         // Now we can compile!
         final CompilerResult compilerResult;
         try {
@@ -497,7 +507,7 @@ public class PatchMojo extends AbstractMojo {
 
             final String path = 
file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1);
 
-            for (final String exclude : sourceExcludes) {
+            for (final String exclude : dependencies) {
                 if (path.matches(exclude)) {
                     getLog().debug("Exclude source file: " + 
file.getAbsolutePath());
                     continue copy;

Reply via email to