|
| 1 | +# Important notice: this buildpack has temporary restrictions which are detailed below. |
| 2 | + |
| 3 | +# Migrating from cloudfoundry-buildpack-java |
| 4 | + |
| 5 | +This buildpack supersedes the buildpack [`cloudfoundry-buildpack-java`](https://github.com/cloudfoundry/cloudfoundry-buildpack-java) but is not backward |
| 6 | +compatible with it, so users should read the following migration notes. |
| 7 | + |
| 8 | +## Detect Processing |
| 9 | + |
| 10 | +`cloudfoundry-buildpack-java` had different detection rules to this buildpack. It performed a sequence of detection checks and acted upon the first check, if any, which passed. So it paid no attention to |
| 11 | +potentially ambiguous results. |
| 12 | + |
| 13 | +This buildpack ensures that at most one _container_ (see [Design](design.md) for the definition of this term) can be used to run an application and raises an error if more than one container can be used. |
| 14 | + |
| 15 | +This buildpack supports all the types of application that `cloudfoundry-buildpack-java` supported. However, this buildpack distinguishes between _containers_ and orthogonal _frameworks_ (see [Design](design.md) for the definition of this term) whereas `cloudfoundry-buildpack-java` merged these concepts. |
| 16 | + |
| 17 | +## All Application Types |
| 18 | + |
| 19 | +<b>Temporary restriction:</b> this buildpack does not yet support the Spring `cloud` |
| 20 | +namespace for direct binding to Cloud Foundry services or Spring auto-reconfiguration |
| 21 | +for automatic re-binding to such services. |
| 22 | + |
| 23 | +## Play Applications |
| 24 | + |
| 25 | +`cloudfoundry-buildpack-java` allowed the Play `start` script (and the application's `lib` directory, |
| 26 | +although this is ignored during detection) to reside in an arbitrary subdirectory of the application directory. |
| 27 | +This buildpack requires the `start` script and the `lib` directory (or, equivalently, the `staged` directory) to reside directly in the application directory. If it is more convenient |
| 28 | +to push the application from another directory, use the `path` parameter of `cf push` to specify the |
| 29 | +directory containing the `start` script. This avoids needlessly uploading additional files. |
| 30 | + |
| 31 | +<b>Temporary restriction:</b> this buildpack does not yet support Play applications that use JPA. |
| 32 | + |
| 33 | +## Grails Applications |
| 34 | + |
| 35 | +The support for Grails applications in this buildpack is identical to the support for standard web |
| 36 | +applications. |
| 37 | + |
| 38 | +## Web Applications |
| 39 | + |
| 40 | +`cloudfoundry-buildpack-java` allowed `web.xml` to reside in either of the directories `WEB-INF` or `webapps/ROOT/WEB-INF` whereas this buildpack requires `web.xml` to reside in the `WEB-INF` directory. |
| 41 | + |
| 42 | +`cloudfoundry-buildpack-java` was hard-coded to use a specific version of Tomcat. This buildpack is configured |
| 43 | +to use the latest update of a particular version of Tomcat. If a specific version of Tomcat is required, |
| 44 | +configure it in `config/tomcat.yml`. |
| 45 | + |
| 46 | +`cloudfoundry-buildpack-java` automatically configured listeners with class names `org.apache.catalina.core.JreMemoryLeakPreventionListener` and |
| 47 | +`org.apache.catalina.mbeans.GlobalResourcesLifecycleListener`. |
| 48 | +`JreMemoryLeakPreventionListener` is not necessary since the memory leaks it prevents do not occur in Cloud Foundry. |
| 49 | +`GlobalResourcesLifecycleListener` is not necessary since Cloud Foundry applications are not managed |
| 50 | +using JMX. |
| 51 | + |
| 52 | +<b>Temporary restriction:</b> `cloudfoundry-buildpack-java` automatically downloaded hard-coded versions of MySQL and PostGres database driver JARs and added them to the `lib` directory of the application, whereas this buildpack does not yet download or add database driver JARs. |
| 53 | + |
| 54 | +## Java Main Applications |
| 55 | + |
| 56 | +`cloudfoundry-buildpack-java` required Java main applications to contain a `.jar` or a `.class` file somewhere in the |
| 57 | +application directory tree whereas this buildpack requires either the `Main-Class` attribute to be set |
| 58 | +in `META-INF/MANIFEST.MF` or `java_main_class` to be configured in `config/main.yml`. |
| 59 | + |
| 60 | +`cloudfoundry-buildpack-java` used a version of OpenJDK specified as the property `java.runtime.version` in a file `system.properties` residing anywhere in the application directory tree. If this property was not specified, `cloudfoundry-buildpack-java` used a hard-coded version of OpenJDK. This buildpack is configured |
| 61 | +to use the latest update of a particular version of OpenJDK. If a specific version of OpenJDK is required, |
| 62 | +configure it in `config/openjdk.yml`. The version of OpenJDK may no longer be specified using a system property. |
| 63 | + |
| 64 | +`cloudfoundry-buildpack-java` configured both the JVM maximum and minimum heap sizes to equal the application memory limit (`$MEMORY_LIMIT`). This buildpack supports a variety of memory size settings and memory heuristic settings for calculating defaults based on the application memory limit. See [OpenJDK JRE configuration](jre-openjdk.md#configuration) for details. |
| 65 | + |
| 66 | +`cloudfoundry-buildpack-java` used to set the `java.io.tmpdir` Java system property to `$TMPDIR`. If this is required, configure [`java_opts`](framework-java_opts.md#configuration). |
| 67 | + |
0 commit comments