This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
The following commit(s) were added to refs/heads/master by this push:
new 998d8f3 Remove the need of jaxb in camel-k-runtime-core
998d8f3 is described below
commit 998d8f3c07af8c812044548c80eb1025c5916495
Author: lburgazzoli <[email protected]>
AuthorDate: Tue Feb 4 10:16:30 2020 +0100
Remove the need of jaxb in camel-k-runtime-core
---
camel-k-loader-xml/pom.xml | 16 ++++++++++++++++
.../camel-k-loader-yaml-common/pom.xml | 6 ++++++
camel-k-runtime-core/pom.xml | 16 ----------------
.../org/apache/camel/k/listener/RoutesDumper.java | 19 +++++++++----------
4 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/camel-k-loader-xml/pom.xml b/camel-k-loader-xml/pom.xml
index 0108883..da887f5 100644
--- a/camel-k-loader-xml/pom.xml
+++ b/camel-k-loader-xml/pom.xml
@@ -46,6 +46,22 @@
</dependency>
<dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>${jaxb-core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${jaxb-api.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-apt</artifactId>
<scope>provided</scope>
diff --git a/camel-k-loader-yaml/camel-k-loader-yaml-common/pom.xml
b/camel-k-loader-yaml/camel-k-loader-yaml-common/pom.xml
index 65d0d61..128aed8 100644
--- a/camel-k-loader-yaml/camel-k-loader-yaml-common/pom.xml
+++ b/camel-k-loader-yaml/camel-k-loader-yaml-common/pom.xml
@@ -55,6 +55,12 @@
</dependency>
<dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb-api.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-apt</artifactId>
<scope>provided</scope>
diff --git a/camel-k-runtime-core/pom.xml b/camel-k-runtime-core/pom.xml
index ee2a937..085baad 100644
--- a/camel-k-runtime-core/pom.xml
+++ b/camel-k-runtime-core/pom.xml
@@ -57,22 +57,6 @@
<version>${commons-io.version}</version>
</dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>${jaxb-api.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-core</artifactId>
- <version>${jaxb-core.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>${jaxb-api.version}</version>
- </dependency>
-
<!-- ****************************** -->
<!-- -->
<!-- TESTS -->
diff --git
a/camel-k-runtime-core/src/main/java/org/apache/camel/k/listener/RoutesDumper.java
b/camel-k-runtime-core/src/main/java/org/apache/camel/k/listener/RoutesDumper.java
index 33f53ba..0ec2874 100644
---
a/camel-k-runtime-core/src/main/java/org/apache/camel/k/listener/RoutesDumper.java
+++
b/camel-k-runtime-core/src/main/java/org/apache/camel/k/listener/RoutesDumper.java
@@ -16,13 +16,12 @@
*/
package org.apache.camel.k.listener;
-import javax.xml.bind.JAXBException;
-
import org.apache.camel.CamelContext;
import org.apache.camel.k.Runtime;
import org.apache.camel.model.Model;
-import org.apache.camel.model.ModelHelper;
+import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.RoutesDefinition;
+import org.apache.camel.model.rest.RestDefinition;
import org.apache.camel.model.rest.RestsDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,15 +43,15 @@ public class RoutesDumper extends AbstractPhaseListener {
RestsDefinition rests = new RestsDefinition();
rests.setRests(context.getExtension(Model.class).getRestDefinitions());
- try {
- if (LOGGER.isDebugEnabled() && !routes.getRoutes().isEmpty()) {
- LOGGER.debug("Routes: \n{}",
ModelHelper.dumpModelAsXml(context, routes));
+ if (LOGGER.isDebugEnabled() && !routes.getRoutes().isEmpty()) {
+ for (RouteDefinition definition: routes.getRoutes()) {
+ LOGGER.debug("Routes: {}", definition);
}
- if (LOGGER.isDebugEnabled() && !rests.getRests().isEmpty()) {
- LOGGER.debug("Rests: \n{}",
ModelHelper.dumpModelAsXml(context, rests));
+ }
+ if (LOGGER.isDebugEnabled() && !rests.getRests().isEmpty()) {
+ for (RestDefinition definition: rests.getRests()) {
+ LOGGER.debug("Rest: {}", definition);
}
- } catch (JAXBException e) {
- throw new IllegalArgumentException(e);
}
}
}