|
| 1 | +# Servlet Examples |
| 2 | +The Java Buildpack can run Servlet-based applications provided that they are packaged as a WAR file. |
| 3 | + |
| 4 | +## Gradle |
| 5 | +The following example shows how deploy the sample application located in the [Java Test Applications][j]. |
| 6 | + |
| 7 | +```bash |
| 8 | +$ gradle build |
| 9 | +$ cf push -p build/libs/web-servlet-2-application-1.0.0.BUILD-SNAPSHOT.war -b https://github.com/cloudfoundry/java-buildpack.git |
| 10 | + |
| 11 | +-----> Downloading Open Jdk JRE 1.7.0_51 from http://.../openjdk/lucid/x86_64/openjdk-1.7.0_51.tar.gz (0.0s) |
| 12 | + Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s) |
| 13 | +-----> Downloading Spring Auto Reconfiguration 0.8.7 from http://.../auto-reconfiguration/auto-reconfiguration-0.8.7.jar (0.0s) |
| 14 | + Modifying /WEB-INF/web.xml for Auto Reconfiguration |
| 15 | +-----> Downloading Tomcat 7.0.50 from http://.../tomcat/tomcat-7.0.50.tar.gz (0.0s) |
| 16 | + Expanding Tomcat to .java-buildpack/tomcat (0.1s) |
| 17 | +-----> Downloading Buildpack Tomcat Support 1.1.1 from http://.../tomcat-buildpack-support/tomcat-buildpack-support-1.1.1.jar (0.0s) |
| 18 | +-----> Uploading droplet (51M) |
| 19 | + |
| 20 | +$ curl ...cfapps.io |
| 21 | +ok |
| 22 | +``` |
| 23 | + |
| 24 | +## Maven |
| 25 | +The following example shows how deploy the sample application located in the [Java Test Applications][j]. |
| 26 | + |
| 27 | +```bash |
| 28 | +$ mvn package |
| 29 | +$ cf push -p cf push -p target/web-servlet-2-application-1.0.0.BUILD-SNAPSHOT.war -b https://github.com/cloudfoundry/java-buildpack.git -b https://github.com/cloudfoundry/java-buildpack.git |
| 30 | + |
| 31 | +-----> Downloading Open Jdk JRE 1.7.0_51 from http://.../openjdk/lucid/x86_64/openjdk-1.7.0_51.tar.gz (0.0s) |
| 32 | + Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s) |
| 33 | +-----> Downloading Spring Auto Reconfiguration 0.8.7 from http://.../auto-reconfiguration/auto-reconfiguration-0.8.7.jar (0.0s) |
| 34 | + Modifying /WEB-INF/web.xml for Auto Reconfiguration |
| 35 | +-----> Downloading Tomcat 7.0.50 from http://.../tomcat/tomcat-7.0.50.tar.gz (0.0s) |
| 36 | + Expanding Tomcat to .java-buildpack/tomcat (0.1s) |
| 37 | +-----> Downloading Buildpack Tomcat Support 1.1.1 from http://.../tomcat-buildpack-support/tomcat-buildpack-support-1.1.1.jar (0.0s) |
| 38 | +-----> Uploading droplet (51M) |
| 39 | + |
| 40 | +$ curl ...cfapps.io |
| 41 | +ok |
| 42 | +``` |
| 43 | + |
| 44 | +[j]: https://github.com/cloudfoundry/java-test-applications/tree/master/web-servlet-2-application |
0 commit comments