You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/05/15 10:48:57 UTC

[camel-k-runtime] branch master updated: remove spring boot support #55

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

acosentino 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 78fda53  remove spring boot support #55
     new 3e9d8f4  Merge pull request #62 from lburgazzoli/github-55-spring-boot
78fda53 is described below

commit 78fda53a35df3d4434beae454e9da3416790bfc2
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed May 15 12:10:34 2019 +0200

    remove spring boot support #55
---
 camel-k-runtime-bom/pom.xml                        |  10 --
 camel-k-runtime-spring-boot-layout/pom.xml         |  37 -----
 .../apache/camel/k/spring/boot/layout/Factory.java |  49 ------
 .../src/main/resources/META-INF/spring.factories   |   2 -
 camel-k-runtime-spring-boot/pom.xml                | 177 ---------------------
 .../apache/camel/k/spring/boot/Application.java    |  65 --------
 .../spring/boot/ApplicationAutoConfiguration.java  | 125 ---------------
 .../src/main/resources/META-INF/spring.factories   |   2 -
 pom.xml                                            |  13 --
 9 files changed, 480 deletions(-)

diff --git a/camel-k-runtime-bom/pom.xml b/camel-k-runtime-bom/pom.xml
index a405ddf..c123fd6 100644
--- a/camel-k-runtime-bom/pom.xml
+++ b/camel-k-runtime-bom/pom.xml
@@ -122,16 +122,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.k</groupId>
-                <artifactId>camel-k-runtime-spring-boot</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.k</groupId>
-                <artifactId>camel-k-runtime-spring-boot-layout</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.k</groupId>
                 <artifactId>camel-k-runtime-health</artifactId>
                 <version>${project.version}</version>
             </dependency>
diff --git a/camel-k-runtime-spring-boot-layout/pom.xml b/camel-k-runtime-spring-boot-layout/pom.xml
deleted file mode 100644
index 4b76c94..0000000
--- a/camel-k-runtime-spring-boot-layout/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.apache.camel.k</groupId>
-        <artifactId>camel-k-runtime-parent</artifactId>
-        <version>0.3.3-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>camel-k-runtime-spring-boot-layout</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-loader-tools</artifactId>
-            <version>${spring-boot.version}</version>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/camel-k-runtime-spring-boot-layout/src/main/java/org/apache/camel/k/spring/boot/layout/Factory.java b/camel-k-runtime-spring-boot-layout/src/main/java/org/apache/camel/k/spring/boot/layout/Factory.java
deleted file mode 100644
index 3367ec6..0000000
--- a/camel-k-runtime-spring-boot-layout/src/main/java/org/apache/camel/k/spring/boot/layout/Factory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.k.spring.boot.layout;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.springframework.boot.loader.tools.Layout;
-import org.springframework.boot.loader.tools.Layouts;
-import org.springframework.boot.loader.tools.LibraryScope;
-
-public class Factory implements org.springframework.boot.loader.tools.LayoutFactory {
-    private static final Set<LibraryScope> SCOPES = new HashSet<>(
-        Arrays.asList(
-            LibraryScope.COMPILE,
-            LibraryScope.RUNTIME,
-            LibraryScope.CUSTOM)
-    );
-
-    @Override
-    public Layout getLayout(File source) {
-        return new Layouts.Jar() {
-            @Override
-            public String getLibraryDestination(String libraryName, LibraryScope scope) {
-                if (SCOPES.contains(scope)) {
-                    return super.getLibraryDestination(libraryName, scope);
-                }
-
-                return null;
-            }
-        };
-    }
-}
diff --git a/camel-k-runtime-spring-boot-layout/src/main/resources/META-INF/spring.factories b/camel-k-runtime-spring-boot-layout/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index d4c5848..0000000
--- a/camel-k-runtime-spring-boot-layout/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,2 +0,0 @@
-org.springframework.boot.loader.tools.LayoutFactory=\
-    org.apache.camel.k.spring.boot.layout.Factory
\ No newline at end of file
diff --git a/camel-k-runtime-spring-boot/pom.xml b/camel-k-runtime-spring-boot/pom.xml
deleted file mode 100644
index 81a6da4..0000000
--- a/camel-k-runtime-spring-boot/pom.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.apache.camel.k</groupId>
-        <artifactId>camel-k-runtime-parent</artifactId>
-        <version>0.3.3-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>camel-k-runtime-spring-boot</artifactId>
-
-    <properties>
-        <jar_file>${project.build.directory}/${project.build.finalName}.jar</jar_file>
-    </properties>
-
-    <dependencies>
-
-        <!-- ****************************** -->
-        <!--                                -->
-        <!-- RUNTIME                        -->
-        <!--                                -->
-        <!-- ****************************** -->
-
-        <dependency>
-            <groupId>org.apache.camel.k</groupId>
-            <artifactId>camel-k-runtime-jvm</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.logging.log4j</groupId>
-                    <artifactId>log4j-core</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.logging.log4j</groupId>
-                    <artifactId>log4j-slf4j-impl</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-spring-boot-starter</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-log4j2</artifactId>
-            <version>${spring-boot.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-loader-tools</artifactId>
-            <version>${spring-boot.version}</version>
-            <optional>true</optional>
-        </dependency>
-
-        <!-- ****************************** -->
-        <!--                                -->
-        <!-- TESTS                          -->
-        <!--                                -->
-        <!-- ****************************** -->
-
-        <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-api</artifactId>
-            <version>${junit-jupiter.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-engine</artifactId>
-            <version>${junit-jupiter.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <version>${assertj.version}</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring-boot.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <mainClass>org.apache.camel.k.spring.boot.Application</mainClass>
-                    <!--
-                    <layoutFactory implementation="org.apache.camel.k.spring.boot.layout.Factory" />
-                    -->
-                </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.apache.camel.k</groupId>
-                        <artifactId>camel-k-runtime-spring-boot-layout</artifactId>
-                        <version>${project.version}</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>camel3</id>
-            <activation>
-                <property>
-                    <name>camel3</name>
-                </property>
-            </activation>
-            <dependencies>
-                <!-- runtime -->
-                <dependency>
-                    <groupId>org.apache.camel.k</groupId>
-                    <artifactId>camel-k-adapter-camel-3</artifactId>
-                    <scope>provided</scope>
-                </dependency>
-                <!-- test -->
-                <dependency>
-                    <groupId>org.apache.camel</groupId>
-                    <artifactId>camel-properties</artifactId>
-                    <scope>test</scope>
-                </dependency>
-            </dependencies>
-        </profile>
-        <profile>
-            <id>camel2</id>
-            <activation>
-                <property>
-                    <name>!camel3</name>
-                </property>
-            </activation>
-            <dependencies>
-                <!-- runtime -->
-                <dependency>
-                    <groupId>org.apache.camel.k</groupId>
-                    <artifactId>camel-k-adapter-camel-2</artifactId>
-                    <scope>provided</scope>
-                </dependency>
-            </dependencies>
-        </profile>
-    </profiles>
-</project>
diff --git a/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/Application.java b/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/Application.java
deleted file mode 100644
index c5e8e37..0000000
--- a/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/Application.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.k.spring.boot;
-
-import java.util.Properties;
-
-import org.apache.camel.k.support.PlatformStreamHandler;
-import org.apache.camel.k.support.RuntimeSupport;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
-
-@SpringBootApplication
-public class Application {
-    static {
-        //
-        // Install a custom protocol handler to support discovering resources
-        // from the platform i.e. in knative, resources are provided through
-        // env var as it is not possible to mount config maps / secrets.
-        //
-        // TODO: we should remove as soon as we get a knative version that
-        //       includes https://github.com/knative/serving/pull/3061
-        //
-        PlatformStreamHandler.configure();
-    }
-
-    public static void main(String[] args) {
-        SpringApplication.run(Application.class, args);
-    }
-
-    @Bean
-    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
-        // load properties using default behaviour
-        final Properties properties = RuntimeSupport.loadProperties();
-
-        // set spring boot specific properties
-        properties.put("camel.springboot.main-run-controller", "true");
-        properties.put("camel.springboot.name", "camel-k");
-        properties.put("camel.springboot.streamCachingEnabled", "true");
-        properties.put("camel.springboot.xml-routes", "false");
-        properties.put("camel.springboot.xml-rests", "false");
-        properties.put("camel.springboot.jmx-enabled", "false");
-
-        // set loaded properties as default properties
-        PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
-        configurer.setProperties(properties);
-
-        return configurer;
-    }
-}
diff --git a/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/ApplicationAutoConfiguration.java b/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/ApplicationAutoConfiguration.java
deleted file mode 100644
index b13410a..0000000
--- a/camel-k-runtime-spring-boot/src/main/java/org/apache/camel/k/spring/boot/ApplicationAutoConfiguration.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.k.spring.boot;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.k.InMemoryRegistry;
-import org.apache.camel.k.Runtime;
-import org.apache.camel.k.listener.ContextConfigurer;
-import org.apache.camel.k.listener.RoutesConfigurer;
-import org.apache.camel.k.listener.RoutesDumper;
-import org.apache.camel.spring.boot.CamelContextConfiguration;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class ApplicationAutoConfiguration {
-
-    @Bean
-    public CamelContextConfiguration routesConfiguration(ConfigurableApplicationContext applicationContext) throws Exception {
-        return new CamelContextConfigurer(applicationContext, Arrays.asList(new ContextConfigurer(), new RoutesConfigurer(), new RoutesDumper()));
-    }
-
-    // *****************************
-    //
-    //
-    //
-    // *****************************
-
-    private static class CamelContextConfigurer implements CamelContextConfiguration {
-        private final ConfigurableApplicationContext applicationContext;
-        private final List<Runtime.Listener> listeners;
-
-        public CamelContextConfigurer(ConfigurableApplicationContext applicationContext, List<Runtime.Listener> listeners) {
-            this.applicationContext = applicationContext;
-            this.listeners = listeners;
-        }
-
-        @Override
-        public void beforeApplicationStart(CamelContext context) {
-            final Runtime.Registry registry = new RuntimeApplicationContextRegistry(applicationContext, context.getRegistry());
-            final Runtime runtime = new Runtime() {
-                @Override
-                public CamelContext getContext() {
-                    return context;
-                }
-                @Override
-                public Registry getRegistry() {
-                    return registry;
-                }
-            };
-
-            listeners.forEach(l -> l.accept(Runtime.Phase.Starting, runtime));
-            listeners.forEach(l -> l.accept(Runtime.Phase.ConfigureContext, runtime));
-            listeners.forEach(l -> l.accept(Runtime.Phase.ConfigureRoutes, runtime));
-        }
-
-        @Override
-        public void afterApplicationStart(CamelContext context) {
-            final Runtime.Registry registry = new RuntimeApplicationContextRegistry(applicationContext, context.getRegistry());
-            final Runtime runtime = new Runtime() {
-                @Override
-                public CamelContext getContext() {
-                    return context;
-                }
-                @Override
-                public Registry getRegistry() {
-                    return registry;
-                }
-            };
-
-            listeners.forEach(l -> l.accept(Runtime.Phase.Started, runtime));
-
-        }
-    }
-
-    private static class RuntimeApplicationContextRegistry extends InMemoryRegistry {
-        private final ConfigurableApplicationContext applicationContext;
-        private final org.apache.camel.spi.Registry registry;
-
-        public RuntimeApplicationContextRegistry(ConfigurableApplicationContext applicationContext, org.apache.camel.spi.Registry registry) {
-            this.applicationContext = applicationContext;
-            this.registry = registry;
-        }
-
-        @Override
-        public Object lookupByName(String name) {
-            return registry.lookupByName(name);
-        }
-
-        @Override
-        public <T> T lookupByNameAndType(String name, Class<T> type) {
-            return registry.lookupByNameAndType(name, type);
-        }
-
-        @Override
-        public <T> Map<String, T> findByTypeWithName(Class<T> type) {
-            return registry.findByTypeWithName(type);
-        }
-
-        @Override
-        public <T> Set<T> findByType(Class<T> type) {
-            return registry.findByType(type);
-        }
-    }
-}
diff --git a/camel-k-runtime-spring-boot/src/main/resources/META-INF/spring.factories b/camel-k-runtime-spring-boot/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index f6df31c..0000000
--- a/camel-k-runtime-spring-boot/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-    org.apache.camel.k.spring.boot.ApplicationAutoConfiguration
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e861fd0..083a8d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,6 @@
         <snakeyaml.version>1.24</snakeyaml.version>
         <spock.version>1.3-groovy-2.5</spock.version>
         <jackson.version>2.9.8</jackson.version>
-        <spring-boot.version>2.1.4.RELEASE</spring-boot.version>
         <immutables.version>2.7.5</immutables.version>
         <semver4j.version>2.2.0</semver4j.version>
         <gmavenplus-plugin.version>1.6.1</gmavenplus-plugin.version>
@@ -147,8 +146,6 @@
         <module>camel-k-runtime-groovy</module>
         <module>camel-k-runtime-kotlin</module>
         <module>camel-k-runtime-yaml</module>
-        <module>camel-k-runtime-spring-boot-layout</module>
-        <module>camel-k-runtime-spring-boot</module>
         <module>camel-k-runtime-health</module>
         <module>camel-knative-http</module>
         <module>camel-knative</module>
@@ -222,16 +219,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.k</groupId>
-                <artifactId>camel-k-runtime-spring-boot</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.k</groupId>
-                <artifactId>camel-k-runtime-spring-boot-layout</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.k</groupId>
                 <artifactId>camel-k-runtime-health</artifactId>
                 <version>${project.version}</version>
             </dependency>