You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/03/16 13:42:05 UTC

[maven-patch-plugin] branch master updated (813f698 -> 27251b0)

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

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


    from 813f698  Update parent
     new db58bb0  MPATCH-20 added support for excludePattern
     new 536980d  added java doc and since tag
     new 0009cd3  MPATCH-20 renamed excludes property
     new a77587e  MPATCH-20 applied review comments
     new 7762bda  fix default value of excludePatterns
     new 5b3edfb  MPATCH-20 use project.version in favour of pom.version
     new b685719  MPATCH-20 use generics on new code
     new 27251b0  Lock JDK versions: Java 6 compatible project doesn't compile with JDK 12

The 8 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:
 Jenkinsfile                                        |  2 +-
 .../pom.xml                                        | 20 ++++++++++-------
 .../src/main/patches/first.patch                   |  0
 .../src/main/patches/second.patch}                 |  6 +++---
 .../verify.bsh                                     |  0
 .../pom.xml                                        | 25 +++++++++++-----------
 .../src/main/patches/first.patch                   |  0
 .../src/main/patches/second.patch}                 |  6 +++---
 .../verify.bsh                                     |  8 +++----
 .../pom.xml                                        | 24 ++++++++++-----------
 .../src/main/patches/first.patch                   |  0
 .../src/main/patches/second.patch}                 |  6 +++---
 .../verify.bsh                                     |  4 ++--
 .../org/apache/maven/plugin/patch/ApplyMojo.java   | 20 ++++++++++++++++-
 14 files changed, 72 insertions(+), 49 deletions(-)
 copy src/it/{apply-two-patches-in-order => cant-exclude-patches-from-patches}/pom.xml (83%)
 copy src/it/{skip-when-patch-tracking-file-present => cant-exclude-patches-from-patches}/src/main/patches/first.patch (100%)
 copy src/it/{remove-empty-files/src/main/patches/first.patch => cant-exclude-patches-from-patches/src/main/patches/second.patch} (90%)
 copy src/it/{path with spaces => cant-exclude-patches-from-patches}/verify.bsh (100%)
 copy src/it/{apply-two-patches-in-order => exclude-multiple-patterns-from-patchDirectory}/pom.xml (80%)
 copy src/it/{skip-when-patch-tracking-file-present => exclude-multiple-patterns-from-patchDirectory}/src/main/patches/first.patch (100%)
 copy src/it/{remove-empty-files/src/main/patches/first.patch => exclude-multiple-patterns-from-patchDirectory/src/main/patches/second.patch} (90%)
 copy src/it/{path with spaces => exclude-multiple-patterns-from-patchDirectory}/verify.bsh (85%)
 copy src/it/{apply-two-patches-in-order => exclude-patches-from-patchDirectory}/pom.xml (81%)
 copy src/it/{skip-when-patch-tracking-file-present => exclude-patches-from-patchDirectory}/src/main/patches/first.patch (100%)
 copy src/it/{remove-empty-files/src/main/patches/first.patch => exclude-patches-from-patchDirectory/src/main/patches/second.patch} (90%)
 copy src/it/{path with spaces => exclude-patches-from-patchDirectory}/verify.bsh (92%)


[maven-patch-plugin] 08/08: Lock JDK versions: Java 6 compatible project doesn't compile with JDK 12

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 27251b07b0c1a8f662fd3b24058c40ba1839d2fd
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Mar 16 14:41:51 2019 +0100

    Lock JDK versions: Java 6 compatible project doesn't compile with JDK 12
---
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e9f05f7..a549506 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-asfMavenTlpPlgnBuild()
+asfMavenTlpPlgnBuild(jdk:['7','8','11'])


[maven-patch-plugin] 02/08: added java doc and since tag

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 536980d7cc7f94aff09bd2e550373f8cdd2e8c0e
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Mon Mar 5 21:20:27 2018 +0100

    added java doc and since tag
---
 src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 83da555..1bfef97 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -237,6 +237,13 @@ public class ApplyMojo
     @Parameter( defaultValue = "false" )
     private boolean binary;
 
+    /**
+     * List of ANT-style exclude patterns separated by a comma. These patterns are used to exclude patch files found
+     * in the {@link ApplyMojo#patchDirectory}. These exclude patterns does not apply to a static defined list of
+     * {@link ApplyMojo#patches}.
+     *
+     * @since 1.3
+     */
     @Parameter
     private String excludePattern;
 


[maven-patch-plugin] 04/08: MPATCH-20 applied review comments

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a77587e979d2f09f32d5d2194f401d157b0bb457
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Thu Aug 30 21:15:43 2018 +0200

    MPATCH-20 applied review comments
---
 src/it/cant-exclude-patches-from-patches/pom.xml   |  4 +-
 .../pom.xml                                        |  9 +++--
 .../src/main/patches/first.patch                   | 26 +++++++++++++
 .../src/main/patches/second.patch                  | 25 ++++++++++++
 .../verify.bsh                                     | 45 ++++++++++++++++++++++
 src/it/exclude-patches-from-patchDirectory/pom.xml |  4 +-
 .../org/apache/maven/plugin/patch/ApplyMojo.java   | 11 ++++--
 7 files changed, 115 insertions(+), 9 deletions(-)

diff --git a/src/it/cant-exclude-patches-from-patches/pom.xml b/src/it/cant-exclude-patches-from-patches/pom.xml
index e13970e..7dbcb37 100644
--- a/src/it/cant-exclude-patches-from-patches/pom.xml
+++ b/src/it/cant-exclude-patches-from-patches/pom.xml
@@ -39,7 +39,9 @@
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>
           <!-- this exclude does not work, as it is only excluding files from patchDirectory -->
-          <excludePattern>se*.patch</excludePattern>
+          <excludes>
+            <exclude>se*.patch</exclude>
+          </excludes>
           <!-- both patches should be executed -->
           <patches>
             <patch>first.patch</patch>
diff --git a/src/it/exclude-patches-from-patchDirectory/pom.xml b/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
similarity index 88%
copy from src/it/exclude-patches-from-patchDirectory/pom.xml
copy to src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
index 6e5b626..d2fdf16 100644
--- a/src/it/exclude-patches-from-patchDirectory/pom.xml
+++ b/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
@@ -21,8 +21,8 @@
   <modelVersion>4.0.0</modelVersion>
   
   <groupId>test</groupId>
-  <artifactId>exclude-patches-from-patchDirectory</artifactId>
-  <name>exclude-patches-from-patchDirectory</name>
+  <artifactId>exclude-multiple-patterns-from-patchDirectory</artifactId>
+  <name>exclude-multiple-patterns-from-patchDirectory</name>
   <version>1.0-SNAPSHOT</version>
 
   <properties>
@@ -38,7 +38,10 @@
 
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>
-          <excludePattern>se*.patch</excludePattern>
+          <excludes>
+            <exclude>fi*st.patch</exclude>
+            <exclude>se*.patch</exclude>
+          </excludes>
           <!-- enables reading of patches from src/main/patches -->
           <naturalOrderProcessing>true</naturalOrderProcessing>
         </configuration>
diff --git a/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/first.patch b/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/first.patch
new file mode 100644
index 0000000..5c6f211
--- /dev/null
+++ b/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/first.patch
@@ -0,0 +1,26 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test.txt
+===================================================================
+--- target/test.txt	(revision 0)
++++ target/test.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+\ No newline at end of file
+
diff --git a/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/second.patch b/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/second.patch
new file mode 100644
index 0000000..0ae1671
--- /dev/null
+++ b/src/it/exclude-multiple-patterns-from-patchDirectory/src/main/patches/second.patch
@@ -0,0 +1,25 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test2.txt
+===================================================================
+--- target/test2.txt	(revision 0)
++++ target/test2.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+
diff --git a/src/it/exclude-multiple-patterns-from-patchDirectory/verify.bsh b/src/it/exclude-multiple-patterns-from-patchDirectory/verify.bsh
new file mode 100644
index 0000000..198920e
--- /dev/null
+++ b/src/it/exclude-multiple-patterns-from-patchDirectory/verify.bsh
@@ -0,0 +1,45 @@
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
+import java.io.*;
+import java.util.*;
+
+try
+{
+    File testFile = new File( basedir, "target/test.txt" );
+    if ( testFile.isFile() )
+    {
+        System.err.println( "File must not exist: " + testFile );
+        return false;
+    }
+
+    testFile = new File( basedir, "target/test2.txt" );
+    if ( testFile.isFile() )
+    {
+        System.err.println( "File must not exist: " + testFile );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;
diff --git a/src/it/exclude-patches-from-patchDirectory/pom.xml b/src/it/exclude-patches-from-patchDirectory/pom.xml
index 6e5b626..51722e0 100644
--- a/src/it/exclude-patches-from-patchDirectory/pom.xml
+++ b/src/it/exclude-patches-from-patchDirectory/pom.xml
@@ -38,7 +38,9 @@
 
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>
-          <excludePattern>se*.patch</excludePattern>
+          <excludes>
+            <exclude>se*.patch</exclude>
+          </excludes>
           <!-- enables reading of patches from src/main/patches -->
           <naturalOrderProcessing>true</naturalOrderProcessing>
         </configuration>
diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 5f497e2..112b5ad 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -27,6 +27,7 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -238,14 +239,14 @@ public class ApplyMojo
     private boolean binary;
 
     /**
-     * List of ANT-style exclude patterns separated by a comma. These patterns are used to exclude patch files found
+     * List of ANT-style exclude patterns. These patterns are used to exclude patch files found
      * in the {@link ApplyMojo#patchDirectory}. These exclude patterns does not apply to a static defined list of
      * {@link ApplyMojo#patches}.
      *
      * @since 1.3
      */
     @Parameter
-    private String excludes;
+    private List excludes;
 
     /**
      * Apply the patches. Give preference to patchFile over patchSourceDir/patches, and preference to originalFile over
@@ -288,12 +289,14 @@ public class ApplyMojo
                         + patchDirectory );
                 }
 
+                String excludePatterns = "";
                 if ( excludes != null )
                 {
-                    getLog().info( "Exclude pattern: " + excludes);
+                    excludePatterns = StringUtils.join( excludes.iterator(), "," );
+                    getLog().info( "Exclude pattern: " + excludePatterns );
                 }
 
-                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", excludes, false );
+                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", excludePatterns, false );
 
                 patchesToApply = findPatchesToApply( foundPatchFiles, patchDirectory );
 


[maven-patch-plugin] 05/08: fix default value of excludePatterns

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7762bda9956e40dbf50e5dfc865a95365bbffb55
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Thu Nov 8 09:30:07 2018 +0100

    fix default value of excludePatterns
    
    Co-Authored-By: matthiasbalke <ma...@googlemail.com>
---
 src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 112b5ad..b8117b2 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -289,7 +289,7 @@ public class ApplyMojo
                         + patchDirectory );
                 }
 
-                String excludePatterns = "";
+                String excludePatterns = null;
                 if ( excludes != null )
                 {
                     excludePatterns = StringUtils.join( excludes.iterator(), "," );


[maven-patch-plugin] 03/08: MPATCH-20 renamed excludes property

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0009cd3ffe65da65865d6e14c5458d4cb521b5d7
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Wed Aug 29 14:12:48 2018 +0200

    MPATCH-20 renamed excludes property
---
 src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 1bfef97..5f497e2 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -245,7 +245,7 @@ public class ApplyMojo
      * @since 1.3
      */
     @Parameter
-    private String excludePattern;
+    private String excludes;
 
     /**
      * Apply the patches. Give preference to patchFile over patchSourceDir/patches, and preference to originalFile over
@@ -288,12 +288,12 @@ public class ApplyMojo
                         + patchDirectory );
                 }
 
-                if ( excludePattern != null )
+                if ( excludes != null )
                 {
-                    getLog().info( "Exclude pattern: " + excludePattern );
+                    getLog().info( "Exclude pattern: " + excludes);
                 }
 
-                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", excludePattern, false );
+                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", excludes, false );
 
                 patchesToApply = findPatchesToApply( foundPatchFiles, patchDirectory );
 


[maven-patch-plugin] 06/08: MPATCH-20 use project.version in favour of pom.version

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5b3edfbd599144b03d0cc30e7b13522a63e8d2f4
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Fri Nov 9 12:02:50 2018 +0100

    MPATCH-20 use project.version in favour of pom.version
---
 src/it/cant-exclude-patches-from-patches/pom.xml             | 2 +-
 src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml | 2 +-
 src/it/exclude-patches-from-patchDirectory/pom.xml           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/it/cant-exclude-patches-from-patches/pom.xml b/src/it/cant-exclude-patches-from-patches/pom.xml
index 7dbcb37..38879fe 100644
--- a/src/it/cant-exclude-patches-from-patches/pom.xml
+++ b/src/it/cant-exclude-patches-from-patches/pom.xml
@@ -34,7 +34,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-patch-plugin</artifactId>
-        <version>@pom.version@</version>
+        <version>@project.version@</version>
 
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>
diff --git a/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml b/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
index d2fdf16..7eef048 100644
--- a/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
+++ b/src/it/exclude-multiple-patterns-from-patchDirectory/pom.xml
@@ -34,7 +34,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-patch-plugin</artifactId>
-        <version>@pom.version@</version>
+        <version>@project.version@</version>
 
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>
diff --git a/src/it/exclude-patches-from-patchDirectory/pom.xml b/src/it/exclude-patches-from-patchDirectory/pom.xml
index 51722e0..087c143 100644
--- a/src/it/exclude-patches-from-patchDirectory/pom.xml
+++ b/src/it/exclude-patches-from-patchDirectory/pom.xml
@@ -34,7 +34,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-patch-plugin</artifactId>
-        <version>@pom.version@</version>
+        <version>@project.version@</version>
 
         <configuration>
           <targetDirectory>${basedir}</targetDirectory>


[maven-patch-plugin] 07/08: MPATCH-20 use generics on new code

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b685719b07df204977e96ea105213ba040055327
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Fri Nov 9 12:03:04 2018 +0100

    MPATCH-20 use generics on new code
---
 src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index b8117b2..d253a79 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -246,7 +246,7 @@ public class ApplyMojo
      * @since 1.3
      */
     @Parameter
-    private List excludes;
+    private List<String> excludes;
 
     /**
      * Apply the patches. Give preference to patchFile over patchSourceDir/patches, and preference to originalFile over


[maven-patch-plugin] 01/08: MPATCH-20 added support for excludePattern

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit db58bb0932593f43e3e96a0496da5a4ceedd58a5
Author: Matthias Balke <ma...@googlemail.com>
AuthorDate: Mon Mar 5 16:33:29 2018 +0100

    MPATCH-20 added support for excludePattern
---
 src/it/cant-exclude-patches-from-patches/pom.xml   | 67 ++++++++++++++++++++++
 .../src/main/patches/first.patch                   | 26 +++++++++
 .../src/main/patches/second.patch                  | 25 ++++++++
 .../cant-exclude-patches-from-patches/verify.bsh   | 45 +++++++++++++++
 src/it/exclude-patches-from-patchDirectory/pom.xml | 63 ++++++++++++++++++++
 .../src/main/patches/first.patch                   | 26 +++++++++
 .../src/main/patches/second.patch                  | 25 ++++++++
 .../exclude-patches-from-patchDirectory/verify.bsh | 45 +++++++++++++++
 .../org/apache/maven/plugin/patch/ApplyMojo.java   | 10 +++-
 9 files changed, 331 insertions(+), 1 deletion(-)

diff --git a/src/it/cant-exclude-patches-from-patches/pom.xml b/src/it/cant-exclude-patches-from-patches/pom.xml
new file mode 100644
index 0000000..e13970e
--- /dev/null
+++ b/src/it/cant-exclude-patches-from-patches/pom.xml
@@ -0,0 +1,67 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>test</groupId>
+  <artifactId>cant-exclude-patches-from-patches</artifactId>
+  <name>cant-exclude-patches-from-patches</name>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-patch-plugin</artifactId>
+        <version>@pom.version@</version>
+
+        <configuration>
+          <targetDirectory>${basedir}</targetDirectory>
+          <!-- this exclude does not work, as it is only excluding files from patchDirectory -->
+          <excludePattern>se*.patch</excludePattern>
+          <!-- both patches should be executed -->
+          <patches>
+            <patch>first.patch</patch>
+            <patch>second.patch</patch>
+          </patches>
+        </configuration>
+
+        <executions>
+          <execution>
+            <id>apply-patches</id>
+
+            <phase>initialize</phase>
+
+            <goals>
+              <goal>apply</goal>
+            </goals>
+
+            <configuration>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/cant-exclude-patches-from-patches/src/main/patches/first.patch b/src/it/cant-exclude-patches-from-patches/src/main/patches/first.patch
new file mode 100644
index 0000000..5c6f211
--- /dev/null
+++ b/src/it/cant-exclude-patches-from-patches/src/main/patches/first.patch
@@ -0,0 +1,26 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test.txt
+===================================================================
+--- target/test.txt	(revision 0)
++++ target/test.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+\ No newline at end of file
+
diff --git a/src/it/cant-exclude-patches-from-patches/src/main/patches/second.patch b/src/it/cant-exclude-patches-from-patches/src/main/patches/second.patch
new file mode 100644
index 0000000..0ae1671
--- /dev/null
+++ b/src/it/cant-exclude-patches-from-patches/src/main/patches/second.patch
@@ -0,0 +1,25 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test2.txt
+===================================================================
+--- target/test2.txt	(revision 0)
++++ target/test2.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+
diff --git a/src/it/cant-exclude-patches-from-patches/verify.bsh b/src/it/cant-exclude-patches-from-patches/verify.bsh
new file mode 100644
index 0000000..dd3f3b8
--- /dev/null
+++ b/src/it/cant-exclude-patches-from-patches/verify.bsh
@@ -0,0 +1,45 @@
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
+import java.io.*;
+import java.util.*;
+
+try
+{
+    File testFile = new File( basedir, "target/test.txt" );
+    if ( !testFile.isFile() )
+    {
+        System.err.println( "Missing test file: " + testFile );
+        return false;
+    }
+
+    testFile = new File( basedir, "target/test2.txt" );
+    if ( !testFile.isFile() )
+    {
+        System.err.println( "Missing test file: " + testFile );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;
diff --git a/src/it/exclude-patches-from-patchDirectory/pom.xml b/src/it/exclude-patches-from-patchDirectory/pom.xml
new file mode 100644
index 0000000..6e5b626
--- /dev/null
+++ b/src/it/exclude-patches-from-patchDirectory/pom.xml
@@ -0,0 +1,63 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>test</groupId>
+  <artifactId>exclude-patches-from-patchDirectory</artifactId>
+  <name>exclude-patches-from-patchDirectory</name>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-patch-plugin</artifactId>
+        <version>@pom.version@</version>
+
+        <configuration>
+          <targetDirectory>${basedir}</targetDirectory>
+          <excludePattern>se*.patch</excludePattern>
+          <!-- enables reading of patches from src/main/patches -->
+          <naturalOrderProcessing>true</naturalOrderProcessing>
+        </configuration>
+
+        <executions>
+          <execution>
+            <id>apply-patches</id>
+
+            <phase>initialize</phase>
+
+            <goals>
+              <goal>apply</goal>
+            </goals>
+
+            <configuration>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/exclude-patches-from-patchDirectory/src/main/patches/first.patch b/src/it/exclude-patches-from-patchDirectory/src/main/patches/first.patch
new file mode 100644
index 0000000..5c6f211
--- /dev/null
+++ b/src/it/exclude-patches-from-patchDirectory/src/main/patches/first.patch
@@ -0,0 +1,26 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test.txt
+===================================================================
+--- target/test.txt	(revision 0)
++++ target/test.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+\ No newline at end of file
+
diff --git a/src/it/exclude-patches-from-patchDirectory/src/main/patches/second.patch b/src/it/exclude-patches-from-patchDirectory/src/main/patches/second.patch
new file mode 100644
index 0000000..0ae1671
--- /dev/null
+++ b/src/it/exclude-patches-from-patchDirectory/src/main/patches/second.patch
@@ -0,0 +1,25 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+Index: target/test2.txt
+===================================================================
+--- target/test2.txt	(revision 0)
++++ target/test2.txt	(revision 0)
+@@ -0,0 +1 @@
++This is a test.
+
diff --git a/src/it/exclude-patches-from-patchDirectory/verify.bsh b/src/it/exclude-patches-from-patchDirectory/verify.bsh
new file mode 100644
index 0000000..7be8344
--- /dev/null
+++ b/src/it/exclude-patches-from-patchDirectory/verify.bsh
@@ -0,0 +1,45 @@
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
+import java.io.*;
+import java.util.*;
+
+try
+{
+    File testFile = new File( basedir, "target/test.txt" );
+    if ( !testFile.isFile() )
+    {
+        System.err.println( "Missing test file: " + testFile );
+        return false;
+    }
+
+    testFile = new File( basedir, "target/test2.txt" );
+    if ( testFile.isFile() )
+    {
+        System.err.println( "File must not exist: " + testFile );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
index 2066b8a..83da555 100644
--- a/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
+++ b/src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java
@@ -237,6 +237,9 @@ public class ApplyMojo
     @Parameter( defaultValue = "false" )
     private boolean binary;
 
+    @Parameter
+    private String excludePattern;
+
     /**
      * Apply the patches. Give preference to patchFile over patchSourceDir/patches, and preference to originalFile over
      * workDir.
@@ -278,7 +281,12 @@ public class ApplyMojo
                         + patchDirectory );
                 }
 
-                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", null, false );
+                if ( excludePattern != null )
+                {
+                    getLog().info( "Exclude pattern: " + excludePattern );
+                }
+
+                List foundPatchFiles = FileUtils.getFileNames( patchDirectory, "*", excludePattern, false );
 
                 patchesToApply = findPatchesToApply( foundPatchFiles, patchDirectory );