-
Spring Cloud Connectors provides a simple abstraction for JVM-based applications running on cloud platforms to discover bound services and deployment information at runtime and provides support for registering discovered services as Spring beans. It is based on a plugin model so that the identical compiled application can be deployed locally or on multiple clouds, and it supports custom service definitions through Java SPI.
+
Spring Cloud Connectors provides a simple abstraction for JVM-based applications running on cloud platforms to discover bound services and deployment information at runtime, and provides support for registering discovered services as Spring beans. It is based on a plugin model so that the identical compiled application can be deployed locally or on any of multiple cloud platforms, and it supports custom service definitions through Java SPI.
Spring Cloud Connectors provides out-of-the-box support for discovering common services on Heroku and Cloud Foundry clouds as well as a properties-based configuration for development and testing.
@@ -567,74 +567,90 @@ table.CodeRay td.code>pre{padding:0}
Getting Started
-
The following examples are written for Maven; simply include the appropriate dependencies for your build system.
+
See below for examples of how to include the appropriate dependencies for your build system.
Including cloud connectors
Include the connector for each cloud platform you want to be discoverable. Including multiple connectors is perfectly fine; each connector will determine whether it should be active in a particular environment.
+
+
In Maven, replacing ${VERSION} with the desired artifact version:
+
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-localconfig-connector</artifactId>
- <version>1.1.1.RELEASE</version>
+ <version>${VERSION}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-connector</artifactId>
- <version>1.1.1.RELEASE</version>
+ <version>${VERSION}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-heroku-connector</artifactId>
- <version>1.1.1.RELEASE</version>
+ <version>${VERSION}</version>
</dependency>
+
+
In Gradle, replacing ${VERSION} with the desired version:
+
+
+
+
dependencies {
+
+
+ compile 'org.springframework.cloud:spring-cloud-localconfig-connector:${VERSION}'
+
+
+ compile 'org.springframework.cloud:spring-cloud-cloudfoundry-connector:${VERSION}'
+
+
+ compile 'org.springframework.cloud:spring-cloud-heroku-connector:${VERSION}'
+
+}
+
+
Spring applications
-
Add the spring-service-connector in addition to your cloud connectors:
+
If you’re writing a Spring application, include the spring-service-connector in addition to your cloud connectors.
+
+
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-spring-service-connector</artifactId>
- <version>1.1.1.RELEASE</version>
-</dependency>
-
-
-<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-localconfig-connector</artifactId>
- <version>1.1.1.RELEASE</version>
-</dependency>
-
-
-<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-cloudfoundry-connector</artifactId>
- <version>1.1.1.RELEASE</version>
-</dependency>
-
-
-<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-heroku-connector</artifactId>
- <version>1.1.1.RELEASE</version>
+ <version>${VERSION}</version>
</dependency>
+
+
+
dependencies {
+
+ compile 'org.springframework.cloud:spring-cloud-spring-service-connector:${VERSION}'
+
+}
+
+
+
Then follow the instructions on Spring configuration using Java configuration or the <cloud> namespace.
@@ -652,7 +668,7 @@ table.CodeRay td.code>pre{padding:0}