Merge pull request #9925 from sampada07/JAVA-33
JAVA-33: move all spring-... modules to Boot 2
This commit is contained in:
commit
f35bd115f6
@ -9,6 +9,8 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<!-- Jhipster project is autogenerated and upgrading it will need a newly generated project.
|
||||||
|
Also, we already have jhipster-5 which has new version of boot-2. So, this project should be left as a legacy version. -->
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-1</artifactId>
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<!-- this module uses legacy Spring features, so can't upgrade to boot-2 -->
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-1</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<description>Demo project for Spring Boot</description>
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<!-- This module uses Activiti version 6.0.0 with support for Spring Boot 1. Upgrade to Boot 2 should be clubbed with upgrade to Activiti 7 -->
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-1</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<description>Module for Spring Boot version 1.x</description>
|
<description>Module for Spring Boot version 1.x</description>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<!-- This module contains article about Spring Boot Actuator in Spring Boot version 1.x -->
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-1</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-2</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<relativePath>../../parent-boot-1</relativePath>
|
<relativePath>../../parent-boot-2</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -38,12 +38,10 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<version>${spring-boot-starter.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<version>${spring-boot-starter.version}</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -55,7 +53,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>${spring-boot-starter.version}</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
@ -68,8 +65,7 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<camel.version>2.19.1</camel.version>
|
<camel.version>3.0.0-M4</camel.version>
|
||||||
<spring-boot-starter.version>1.5.4.RELEASE</spring-boot-starter.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -12,12 +12,16 @@ import org.apache.camel.model.rest.RestBindingMode;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration;
|
||||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication(exclude = { WebSocketServletAutoConfiguration.class, AopAutoConfiguration.class, OAuth2ResourceServerAutoConfiguration.class, EmbeddedWebServerFactoryCustomizerAutoConfiguration.class })
|
||||||
@ComponentScan(basePackages = "com.baeldung.camel")
|
@ComponentScan(basePackages = "com.baeldung.camel")
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
@ -38,7 +42,6 @@ public class Application{
|
|||||||
return servlet;
|
return servlet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
class RestApi extends RouteBuilder {
|
class RestApi extends RouteBuilder {
|
||||||
|
|
||||||
@ -47,7 +50,6 @@ public class Application{
|
|||||||
|
|
||||||
CamelContext context = new DefaultCamelContext();
|
CamelContext context = new DefaultCamelContext();
|
||||||
|
|
||||||
|
|
||||||
// http://localhost:8080/camel/api-doc
|
// http://localhost:8080/camel/api-doc
|
||||||
restConfiguration().contextPath(contextPath) //
|
restConfiguration().contextPath(contextPath) //
|
||||||
.port(serverPort)
|
.port(serverPort)
|
||||||
@ -82,9 +84,7 @@ your REST services request and response types.
|
|||||||
|
|
||||||
.to("direct:remoteService");
|
.to("direct:remoteService");
|
||||||
|
|
||||||
|
from("direct:remoteService").routeId("direct-route")
|
||||||
from("direct:remoteService")
|
|
||||||
.routeId("direct-route")
|
|
||||||
.tracing()
|
.tracing()
|
||||||
.log(">>> ${body.id}")
|
.log(">>> ${body.id}")
|
||||||
.log(">>> ${body.name}")
|
.log(">>> ${body.name}")
|
||||||
@ -92,11 +92,13 @@ your REST services request and response types.
|
|||||||
.process(new Processor() {
|
.process(new Processor() {
|
||||||
@Override
|
@Override
|
||||||
public void process(Exchange exchange) throws Exception {
|
public void process(Exchange exchange) throws Exception {
|
||||||
MyBean bodyIn = (MyBean) exchange.getIn().getBody();
|
MyBean bodyIn = (MyBean) exchange.getIn()
|
||||||
|
.getBody();
|
||||||
|
|
||||||
ExampleServices.example(bodyIn);
|
ExampleServices.example(bodyIn);
|
||||||
|
|
||||||
exchange.getIn().setBody(bodyIn);
|
exchange.getIn()
|
||||||
|
.setBody(bodyIn);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(201));
|
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(201));
|
||||||
|
@ -13,3 +13,5 @@ management.port=8081
|
|||||||
# disable all management enpoints except health
|
# disable all management enpoints except health
|
||||||
endpoints.enabled = true
|
endpoints.enabled = true
|
||||||
endpoints.health.enabled = true
|
endpoints.health.enabled = true
|
||||||
|
|
||||||
|
spring.main.allow-bean-definition-overriding=true
|
@ -9,6 +9,7 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<!-- uses legacy spring, cannot upgrade to boot-2 -->
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-boot-1</artifactId>
|
<artifactId>parent-boot-1</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user