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 2018/07/20 07:42:53 UTC

[camel] branch master updated: CAMEL-12660: spring-boot auto configuration options are now all included in the docs and we validate that they all have documentation, and if they dont the build fails.

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 48539d7  CAMEL-12660: spring-boot auto configuration options are now all included in the docs and we validate that they all have documentation, and if they dont the build fails.
48539d7 is described below

commit 48539d7156a5d4795f0dc593c6334427fc8450e1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jul 20 09:42:43 2018 +0200

    CAMEL-12660: spring-boot auto configuration options are now all included in the docs and we validate that they all have documentation, and if they dont the build fails.
---
 .../camel-iec60870/src/main/docs/iec60870-client-component.adoc  | 6 +++---
 .../camel-iec60870/src/main/docs/iec60870-server-component.adoc  | 3 ++-
 .../apache/camel/component/iec60870/client/ClientOptions.java    | 7 +++++++
 components/camel-milo/src/main/docs/milo-client-component.adoc   | 3 +--
 .../camel/component/milo/client/MiloClientConfiguration.java     | 6 ++++++
 .../iec60870/client/springboot/ClientComponentConfiguration.java | 9 ---------
 .../milo/client/springboot/MiloClientComponentConfiguration.java | 9 ---------
 platforms/spring-boot/components-starter/pom.xml                 | 2 +-
 .../camel/maven/packaging/SpringBootAutoConfigurationMojo.java   | 5 ++++-
 9 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/components/camel-iec60870/src/main/docs/iec60870-client-component.adoc b/components/camel-iec60870/src/main/docs/iec60870-client-component.adoc
index f892210..d5bdf32 100644
--- a/components/camel-iec60870/src/main/docs/iec60870-client-component.adoc
+++ b/components/camel-iec60870/src/main/docs/iec60870-client-component.adoc
@@ -71,7 +71,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (18 parameters):
+==== Query Parameters (19 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -91,6 +91,7 @@ with the following path and query parameters:
 | *timeout1* (connection) | Timeout T1 in milliseconds. | 15000 | int
 | *timeout2* (connection) | Timeout T2 in milliseconds. | 10000 | int
 | *timeout3* (connection) | Timeout T3 in milliseconds. | 20000 | int
+| *causeSourceAddress* (data) | Whether to include the source address | true | boolean
 | *ignoreBackgroundScan* (data) | Whether background scan transmissions should be ignored. | true | boolean
 | *ignoreDaylightSavingTime* (data) | Whether to ignore or respect DST | false | boolean
 | *timeZone* (data) | The timezone to use. May be any Java time zone string | UTC | TimeZone
@@ -101,14 +102,13 @@ with the following path and query parameters:
 === Spring Boot Auto-Configuration
 
 
-The component supports 4 options, which are listed below.
+The component supports 3 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *camel.component.iec60870-client.default-connection-options.cause-source-address* |  |  | Byte
 | *camel.component.iec60870-client.default-connection-options.ignore-background-scan* | Whether background scan transmissions should be ignored. | true | Boolean
 | *camel.component.iec60870-client.enabled* | Whether to enable auto configuration of the iec60870-client component.
  This is enabled by default. |  | Boolean
diff --git a/components/camel-iec60870/src/main/docs/iec60870-server-component.adoc b/components/camel-iec60870/src/main/docs/iec60870-server-component.adoc
index 1714198..e3e5b58 100644
--- a/components/camel-iec60870/src/main/docs/iec60870-server-component.adoc
+++ b/components/camel-iec60870/src/main/docs/iec60870-server-component.adoc
@@ -74,7 +74,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (19 parameters):
+==== Query Parameters (20 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -95,6 +95,7 @@ with the following path and query parameters:
 | *timeout1* (connection) | Timeout T1 in milliseconds. | 15000 | int
 | *timeout2* (connection) | Timeout T2 in milliseconds. | 10000 | int
 | *timeout3* (connection) | Timeout T3 in milliseconds. | 20000 | int
+| *causeSourceAddress* (data) | Whether to include the source address | true | boolean
 | *ignoreBackgroundScan* (data) | Whether background scan transmissions should be ignored. | true | boolean
 | *ignoreDaylightSavingTime* (data) | Whether to ignore or respect DST | false | boolean
 | *timeZone* (data) | The timezone to use. May be any Java time zone string | UTC | TimeZone
diff --git a/components/camel-iec60870/src/main/java/org/apache/camel/component/iec60870/client/ClientOptions.java b/components/camel-iec60870/src/main/java/org/apache/camel/component/iec60870/client/ClientOptions.java
index 86cdb9e..012e996 100644
--- a/components/camel-iec60870/src/main/java/org/apache/camel/component/iec60870/client/ClientOptions.java
+++ b/components/camel-iec60870/src/main/java/org/apache/camel/component/iec60870/client/ClientOptions.java
@@ -40,6 +40,13 @@ public class ClientOptions extends BaseOptions<ClientOptions> {
     @UriParam(label = "data", defaultValue = "true")
     private boolean ignoreBackgroundScan;
 
+    // dummy for doc generation
+    /**
+     * Whether to include the source address
+     */
+    @UriParam(label = "data", defaultValue = "true")
+    private boolean causeSourceAddress;
+
     public ClientOptions() {
         this.dataModuleOptions = new DataModuleOptions.Builder();
     }
diff --git a/components/camel-milo/src/main/docs/milo-client-component.adoc b/components/camel-milo/src/main/docs/milo-client-component.adoc
index 615a743..783b094 100644
--- a/components/camel-milo/src/main/docs/milo-client-component.adoc
+++ b/components/camel-milo/src/main/docs/milo-client-component.adoc
@@ -136,7 +136,7 @@ with the following path and query parameters:
 === Spring Boot Auto-Configuration
 
 
-The component supports 25 options, which are listed below.
+The component supports 24 options, which are listed below.
 
 
 
@@ -154,7 +154,6 @@ The component supports 25 options, which are listed below.
  instance |  | String
 | *camel.component.milo-client.default-configuration.discovery-endpoint-suffix* | A suffix for endpoint URI when discovering |  | String
 | *camel.component.milo-client.default-configuration.discovery-endpoint-uri* | An alternative discovery URI |  | String
-| *camel.component.milo-client.default-configuration.endpoint-uri* |  |  | String
 | *camel.component.milo-client.default-configuration.key-alias* | The name of the key in the keystore file |  | String
 | *camel.component.milo-client.default-configuration.key-password* | The key password |  | String
 | *camel.component.milo-client.default-configuration.key-store-password* | The keystore password |  | String
diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
index 14184da..f6d84ab 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -24,6 +24,8 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.function.Consumer;
 
+import javax.xml.bind.annotation.XmlTransient;
+
 import com.google.common.base.Supplier;
 import org.apache.camel.component.milo.KeyStoreLoader;
 import org.apache.camel.component.milo.KeyStoreLoader.Result;
@@ -44,6 +46,7 @@ public class MiloClientConfiguration implements Cloneable {
 
     private static final String DEFAULT_PRODUCT_URI = "http://camel.apache.org/EclipseMilo";
 
+    @XmlTransient // to not be included in component docs
     private String endpointUri;
 
     @UriParam
@@ -128,6 +131,9 @@ public class MiloClientConfiguration implements Cloneable {
         this.overrideHost = other.overrideHost;
     }
 
+    /**
+     * The OPC UA server endpoint
+     */
     public void setEndpointUri(final String endpointUri) {
         this.endpointUri = endpointUri;
     }
diff --git a/platforms/spring-boot/components-starter/camel-iec60870-starter/src/main/java/org/apache/camel/component/iec60870/client/springboot/ClientComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-iec60870-starter/src/main/java/org/apache/camel/component/iec60870/client/springboot/ClientComponentConfiguration.java
index d81f564..65ef251 100644
--- a/platforms/spring-boot/components-starter/camel-iec60870-starter/src/main/java/org/apache/camel/component/iec60870/client/springboot/ClientComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-iec60870-starter/src/main/java/org/apache/camel/component/iec60870/client/springboot/ClientComponentConfiguration.java
@@ -69,20 +69,11 @@ public class ClientComponentConfiguration
 
     public static class ClientOptionsNestedConfiguration {
         public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.iec60870.client.ClientOptions.class;
-        private Byte causeSourceAddress;
         /**
          * Whether background scan transmissions should be ignored.
          */
         private Boolean ignoreBackgroundScan = true;
 
-        public Byte getCauseSourceAddress() {
-            return causeSourceAddress;
-        }
-
-        public void setCauseSourceAddress(Byte causeSourceAddress) {
-            this.causeSourceAddress = causeSourceAddress;
-        }
-
         public Boolean getIgnoreBackgroundScan() {
             return ignoreBackgroundScan;
         }
diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
index 26143cd..ea9b146 100644
--- a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentConfiguration.java
@@ -117,7 +117,6 @@ public class MiloClientComponentConfiguration
 
     public static class MiloClientConfigurationNestedConfiguration {
         public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.milo.client.MiloClientConfiguration.class;
-        private String endpointUri;
         /**
          * An alternative discovery URI
          */
@@ -194,14 +193,6 @@ public class MiloClientComponentConfiguration
          */
         private Boolean overrideHost = false;
 
-        public String getEndpointUri() {
-            return endpointUri;
-        }
-
-        public void setEndpointUri(String endpointUri) {
-            this.endpointUri = endpointUri;
-        }
-
         public String getDiscoveryEndpointUri() {
             return discoveryEndpointUri;
         }
diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml
index d961b69..e2cfea2 100644
--- a/platforms/spring-boot/components-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/pom.xml
@@ -85,7 +85,7 @@
           <!-- set to true to make build fail fast if missing documentation in docs files -->
           <failFast>false</failFast>
           <!-- set to true to make build fail if an option has no description -->
-          <failOnMissingDescription>false</failOnMissingDescription>
+          <failOnMissingDescription>true</failOnMissingDescription>
         </configuration>
         <executions>
           <execution>
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java
index 67a0adb..3bb1f13 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java
@@ -40,6 +40,7 @@ import java.util.TreeSet;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import javax.annotation.Generated;
+import javax.xml.bind.annotation.XmlTransient;
 
 import org.apache.camel.maven.packaging.model.ComponentModel;
 import org.apache.camel.maven.packaging.model.ComponentOptionModel;
@@ -818,8 +819,10 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo {
                 PropertySource<JavaClassSource> sourceProp = resolvedProperty.propertySource;
 
                 Type<JavaClassSource> propType = sourceProp.getType();
+
                 // skip these types
-                if (propType.isType("CamelContext")) {
+                boolean ignore = sourceProp.getAnnotation(XmlTransient.class) != null;
+                if (ignore || propType.isType("CamelContext")) {
                     continue;
                 }