"It is not the strongest of the species that survives, nor the most intelligent that survives. It is the one that is most adaptable to change. In the struggle for survival, the fittest win out at the expense of their rivals because they succeed in adapting themselves best to their environment." - attributed to Charles Darwin [REF]
pom.xml
file.
<!-- CloudFoundry/Heroku -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-connector</artifactId>
<version>${org.springframework.cloud-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-heroku-connector</artifactId>
<version>${org.springframework.cloud-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-spring-service-connector</artifactId>
<version>${org.springframework.cloud-version}</version>
</dependency>
<!-- SAP HANA Cloud Platform -->
<dependency>
<groupId>com.sap.hana.cloud</groupId>
<artifactId>spring-cloud-sap-connector</artifactId>
<version>${com.sap.hana.cloud-version}</version>
</dependency>
<dependency>
<groupId>com.sap.hana.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-hana-service-connector</artifactId>
<version>${com.sap.hana.cloud-version}</version>
</dependency>
<!--
<beans profile="dev, prod" >
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/DefaultDB" />
</beans>
-->
<beans profile="dev, prod, cloud">
<cloud:data-source id="dataSource"/>
</beans>
environment
profile specified in the web.xml
to state cloud
. One could argue about the fitness of cloud
as an environment profile name given there may be multiple instances of the app running in the cloud (e.g. dev, staging, QA and production), but I guess the authors of the Spring Cloud Connector assume that each instance has it's own DB wired automatically and for them it was more important to distinguish between local and cloud environments. Anyway, you get the idea and should be able to make an educated decision in your own applications.environment
profile name within the web.xml
is indeed sub-optimal and it would be much better to develop a custom ApplicationContextInitializer
that is smart enough to detect the environment it is running in using some sort of environment variables (e.g. as illustrated here). We'll fix that in a subsequent commit!manifest.yml
that defines several attributes needed for the deployment/execution of the application. The content is pretty much self-explanatory, but maybe we should highlight the services
section. Right now, a service called hana_shared
is referenced, which is not yet (!!!) available outside of SAP. If you want to run this application in your Cloud Foundry environment you need to adjust that service section to match your environment (e.g. by replacing hana_shared
with postgresql
or the like.)You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 |