Permalink
Browse files

Introduced a root pom and refactored readme

  • Loading branch information...
bijukunjummen committed May 2, 2016
1 parent ba1ccd7 commit aea2387666abe55334adf542d1bc36a251d66fa4
Showing with 188 additions and 255 deletions.
  1. +13 −2 README.adoc
  2. +31 −91 cf-db-services-sample-auto/pom.xml
  3. +9 −70 cf-db-services-sample-connector/pom.xml
  4. +32 −92 cf-db-services-sample-props/pom.xml
  5. +103 −0 pom.xml
@@ -1,3 +1,14 @@
This is a simple Spring Boot based app to demonstrate different ways of connecting to a datastore when deploying to Cloud Foundry.
This is a simple Spring Boot based app to demonstrate different ways of connecting to a service or a datastore when
deploying to Cloud Foundry.
The simplest approach is to do nothing and let Cloud Foundry's Java Buildpack handle the details.
== Let Java Buildpack Autoreconfiguration handle it
The simplest approach is to do nothing and let Cloud Foundry's Java Buildpack handle the details.
Cloud Foundry's Java Buildpack injects a library called the https://github.com/cloudfoundry/java-buildpack-auto-reconfiguration[Java Buildpack Auto Reconfiguration] into the runtime deployable
which reconfigures the service connectivity appropriately.
== Use Java Environment properties
Spring Boot exposes the VCAP_SERVICES properties which is in the form of a JSON into a more consumable format - as simple environment properties. These properties can be used for configuring
the connectivity to the service
== Use Spring Cloud Connector
http://cloud.spring.io/spring-cloud-connectors/[Spring Cloud Connector] provides the most advanced configuration for enabling connectivity to an external service.
@@ -1,95 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-auto</artifactId>
<version>1.0.0.RELEASE</version>
<packaging>jar</packaging>
<name>univ</name>
<description>Sample App With DB Dependency Demo in CF - Auto Reconfiguration</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.M2</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>univ.Application</start-class>
<jackson.version>2.6.1</jackson.version>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-auto</artifactId>
<version>1.0.0.RELEASE</version>
<packaging>jar</packaging>
<name>univ-withAutoReconfig</name>
<description>Sample App With DB Dependency Demo in CF - Auto Reconfiguration</description>
<parent>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-parent</artifactId>
<version>1.0.0.RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<start-class>univ.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -8,33 +8,21 @@
<version>1.0.0.RELEASE</version>
<packaging>jar</packaging>
<name>univ</name>
<name>univ-withCloudConnector</name>
<description>Sample App With DB Dependency Demo in CF - Spring Cloud Connector</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.M2</version>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-parent</artifactId>
<version>1.0.0.RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<properties>
<start-class>univ.Application</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-connector</artifactId>
@@ -44,34 +32,7 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-spring-service-connector</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>univ.Application</start-class>
<jackson.version>2.6.1</jackson.version>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
@@ -81,26 +42,4 @@
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
@@ -1,95 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-props</artifactId>
<version>1.0.0.RELEASE</version>
<packaging>jar</packaging>
<name>univ</name>
<description>Sample App With DB Dependency Demo in CF - Explicit Properties</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.M2</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>univ.Application</start-class>
<jackson.version>2.6.1</jackson.version>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-props</artifactId>
<version>1.0.0.RELEASE</version>
<packaging>jar</packaging>
<name>univ-withProps</name>
<description>Sample App With DB Dependency Demo in CF - Explicit Properties</description>
<parent>
<groupId>univ</groupId>
<artifactId>cf-db-services-sample-parent</artifactId>
<version>1.0.0.RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<start-class>univ.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Oops, something went wrong.

0 comments on commit aea2387

Please sign in to comment.