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/libertyExtensions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The following properties are supported for server configuration.
36
36
| clean | boolean | 1.0 | Clean all cached information on server start up. It deletes every file in the `${wlp_output_dir}/logs`, `${wlp_output_dir}/workarea`, `${wlp_user_dir}/dropins` or `${wlp_user_dir}/apps`. The default value is `false`. Only used with the `libertyStart` and `libertyRun` tasks. | No |
37
37
| configDirectory| File | 2.0 | Location of a server configuration directory to be used by the server instance. Configuration files and folder structure will be copied to the server instance. Files specified by other server extension properties will take precedence over files located in the configDirectory. The default value is `/src/main/liberty/config`. | No|
38
38
| defaultVar | Properties | 3.0 | Inline server variables that are written to the `configDropins/defaults/liberty-plugin-variable-config.xml` file in the server directory. The property name is used for the variable `name`, and the property value is used for the variable `defaultValue`. If you are using [dev container mode](libertyDev.md#libertydevc-task-container-mode), ensure to copy the configDropins/defaults folder into your container image.| No|
39
-
| embedded | boolean | 2.7 | Whether the server is [embedded](https://www.ibm.com/support/knowledgecenter/SSD28V_9.0.0/com.ibm.websphere.wlp.core.doc/ae/twlp_extend_embed.html) in the Gradle JVM. If not, the server will run as a separate process. The default value is `false`. Only used with the `libertyStart`, `libertyRun` and `libertyStop` tasks. | No |
39
+
| embedded | boolean | 2.7 | Whether the server is [embedded](https://www.ibm.com/support/knowledgecenter/SSD28V_9.0.0/com.ibm.websphere.wlp.core.doc/ae/twlp_extend_embed.html) in the Gradle JVM. If not, the server will run as a separate process. The default value is `false`. Only used with the `libertyStart`, `libertyRun` and `libertyStop` tasks. **Note:** When using embedded mode with the Gradle daemon and `libertyRun`, the server will continue running in the daemon JVM after pressing Ctrl+C. Use `gradle libertyStop` or `gradle --stop` to stop the server. See [libertyRun](libertyRun.md#embedded-server-mode-with-gradle-daemon) for more details.| No |
40
40
| env | Properties | 3.0 | Inline server environment variables that are written to the server.env file in the server directory. These properties take precedence over a specified server.env file. | No|
41
41
| jvmOptions| List | 2.0 | Inline `List` of jvm options that is written to the jvm.options file in the server directory. These properties take precedence over a specified jvm.options file. | No|
42
42
| jvmOptionsFile| File | 2.0 | Location of the file containing JVM options to copy to the jvm.options file in the server instance. | No|
Copy file name to clipboardExpand all lines: docs/libertyRun.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,22 @@ gradle libertyRun --no-daemon
10
10
`libertyRun` also depends on `deploy` if configured.
11
11
12
12
### What is the Gradle Daemon and why --no-daemon?
13
-
The Gradle Daemon is a long-running background process designed to help speed up the build process. It does so by caching project information and staying alive, avoiding constant JVM startup costs. This behavior is default until specified otherwise.
14
-
Gradle's current daemon design makes it difficult to use a `run` task, as a Ctrl-C would kill the daemon while simultaneously leaving the application running in the background. Therefore, we need `--no-daemon` so that the signal can be received and properly handled.
15
-
In the event that a user does run a `libertyRun` with a daemon (default), an external `libertyStop` must be called in order to properly shut down the server. A Ctrl-C while the Gradle process is running will not stop the server. Use `libertyStatus` to confirm the state of your server.
13
+
The Gradle Daemon is a long-running background process designed to help speed up the build process. It does so by caching project information and staying alive, avoiding constant JVM startup costs. This behavior is default until specified otherwise.
14
+
Gradle's current daemon design makes it difficult to use a `run` task, as a Ctrl-C would kill the daemon while simultaneously leaving the application running in the background. Therefore, we need `--no-daemon` so that the signal can be received and properly handled.
15
+
In the event that a user does run a `libertyRun` with a daemon (default), an external `libertyStop` must be called in order to properly shut down the server. A Ctrl-C while the Gradle process is running will not stop the server. Use `libertyStatus` to confirm the state of your server.
16
+
17
+
### Embedded Server Mode with Gradle Daemon
18
+
When using `embedded = true` in the Liberty server configuration along with the Gradle daemon, the Liberty server runs within the daemon JVM. This creates an additional complication:
19
+
- Pressing Ctrl-C terminates the client connection but **not** the daemon JVM
20
+
- The embedded Liberty server continues running in the daemon JVM
21
+
- The shutdown hook registered by the plugin does not execute because the daemon JVM remains alive
22
+
23
+
**Workarounds:**
24
+
1. Use `gradle libertyStop` to stop the embedded server
25
+
2. Use `gradle --stop` to stop the entire Gradle daemon (which will also stop the embedded server)
26
+
3. Use `--no-daemon` flag when running `libertyRun` to avoid this issue entirely
27
+
28
+
**Recommendation:** For embedded server mode, it is strongly recommended to use `--no-daemon` or avoid using embedded mode with the daemon.
16
29
17
30
### 0% or 66% Executing?
18
31
While running this task, Gradle will show something like:
0 commit comments