You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/09/06 07:52:12 UTC

[logging-parent] 11/30: Fix YAML escaping issue, 4th time

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

vy pushed a commit to branch release/10.0.0
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit 9bc9eeacb60a163bea44569e11b98a7d99f6b0d4
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Mon Sep 4 12:46:57 2023 +0200

    Fix YAML escaping issue, 4th time
---
 .github/workflows/deploy-release-reusable.yml |  2 +-
 pom.xml                                       | 39 +++++++++++++++++++--------
 2 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/deploy-release-reusable.yml b/.github/workflows/deploy-release-reusable.yml
index eca60d7..a23524c 100644
--- a/.github/workflows/deploy-release-reusable.yml
+++ b/.github/workflows/deploy-release-reusable.yml
@@ -32,7 +32,7 @@ on:
       distribution-attachment-filepath-pattern:
         description: The regex pattern matched against the full filepath for determining attachments to be included in the distribution
         # Below `\$` are placed to avoid `bad substitution` failures in CI
-        default: ^.*/target/log4j-(.+)-\${project.version}(-tests)?\\.jar\$
+        default: ^.*/target/log4j-(.+)-\${project.version}(-tests)?\.jar\$
         type: string
       distribution-attachment-count:
         description: The number of attachments expected to be found
diff --git a/pom.xml b/pom.xml
index 776c3c5..d30b828 100644
--- a/pom.xml
+++ b/pom.xml
@@ -542,16 +542,6 @@
 
       <id>distribution</id>
 
-      <!-- These properties and their defaults should match the ones in `.github/workflows/deploy-release-reusable.yml`! -->
-      <properties>
-        <!-- The regex pattern matched against the full filepath for determining attachments to be included in the distribution: -->
-        <attachmentFilepathPattern>^.*/target/log4j-(.+)-${project.version}(-tests)?\\.jar$</attachmentFilepathPattern>
-        <!-- The number of attachments expected to be found.
-             Setting the default to an excessive value to enforce the user to provide it explicitly.
-             That is, found attachments should precisely reflect what user expects. -->
-        <attachmentCount>999</attachmentCount>
-      </properties>
-
       <build>
 
         <defaultGoal>log4j-changelog:export bsh:run</defaultGoal>
@@ -579,6 +569,34 @@
             </configuration>
           </plugin>
 
+          <!-- Enforce properties required by the BSH creatining the distribution.
+               These properties must match the ones in `.github/workflows/deploy-release-reusable.yml`! -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-enforcer-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>enforce-distribution-properties</id>
+                <goals>
+                  <goal>enforce</goal>
+                </goals>
+                <configuration>
+                  <rules>
+                    <requireProperty>
+                      <property>attachmentFilepathPattern</property>
+                      <message>You must set an `attachmentFilepathPattern` property for the regex pattern matched against the full filepath for determining attachments to be included in the distribution!</message>
+                    </requireProperty>
+                    <requireProperty>
+                      <property>attachmentCount</property>
+                      <message>You must set an `attachmentCount` property for the number of attachments expected to be found!</message>
+                    </requireProperty>
+                  </rules>
+                  <fail>true</fail>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
           <!-- Create the distribution ZIP -->
           <plugin>
             <groupId>com.github.genthaler</groupId>
@@ -769,7 +787,6 @@
                   <goal>enforce</goal>
                 </goals>
                 <configuration>
-                  <skip>true</skip>
                   <rules>
                     <requireReleaseDeps>
                       <message>SNAPSHOT dependencies are not allowed for releases</message>