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

davsclaus pushed a commit to branch camel-4.8.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.8.x by this push:
     new 395f1163375 CAMEL-21252 Add checking for non .*-versions to 
sync-properties-maven-plugin (#15653) (#15916)
395f1163375 is described below

commit 395f1163375021b388424234d55f3aa9322e15c8
Author: Tom Cunningham <tcunn...@redhat.com>
AuthorDate: Fri Oct 11 01:24:11 2024 -0400

    CAMEL-21252 Add checking for non .*-versions to 
sync-properties-maven-plugin (#15653) (#15916)
---
 camel-dependencies/pom.xml                         |  3 ++
 components/camel-zeebe/pom.xml                     |  2 +-
 .../java/org/apache/camel/util/SensitiveUtils.java |  2 +-
 .../ROOT/pages/camel-report-maven-plugin.adoc      |  2 +-
 parent/pom.xml                                     |  4 +--
 tests/camel-itest/pom.xml                          |  2 +-
 .../maven/sync/properties/SyncPropertiesMojo.java  | 37 ++++++++++++++++++++++
 7 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index 39faed4c164..8d887aa446e 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -63,6 +63,9 @@
                         <goals>
                             <goal>sync-properties</goal>
                         </goals>
+                        <configuration>
+                            
<checkForInvalidVersions>true</checkForInvalidVersions>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>
diff --git a/components/camel-zeebe/pom.xml b/components/camel-zeebe/pom.xml
index 496bfd7edef..26d9512efd0 100644
--- a/components/camel-zeebe/pom.xml
+++ b/components/camel-zeebe/pom.xml
@@ -70,7 +70,7 @@
         <dependency>
             <groupId>io.camunda</groupId>
             <artifactId>zeebe-client-java</artifactId>
-            <version>${zeebe.version}</version>
+            <version>${zeebe-version}</version>
         </dependency>
 
         <!-- test dependencies -->
diff --git 
a/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java 
b/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
index a1019b57cf1..61845780879 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
@@ -178,7 +178,7 @@ public final class SensitiveUtils {
                                                     + "|\\Qverificationcode\\E"
                                                     + 
"|\\Qwebhookverifytoken\\E"
                                                     + 
"|\\Qzookeeperpassword\\E"
-                                                    // SENSITIVE-PATTERN: END
+    // SENSITIVE-PATTERN: END
     ;
 
     private SensitiveUtils() {
diff --git a/docs/user-manual/modules/ROOT/pages/camel-report-maven-plugin.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-report-maven-plugin.adoc
index 86b02221433..5166bed5fa8 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-report-maven-plugin.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-report-maven-plugin.adoc
@@ -359,7 +359,7 @@ The maven plugin *coverage* goal supports the following 
options which can be con
  patterns (wildcard and regular expression). Multiple values can be separated 
by comma.
 | excludes | | To filter the names of java and xml files to exclude files 
matching any of the given list of
  patterns (wildcard and regular expression). Multiple values can be separated 
by comma.
-| anonymousRoutes | false | Whether to allow anonymous routes (routes without 
any route id assigned).
+| anonymousRoutes | false | **Deprecated** Whether to allow anonymous routes 
(routes without any route id assigned).
  By using route id's then it is safer to match the route cover data with the 
route source code.
  Anonymous routes are less safe to use for route coverage as its harder to 
know exactly which route
  that was tested corresponds to which of the routes from the source code.
diff --git a/parent/pom.xml b/parent/pom.xml
index bee8bbf1e5a..6cf0e280466 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -264,7 +264,7 @@
         
<jboss-el-api_3.0_spec-version>2.0.0.Final</jboss-el-api_3.0_spec-version>
         <jboss-logging-version>3.6.0.Final</jboss-logging-version>
         <jboss-marshalling-version>1.4.10.Final</jboss-marshalling-version>
-        
<jboss-transaction-spi.version>7.6.1.Final</jboss-transaction-spi.version>
+        
<jboss-transaction-spi-version>7.6.1.Final</jboss-transaction-spi-version>
         <jboss-xnio-version>3.8.14.Final</jboss-xnio-version>
         <jcache-version>1.1.1</jcache-version>
         <jcr-version>2.0</jcr-version>
@@ -501,7 +501,7 @@
         <xpp3-version>1.1.4c</xpp3-version>
         <yasson-version>3.0.4</yasson-version>
         
<yetus-audience-annotations-version>0.15.0</yetus-audience-annotations-version>
-        <zeebe.version>8.5.7</zeebe.version>
+        <zeebe-version>8.5.7</zeebe-version>
         <zendesk-client-version>1.0.0</zendesk-client-version>
         <zookeeper-version>3.9.2</zookeeper-version>
         <zxing-version>3.5.3</zxing-version>
diff --git a/tests/camel-itest/pom.xml b/tests/camel-itest/pom.xml
index ea1d7857a70..230ffe19141 100644
--- a/tests/camel-itest/pom.xml
+++ b/tests/camel-itest/pom.xml
@@ -356,7 +356,7 @@
         <dependency>
             <groupId>org.jboss</groupId>
             <artifactId>jboss-transaction-spi-jakarta</artifactId>
-            <version>${jboss-transaction-spi.version}</version>
+            <version>${jboss-transaction-spi-version}</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.logging</groupId>
diff --git 
a/tooling/maven/sync-properties-maven-plugin/src/main/java/org/apache/camel/maven/sync/properties/SyncPropertiesMojo.java
 
b/tooling/maven/sync-properties-maven-plugin/src/main/java/org/apache/camel/maven/sync/properties/SyncPropertiesMojo.java
index 52f66cfff34..42b58630f8b 100644
--- 
a/tooling/maven/sync-properties-maven-plugin/src/main/java/org/apache/camel/maven/sync/properties/SyncPropertiesMojo.java
+++ 
b/tooling/maven/sync-properties-maven-plugin/src/main/java/org/apache/camel/maven/sync/properties/SyncPropertiesMojo.java
@@ -101,6 +101,22 @@ public class SyncPropertiesMojo extends AbstractMojo {
     @Parameter(defaultValue = ".*-version")
     private List<String> propertyIncludes;
 
+    /**
+     * Check for invalid versions
+     *
+     * @since 4.9.0
+     */
+    @Parameter(defaultValue = "false")
+    private Boolean checkForInvalidVersions;
+
+    /**
+     * List of regular expressions with invalid versions
+     *
+     * @since 4.9.0
+     */
+    @Parameter(defaultValue = ".*[^\\-]version")
+    private List<String> propertyInvalidVersions;
+
     /**
      * List of regular expressions to ignore from {@link #sourcePomXml}
      *
@@ -154,6 +170,27 @@ public class SyncPropertiesMojo extends AbstractMojo {
 
         final Predicate<String> includes = toPredicate(propertyIncludes, true);
         final Predicate<String> excludes = toPredicate(propertyExcludes, 
false);
+        final Predicate<String> invalids = 
toPredicate(propertyInvalidVersions, true);
+
+        // Check for versions that do not fit the .*-version pattern and log 
an error
+        // Enforce the .*-version standard
+        if (checkForInvalidVersions.booleanValue()) {
+            List invalidProperties = 
Stream.concat(camelParentPomXmlModel.getProperties().entrySet().stream(),
+                    camelPomXmlModel.getProperties().entrySet().stream()
+                            .filter(property -> 
!(property.getKey().equals("jdk.version"))))
+                    .filter(property -> invalids.test((String) 
property.getKey()) && !excludes.test((String) property.getKey()))
+                    .map(property -> property.getKey())
+                    .sorted()
+                    .collect(Collectors.toList());
+
+            if (invalidProperties.size() > 0) {
+                throw new MojoExecutionException(
+                        "sync-properties-maven-plugin will only synchronize 
properties matching "
+                                                 + propertyIncludes + ".  " + 
"Properties were found that will not be synced "
+                                                 + 
invalidProperties.toString());
+            }
+        }
+
         final String properties = Stream.concat(
                 camelParentPomXmlModel.getProperties().entrySet().stream(),
                 camelPomXmlModel.getProperties().entrySet().stream()

Reply via email to