May 22, 2017 | Written by: Joseph Marrero
Share this post:
Starting with the future release of the Liberty for Java Buildpack version 3.11 the default Library for Cloudant NoSQL Database used with auto-wiring will be the Official Cloudant Liberty for Java. The current Ektorp library will still be included in the Liberty for Java Buildpack, however, a configuration setting must be changed to use it.
To use the official Cloudant Library in your application you will need to change your application code to import and use the classes from the official Cloudant library instead of Ektorp. Your pom.xml must also be updated if you are using maven.
To continue to use Ektorp and not modify your application you will just need to set up the following environment variable:
cf set-env myAppName LBP_SERVICE_CONFIG_CLOUDANTNOSQLDB “type: couchdb”
Using the current release of the Liberty for java buildpack you can start using the future default behavior by setting the following environment variable:
cf set-env myAppName LBP_SERVICE_CONFIG_CLOUDANTNOSQLDB “type: cloudant”
The following sample application makes use of auto-wiring and the Official Cloudant Library for Java:
Get Started Java – Auto-wiring branch