You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/05/07 07:30:35 UTC

[camel] branch main updated: CAMEL-17903: camel-component-maven-plugin - Add doc about recompile

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 b48a3c942cc CAMEL-17903: camel-component-maven-plugin - Add doc about recompile
b48a3c942cc is described below

commit b48a3c942cc2aae641a023db69f836844ba5ba61
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat May 7 09:30:19 2022 +0200

    CAMEL-17903: camel-component-maven-plugin - Add doc about recompile
---
 .../ROOT/pages/camel-component-maven-plugin.adoc   | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-component-maven-plugin.adoc b/docs/user-manual/modules/ROOT/pages/camel-component-maven-plugin.adoc
index 777181d1213..912b364a3f5 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-component-maven-plugin.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-component-maven-plugin.adoc
@@ -17,6 +17,8 @@ This goal will generate the following metadata files and Java files:
 * SPIs: it will generate all Service Provider Interfaces (SPI) for the component. This allows Camel to auto-discover your component without adding it manually to the Camel context.
 * Configurers: it will generate all configurer Java classes from `@Configurer` annotated classes.
 * Endpoint Schema: it will generate the property configurers as well as schema JSONs extracted from the component's Endpoint and Component classes. This allows Camel to avoid reflections while configuring the properties, thus allows for better efficiency.
+* Endpoint URI Factory: it will generate endpoint factory to build URIs from a map of properties.
+* Invoke on Header: it will generate source code for components using `@InvokeOnHeader`
 * Prepare Component: it analyzes if the maven module contains Camel modules such as `components`, `dataformats`, `languages` and others. And for each of those generates extra descriptors and schema files for easier auto-discovery in Camel and tooling. 
 * Validate Component: it validates the Camel component if the meta-files for `components`, `dataformats`, `languages` and others, all contains the needed meta-data such as assigned labels, documentation for each option.
 
@@ -52,6 +54,29 @@ in order to generate all the necessary files being described above upon compilat
 
 Thus, `mvn test`, `mvn package`, `mvn verify` and `mvn install` phases should run this plugin.
 
+=== Re-compile to include latest generated code
+
+The `camel-component-maven-plugin` is executed after the compiler, and because it outputs java source
+code, then the compiler must execute again (will only compile if source code has actually changed).
+
+To ensure this the following should be added to the `pom.xml` file:
+
+[source,xml]
+----
+<plugin>
+    <artifactId>maven-compiler-plugin</artifactId>
+    <executions>
+        <execution>
+            <id>recompile</id>
+            <goals>
+                <goal>compile</goal>
+            </goals>
+            <phase>process-classes</phase>
+        </execution>
+    </executions>
+</plugin>
+----
+
 === Configuring output directory
 
 The plugin will by default generate outputs to