You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/container-java_main.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Command line arguments may optionally be configured.
10
10
<table>
11
11
<tr>
12
12
<td><strong>Detection Criteria</strong></td>
13
-
<td><tt>Main-Class</tt> attribute set in <tt>META-INF/MANIFEST.MF</tt> or <tt>java_main_class</tt> set in <tt>config/java_main.yml<tt></td>
13
+
<td><tt>Main-Class</tt> attribute set in <tt>META-INF/MANIFEST.MF</tt>, or <tt>java_main_class</tt> set in <tt>JBP_CONFIG_JAVA_MAIN</tt></td>
14
14
</tr>
15
15
<tr>
16
16
<td><strong>Tags</strong></td>
@@ -23,17 +23,25 @@ If the application uses Spring, [Spring profiles][] can be specified by setting
23
23
24
24
## Spring Boot
25
25
26
-
If the main class is Spring Boot's `JarLauncher`, `PropertiesLauncher` or `WarLauncher`, the Java Main Container adds a `--server.port` argument to the command so that the application uses the correct port.
26
+
If `java_main_class` is set to one of Spring Boot's launchers (`JarLauncher`, `PropertiesLauncher` or `WarLauncher`), the Java Main Container sets `SERVER_PORT=$PORT`so that the application binds to the CF-assigned port.
27
27
28
28
## Configuration
29
29
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
30
30
31
-
The container can be configured by modifying the `config/java_main.yml` file in the buildpack fork.
31
+
The container can be configured using the `JBP_CONFIG_JAVA_MAIN` environment variable.
32
32
33
33
| Name | Description
34
34
| ---- | -----------
35
35
| `arguments` | Optional command line arguments to be passed to the Java main class. The arguments are specified as a single YAML scalar in plain style or enclosed in single or double quotes.
36
-
| `java_main_class` | Optional Java class name to run. Values containing whitespace are rejected with an error, but all others values appear without modification on the Java command line. If not specified, the Java Manifest value of `Main-Class` is used.
36
+
| `java_main_class` | Optional Java class name to run. Values containing whitespace are rejected with an error, but all others values appear without modification on the Java command line. If not specified, the Java Manifest value of `Main-Class` is used. Setting this overrides container detection — even Spring Boot apps will use the Java Main container when this is set.
37
+
38
+
### Example: PropertiesLauncher with external config
0 commit comments