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

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


The following commit(s) were added to refs/heads/master by this push:
     new 0d1d879  CAMEL-13051: The component json metafiles need to be enriched 
later with more details after the compilation process. A component can be 
marked as deprecated in the pom.xml name.
0d1d879 is described below

commit 0d1d879505a1ffa69ed3e0fb4f15cd74830a3697
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Jan 14 20:52:54 2019 +0100

    CAMEL-13051: The component json metafiles need to be enriched later with 
more details after the compilation process. A component can be marked as 
deprecated in the pom.xml name.
---
 .../org/apache/camel/maven/packaging/PackageComponentMojo.java    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageComponentMojo.java
 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageComponentMojo.java
index 23f43b4..3e6a398 100644
--- 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageComponentMojo.java
+++ 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageComponentMojo.java
@@ -214,6 +214,14 @@ public class PackageComponentMojo extends AbstractMojo {
                 text = text.replace("@@@GROUPID@@@", project.getGroupId());
                 text = text.replace("@@@ARTIFACTID@@@", 
project.getArtifactId());
                 text = text.replace("@@@VERSIONID@@@", project.getVersion());
+
+                // special for deprecated where you can quickly specify that 
in the pom.xml name
+                boolean deprecated = 
project.getName().contains("(deprecated)");
+                if (deprecated) {
+                    // must start with 4 leading spaces as we want to replace 
the marker in the top of the file
+                    text = text.replaceFirst(" {4}\"deprecated\": false,", "   
 \"deprecated\": true,");
+                }
+
                 writeText(file, text);
             } catch (IOException e) {
                 throw new MojoExecutionException("Failed to update file " + 
file + ". Reason: " + e, e);

Reply via email to