On Github scottfrederick / java-on-cf
Community Engineer on Cloud Foundry at Pivotal
@scottyfred
sponsored by Pivotal
enjoys a vibrant community and ecosystem
deployable to VMware vSphere, OpenStack, and AWS
Buildpacks are responsible for setting up the environment for an application to run in.
Supported containers and detection criteria
choose zero or one
Supported frameworks and detection criteria
choose all that apply
<plugin> <groupId>org.cloudfoundry</groupId> <artifactId>cf-maven-plugin</artifactId> <version>1.0.1</version> <configuration> <server>mycloudfoundry-instance</server> <target>http://api.run.pivotal.io</target> <org>mycloudfoundry-org</org> <space>development</space> <appname>my-app</appname> <url>my-app.cfapps.io</url> <memory>512</memory> </configuration> </plugin>
$ mvn package cf:push
https://github.com/cloudfoundry/cf-java-client/tree/master/cloudfoundry-maven-plugin
buildscript { dependencies { classpath group: 'org.cloudfoundry', name: 'cf-gradle-plugin', version: '1.0.1' } } apply plugin: 'cloudfoundry' cloudfoundry { target = 'https://api.run.pivotal.io' organization = 'mycloudfoundry-org' space = 'development' application = 'my-app' file = new File("${war.archivePath}") uri = 'http://my-app.run.pivotal.io' memory = '512' }
$ gradle assemble cf-push
https://github.com/cloudfoundry/cf-java-client/tree/master/cloudfoundry-gradle-plugin
CloudCredentials credentials = new CloudCredentials(user, password); CloudFoundryClient client = new CloudFoundryClient(credentials, getTargetURL(target)); client.login(); System.out.println("\nSpaces:"); for (CloudSpace space : client.getSpaces()) { System.out.println(space.getName() + ":" + space.getOrganization().getName()); } System.out.println("\nApplications:"); for (CloudApplication app : client.getApplications()) { System.out.println(app.getName()); } System.out.println("\nServices"); for (CloudService service : client.getServices()) { System.out.println(service.getName() + ":" + service.getLabel()); }
http://docs.cloudfoundry.com/docs/using/managing-apps/libs/java-client.html