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

kwin pushed a commit to branch feature/allow-names-containing-target
in repository https://gitbox.apache.org/repos/asf/maven-apache-resources.git

commit fc253c91b979707f5438c1be8b02262f9967a254
Author: Konrad Windszus <k...@apache.org>
AuthorDate: Mon Jul 8 20:13:11 2024 +0200

    [MASFRES-69] Allow files/directories with names containing "target"
---
 .../src/main/resources/assemblies/source-shared.xml     |  2 +-
 .../org/apache/its/IT_005_MiscellaneousExcludes.java    |  4 ++--
 .../src/test/resources/misc-excludes/some-target.txt    | 17 +++++++++++++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/source-release/src/main/resources/assemblies/source-shared.xml 
b/source-release/src/main/resources/assemblies/source-shared.xml
index f96e389..7fb04d6 100644
--- a/source-release/src/main/resources/assemblies/source-shared.xml
+++ b/source-release/src/main/resources/assemblies/source-shared.xml
@@ -27,7 +27,7 @@
       <useDefaultExcludes>true</useDefaultExcludes>
       <excludes>
         <!-- build output -->
-        
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/).*${project.build.directory}.*]</exclude>
+        
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)${project.build.directory}(/.*)?]</exclude>
 
         <!-- NOTE: Most of the following excludes should not be required
              if the standard release process is followed. This is because the
diff --git 
a/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java 
b/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java
index d986d60..ea01d63 100644
--- 
a/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java
+++ 
b/source-release/src/test/java/org/apache/its/IT_005_MiscellaneousExcludes.java
@@ -21,7 +21,6 @@ package org.apache.its;
 import java.io.File;
 import java.io.IOException;
 import java.net.URISyntaxException;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -52,7 +51,7 @@ public class IT_005_MiscellaneousExcludes {
 
         File assembly = new File(testDir, "target/" + BASENAME + "-" + VERSION 
+ "-source-release.zip");
 
-        Set<String> required = Collections.emptySet();
+        Set<String> required = new HashSet<>();
 
         Set<String> banned = new HashSet<>();
 
@@ -63,6 +62,7 @@ public class IT_005_MiscellaneousExcludes {
 
         banned.add(archivePathFromChild(BASENAME, VERSION, "child2", 
"/cobertura.ser"));
 
+        required.add(archivePathFromProject(BASENAME, VERSION, 
"/some-target.txt"));
         assertZipContents(required, banned, assembly);
     }
 }
diff --git a/source-release/src/test/resources/misc-excludes/some-target.txt 
b/source-release/src/test/resources/misc-excludes/some-target.txt
new file mode 100644
index 0000000..6340480
--- /dev/null
+++ b/source-release/src/test/resources/misc-excludes/some-target.txt
@@ -0,0 +1,17 @@
+# 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.
+This file should be preserved
\ No newline at end of file

Reply via email to