You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2021/05/03 05:28:46 UTC

[tomee-patch-plugin] branch master updated (e8625bf -> 9562527)

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

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


    from e8625bf  Don't fail builds because default patch directories are not present
     new 7140cf8  Update source far more aggressively
     new 7fd8450  Ability to add maven coordinates to the compile phase
     new 9562527  Fix bug introduced affecting source excludes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/tomee/patch/plugin/PatchMojo.java   | 91 +++++++++-------------
 1 file changed, 37 insertions(+), 54 deletions(-)

[tomee-patch-plugin] 02/03: Ability to add maven coordinates to the compile phase

Posted by db...@apache.org.
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 <da...@gmail.com>
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;

[tomee-patch-plugin] 03/03: Fix bug introduced affecting source excludes

Posted by db...@apache.org.
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 9562527b12ec0cf6fa468de18f2aceaefa8dce5a
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun May 2 22:18:00 2021 -0700

    Fix bug introduced affecting source excludes
---
 .../src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java          | 2 +-
 1 file changed, 1 insertion(+), 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 cbea52e..d6d4cc2 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
@@ -507,7 +507,7 @@ public class PatchMojo extends AbstractMojo {
 
             final String path = file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1);
 
-            for (final String exclude : dependencies) {
+            for (final String exclude : sourceExcludes) {
                 if (path.matches(exclude)) {
                     getLog().debug("Exclude source file: " + file.getAbsolutePath());
                     continue copy;

[tomee-patch-plugin] 01/03: Update source far more aggressively

Posted by db...@apache.org.
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 7140cf8f9af2a70a02e718ea59464056a07adda6
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun May 2 19:45:28 2021 -0700

    Update source far more aggressively
---
 .../org/apache/tomee/patch/plugin/PatchMojo.java   | 81 ++++++++--------------
 1 file changed, 27 insertions(+), 54 deletions(-)

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 a5b16f5..0d3365a 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
@@ -524,60 +524,33 @@ public class PatchMojo extends AbstractMojo {
 
     private InputStream updateImports(final InputStream in) {
         return StreamBuilder.create(in)
-                .replace("import javax.activation", "import jakarta.activation")
-                .replace("import javax.annotation", "import jakarta.annotation")
-                .replace("import javax.batch", "import jakarta.batch")
-                .replace("import javax.decorator", "import jakarta.decorator")
-                .replace("import javax.ejb", "import jakarta.ejb")
-                .replace("import javax.el", "import jakarta.el")
-                .replace("import javax.enterprise", "import jakarta.enterprise")
-                .replace("import javax.inject", "import jakarta.inject")
-                .replace("import javax.interceptor", "import jakarta.interceptor")
-                .replace("import javax.jms", "import jakarta.jms")
-                .replace("import javax.json", "import jakarta.json")
-                .replace("import javax.json.bind", "import jakarta.json.bind")
-                .replace("import javax.jws", "import jakarta.jws")
-                .replace("import javax.mail", "import jakarta.mail")
-                .replace("import javax.persistence", "import jakarta.persistence")
-                .replace("import javax.resource", "import jakarta.resource")
-                .replace("import javax.security.auth.message", "import jakarta.security.auth.message")
-                .replace("import javax.security.enterprise", "import jakarta.security.enterprise")
-                .replace("import javax.security.jacc", "import jakarta.security.jacc")
-                .replace("import javax.servlet", "import jakarta.servlet")
-                .replace("import javax.transaction", "import jakarta.transaction")
-                .replace("import javax.validation", "import jakarta.validation")
-                .replace("import javax.websocket", "import jakarta.websocket")
-                .replace("import javax.ws.rs", "import jakarta.ws.rs")
-                .replace("import javax.xml.bind", "import jakarta.xml.bind")
-                .replace("import javax.xml.soap", "import jakarta.xml.soap")
-                .replace("import javax.xml.ws", "import jakarta.xml.ws")
-                .replace("import static javax.activation", "import static jakarta.activation")
-                .replace("import static javax.annotation", "import static jakarta.annotation")
-                .replace("import static javax.batch", "import static jakarta.batch")
-                .replace("import static javax.decorator", "import static jakarta.decorator")
-                .replace("import static javax.ejb", "import static jakarta.ejb")
-                .replace("import static javax.el", "import static jakarta.el")
-                .replace("import static javax.enterprise", "import static jakarta.enterprise")
-                .replace("import static javax.inject", "import static jakarta.inject")
-                .replace("import static javax.interceptor", "import static jakarta.interceptor")
-                .replace("import static javax.jms", "import static jakarta.jms")
-                .replace("import static javax.json", "import static jakarta.json")
-                .replace("import static javax.json.bind", "import static jakarta.json.bind")
-                .replace("import static javax.jws", "import static jakarta.jws")
-                .replace("import static javax.mail", "import static jakarta.mail")
-                .replace("import static javax.persistence", "import static jakarta.persistence")
-                .replace("import static javax.resource", "import static jakarta.resource")
-                .replace("import static javax.security.auth.message", "import static jakarta.security.auth.message")
-                .replace("import static javax.security.enterprise", "import static jakarta.security.enterprise")
-                .replace("import static javax.security.jacc", "import static jakarta.security.jacc")
-                .replace("import static javax.servlet", "import static jakarta.servlet")
-                .replace("import static javax.transaction", "import static jakarta.transaction")
-                .replace("import static javax.validation", "import static jakarta.validation")
-                .replace("import static javax.websocket", "import static jakarta.websocket")
-                .replace("import static javax.ws.rs", "import static jakarta.ws.rs")
-                .replace("import static javax.xml.bind", "import static jakarta.xml.bind")
-                .replace("import static javax.xml.soap", "import static jakarta.xml.soap")
-                .replace("import static javax.xml.ws", "import static jakarta.xml.ws")
+                .replace("javax.activation", "jakarta.activation")
+                .replace("javax.annotation", "jakarta.annotation")
+                .replace("javax.batch", "jakarta.batch")
+                .replace("javax.decorator", "jakarta.decorator")
+                .replace("javax.ejb", "jakarta.ejb")
+                .replace("javax.el", "jakarta.el")
+                .replace("javax.enterprise", "jakarta.enterprise")
+                .replace("javax.inject", "jakarta.inject")
+                .replace("javax.interceptor", "jakarta.interceptor")
+                .replace("javax.jms", "jakarta.jms")
+                .replace("javax.json", "jakarta.json")
+                .replace("javax.json.bind", "jakarta.json.bind")
+                .replace("javax.jws", "jakarta.jws")
+                .replace("javax.mail", "jakarta.mail")
+                .replace("javax.persistence", "jakarta.persistence")
+                .replace("javax.resource", "jakarta.resource")
+                .replace("javax.security.auth.message", "jakarta.security.auth.message")
+                .replace("javax.security.enterprise", "jakarta.security.enterprise")
+                .replace("javax.security.jacc", "jakarta.security.jacc")
+                .replace("javax.servlet", "jakarta.servlet")
+                .replace("javax.transaction", "jakarta.transaction")
+                .replace("javax.validation", "jakarta.validation")
+                .replace("javax.websocket", "jakarta.websocket")
+                .replace("javax.ws.rs", "jakarta.ws.rs")
+                .replace("javax.xml.bind", "jakarta.xml.bind")
+                .replace("javax.xml.soap", "jakarta.xml.soap")
+                .replace("javax.xml.ws", "jakarta.xml.ws")
 
                 // These sub packages to the above must be renamed back
                 .replace("jakarta.annotation.process", "javax.annotation.process")