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 2020/02/06 13:58:19 UTC
[camel] 02/02: CAMEL-14503: Hack to make cpmp do 3rd party
components
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch plugin
in repository https://gitbox.apache.org/repos/asf/camel.git
commit eb251b67e43861b4df3be673a94388107859e583
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 6 14:57:54 2020 +0100
CAMEL-14503: Hack to make cpmp do 3rd party components
---
.../apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java
index d3cf07b..1ec41ba 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java
@@ -261,7 +261,6 @@ public class EndpointSchemaGeneratorMojo extends AbstractGeneratorMojo {
.filter(option -> !endpointOptionNames.contains(option.getName()))
.forEach(option -> componentModel.getEndpointOptions().add(option));
}
-
}
private void fixDoc(BaseOptionModel option, List<? extends BaseOptionModel> parentOptions) {
@@ -732,6 +731,7 @@ public class EndpointSchemaGeneratorMojo extends AbstractGeneratorMojo {
if ("".equals(defaultValue) && metadata != null) {
defaultValue = metadata.defaultValue();
}
+ String defaultValueNote = path.defaultValueNote();
boolean required = metadata != null && metadata.required();
String label = path.label();
if (Strings.isNullOrEmpty(label) && metadata != null) {
@@ -788,7 +788,7 @@ public class EndpointSchemaGeneratorMojo extends AbstractGeneratorMojo {
option.setJavaType(fieldTypeName);
option.setRequired(required);
option.setDefaultValue(defaultValue);
-// option.setDefaultValueNote(defaultValueNote);
+ option.setDefaultValueNote(defaultValueNote);
option.setDescription(docComment.trim());
option.setDeprecated(deprecated);
option.setDeprecationNote(deprecationNote);
@@ -1260,6 +1260,8 @@ public class EndpointSchemaGeneratorMojo extends AbstractGeneratorMojo {
sourceRoots = project.getCompileSourceRoots().stream()
.map(Paths::get)
.collect(Collectors.toList());
+ // we can only find camel root folder if its the apache camel project itself
+ // 3rd party projects then this will be null
File camelRootFile = PackageHelper.findCamelCoreDirectory(project.getBasedir());
final Path camelRoot = camelRootFile != null ? camelRootFile.toPath().getParent().getParent() : project.getBasedir().toPath();
project.getCompileClasspathElements().stream()