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

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


The following commit(s) were added to refs/heads/main by this push:
     new f0267d3e6ef CAMEL-21606 - Camel route validation mojo fails if it 
depends on external sources without cleaning the target folder (#16763)
f0267d3e6ef is described below

commit f0267d3e6efecc28d6893c53fd17dbc59e5ca7fd
Author: Adriano Machado <[email protected]>
AuthorDate: Fri Jan 10 03:26:48 2025 -0500

    CAMEL-21606 - Camel route validation mojo fails if it depends on external 
sources without cleaning the target folder (#16763)
---
 .../src/main/java/org/apache/camel/maven/ValidateMojo.java   | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
 
b/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
index 76e00fe60e5..79b43cf7dcd 100644
--- 
a/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
+++ 
b/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
@@ -359,12 +359,10 @@ public class ValidateMojo extends AbstractMojo {
 
             Path target = 
extraSourcesPath.resolve(artifact.getGav().getArtifactId());
             getLog().info("Unzipping the artifact: " + artifact + " to " + 
target);
-            if (Files.exists(target)) {
-                continue;
+            if (!Files.exists(target)) {
+                unzipArtifact(artifact, target);
             }
 
-            unzipArtifact(artifact, target);
-
             FileUtil.findJavaFiles(target.toFile(), javaFiles);
             FileUtil.findXmlFiles(target.toFile(), xmlFiles);
         }
@@ -560,7 +558,7 @@ public class ValidateMojo extends AbstractMojo {
 
         // find all java route builder classes
         findJavaRouteBuilderClasses(javaFiles, includeJava, includeTest, 
project);
-        // find all xml routes
+        // find all XML routes
         findXmlRouters(xmlFiles, includeXml, includeTest, project);
 
         for (File file : javaFiles) {
@@ -852,7 +850,7 @@ public class ValidateMojo extends AbstractMojo {
             String fqn = file.getPath();
             String baseDir = ".";
             JavaType<?> out = Roaster.parse(file);
-            // we should only parse java classes (not interfaces and enums etc)
+            // we should only parse java classes (not interfaces and enums 
etc.)
             if (out instanceof JavaClassSource clazz) {
                 RouteBuilderParser.parseRouteBuilderEndpoints(clazz, baseDir, 
fqn, fileEndpoints, unparsable, includeTest);
                 RouteBuilderParser.parseRouteBuilderSimpleExpressions(clazz, 
baseDir, fqn, fileSimpleExpressions);
@@ -904,7 +902,7 @@ public class ValidateMojo extends AbstractMojo {
         Set<CamelEndpointDetails> producers = endpoints.stream()
                 .filter(e -> e.isProducerOnly() && 
e.getEndpointUri().startsWith(scheme + ":")).collect(Collectors.toSet());
 
-        // are there any producers that do not have a consumer pair
+        // are there any producers that do not have a consumer pair?
         for (CamelEndpointDetails detail : producers) {
             boolean none = consumers.stream().noneMatch(c -> 
matchEndpointPath(detail.getEndpointUri(), c.getEndpointUri()));
             if (none) {

Reply via email to