Skip to content

Commit 53f901b

Browse files
author
Christopher Frost
committed
Support configuration of Java Main applications
Adds a config file for Java Main applications to allow it to be configured by environment variables without forking the buildpack. [#101680106]
1 parent 2e59e52 commit 53f901b

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

config/java_main.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Cloud Foundry Java Buildpack
2+
# Copyright 2013-2015 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Configuration for the Java Main container
17+
---
18+
java_main_class:
19+
arguments:

docs/container-java_main.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ If the application uses Spring, [Spring profiles][] can be specified by setting
2323
## Spring Boot
2424

2525
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+
2627
## Configuration
2728
For general information on configuring the buildpack, refer to [Configuration and Extension][].
2829

29-
The container can be configured by creating or modifying the `config/java_main.yml` file in the buildpack fork.
30+
The container can be configured by modifying the `config/java_main.yml` file in the buildpack fork.
3031

3132
| Name | Description
3233
| ---- | -----------
3334
| `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.
34-
| `java_main_class` | The 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.
35+
| `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.
3536

3637
[Configuration and Extension]: ../README.md#configuration-and-extension
3738
[Spring profiles]:http://blog.springsource.com/2011/02/14/spring-3-1-m1-introducing-profile/

0 commit comments

Comments
 (0)