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
In dev/test mode this defaults to localhost, in prod mode this defaults to 0.0.0.0
16033
16033
16034
16034
Defaulting to 0.0.0.0 makes it easier to deploy Quarkus to container, however it is not suitable for dev/test mode as other people on the network can connect to your development machine.
16035
16035
16036
+
As an exception, when running in Windows Subsystem for Linux (WSL), the HTTP host defaults to 0.0.0.0 even in dev/test mode since using localhost makes the application inaccessible.
In dev/test mode this defaults to localhost, in prod mode this defaults to 0.0.0.0
283
283
284
284
Defaulting to 0.0.0.0 makes it easier to deploy Quarkus to container, however it is not suitable for dev/test mode as other people on the network can connect to your development machine.
285
285
286
+
As an exception, when running in Windows Subsystem for Linux (WSL), the HTTP host defaults to 0.0.0.0 even in dev/test mode since using localhost makes the application inaccessible.
Copy file name to clipboardExpand all lines: _versions/main/guides/conditional-extension-dependencies.adoc
+59-10Lines changed: 59 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,19 +9,19 @@ include::_attributes.adoc[]
9
9
:summary: Trigger the inclusion on additional extensions based on certain conditions.
10
10
:topics: extensions
11
11
12
-
Quarkus extension dependencies are usually configured in the same way as any other project dependencies in a project's build file, e.g. the Maven `pom.xml` or the Gradle build scripts. However, Quarkus also supports types of dependencies that aren't supported out-of-the-box by Maven and Gradle. Conditional Quarkus extension dependencies falls into that category.
12
+
Quarkus extension dependencies are usually configured in the same way as any other project dependencies in a project's build file, for example the Maven `pom.xml` or the Gradle build scripts. However, Quarkus also supports types of dependencies that aren't supported out-of-the-box by Maven and Gradle. Conditional Quarkus extension dependencies is one such example.
13
13
14
14
== Conditional Dependencies
15
15
16
-
A conditional dependency is a dependency that is activated only if a certain condition is satisfied. If the condition is not satisfied then the dependency **must not** be activated. In that regard, conditional dependencies can be categorized as optional, meaning they may or may not appear in the resulting dependency graph.
16
+
A conditional dependency is a dependency that is activated only if a certain condition is satisfied. If the condition is not satisfied then the dependency **will not** be activated. In that regard, conditional dependencies can be categorized as optional, meaning they may or may not appear in the resulting dependency graph.
17
17
18
18
A typical example of a conditional dependency would be a component that should be added to the classpath **only** in case all of its required dependencies are present on the classpath. If one or more of the component's required dependencies aren't available, instead of failing, the component should simply not be added.
19
19
20
20
== Conditional Quarkus Extension Dependencies
21
21
22
-
A Quarkus extension may declare one or more conditional dependencies on other Quarkus extensions. Conditional dependencies on and from non-extension artifacts aren't supported.
22
+
A Quarkus extension may declare one or more conditional dependencies on other Quarkus extensions or regular Maven artifacts.
23
23
24
-
Let's consider the following scenario as an example: `quarkus-extension-a` has an optional dependency on `quarkus-extension-b` which should be included in a Quarkus application only if `quarkus-extension-c` is found among the application dependencies (direct or transitive). In this case, the presence of `quarkus-extension-c` is the condition which, if satisfied, will trigger inclusion of the `quarkus-extension-b` when Quarkus application dependencies are resolved.
24
+
Let's consider the following scenario as an example: `quarkus-extension-a` has an optional dependency on `quarkus-extension-b` which should be included in a Quarkus application only if `quarkus-extension-c` is found among the application dependencies (direct or transitive). In this case, the presence of `quarkus-extension-c` is the condition, which, if satisfied, will trigger inclusion of the `quarkus-extension-b` when Quarkus application dependencies are resolved.
25
25
26
26
The condition which triggers activation of an extension is configured in the extension's `META-INF/quarkus-extension.properties`, which is included in the runtime artifact of the extension. Extension developers can add the following configuration to express the condition which would have to be satisfied for the extension to be activated:
27
27
@@ -66,11 +66,13 @@ The condition which triggers activation of an extension is configured in the ext
66
66
<3> configuration of the dependency condition which will have to be satisfied for this extension to be added to a Quarkus application expressed as a list of artifacts that must be present among the application dependencies;
67
67
<4> an artifact key (in the format of `groupId:artifactId[:<classifier>:<extension>]` but typically simply `<groupId>:<artifactId>`) of the artifact that must be present among the application dependencies for the condition to be satisfied.
68
68
69
-
NOTE: In the example above the `artifact` used in the condition configuration happens to be a runtime Quarkus extension artifact but it could as well be any other artifact. There could also be more than one `artifact` element in the body of the `dependencyCondition`.
69
+
NOTE: In the example above the `artifact` used in the condition configuration happens to be a runtime Quarkus extension artifact but it could as well be any other artifact.
70
+
71
+
The `dependencyCondition` element may contain more than `artifact`, in which case all the configured artifacts must be present on the classpath for the condition to be satisfied.
70
72
71
73
Now, having a dependency condition recorded in the descriptor of the `quarkus-extension-b`, other extensions may declare a conditional dependency on it.
72
74
73
-
NOTE: extensions with dependency conditions present in their metadata could still appear as regular dependencies in Maven `pom.xml` and Gradle build scripts.
75
+
NOTE: extensions with dependency conditions present in their metadata could still appear as regular dependencies in Maven `pom.xml` and Gradle build scripts, in which case their conditions will simply be ignored.
74
76
75
77
A conditional dependency is configured in the runtime artifact of a Quarkus extension. In this example, the `quarkus-extension-a` will declare a conditional dependency on the `quarkus-extension-b`, which can be done in the following two ways.
76
78
@@ -164,7 +166,7 @@ Conditional dependencies can also be configured in the Quarkus extension descrip
@@ -223,11 +225,58 @@ Dev mode-only extension dependencies can be configured in the Quarkus extension
223
225
----
224
226
<1> the runtime Quarkus extension artifact ID;
225
227
<2> the goal that generates the extension descriptor which every Quarkus runtime extension project should be configured with;
226
-
<3> the dev mode conditional dependency configuration element;
227
-
<4> the artifact coordinates of conditional dependencies on extensions that should be evaluated only if an application is launched in dev mode.
228
+
<3> conditional dependencies that should be evaluated only in dev mode;
229
+
<4> the artifact coordinates of a conditional dependency.
228
230
229
231
The `quarkus-extension-b`, in this example, may or may not define its own condition to be evaluated.
230
232
231
233
If the `quarkus-extension-b` does not define a dependency condition on its own (there is no dependency condition recorded in its `META-INF/quarkus-extension.properties`), the `quarkus-extension-b` will only be added as a dependency of the `quarkus-extension-a` in dev mode but not in other modes (prod or test).
232
234
233
235
If the `quarkus-extension-b` does define a dependency condition on its own (a dependency condition recorded in its `META-INF/quarkus-extension.properties`), the `quarkus-extension-b` will be added as a dependency of the `quarkus-extension-a` in dev mode only if its condition is satisfied (the artifacts it requires are present in the application dependency graph).
236
+
237
+
=== Dev mode dependencies on regular Maven artifacts
238
+
239
+
Extensions may also declare conditional dependencies on regular Maven artifacts, that are not Quarkus extensions. Given that regular Maven artifacts do not include Quarkus metadata, the condition for their inclusion is configured by an extension depending on them.
<2> the goal that generates the extension descriptor which every Quarkus runtime extension project should be configured with;
279
+
<3> conditional dependencies that should be evaluated only in dev mode;
280
+
<4> the artifact coordinates of a conditional dependency.
281
+
282
+
In this example `library-b` is a regular Maven artifact that will be added as a dependency of the `quarkus-extension-a` only when an application is launched in dev mode.
Copy file name to clipboardExpand all lines: _versions/main/guides/management-interface-reference.adoc
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,15 +40,30 @@ NOTE: The management interface is disabled when no extensions relying on it (suc
40
40
By default, the management interface is exposed on the interface: `0.0.0.0` (all interfaces) and on the port `9000` (`9001` in test mode).
41
41
It does not use TLS (`https`) by default.
42
42
43
-
You can configure the host, ports, and TLS certificates using the following properties:
43
+
You can configure the host, ports, and TLS configuration name using the following properties:
44
44
45
45
* `quarkus.management.host` - the interface / host
46
46
* `quarkus.management.port` - the port
47
47
* `quarkus.management.test-port` - the port to use in test mode
48
-
* `quarkus.management.ssl` - the TLS configuration, xref:http-reference#ssl[same as for the main HTTP server].
48
+
* `quarkus.management.tls-configuration-name` - the TLS configuration name, xref:http-reference.adoc#using-the-tls-centralized-configuration[same as for the main HTTP server].
49
49
50
50
Here is a configuration example exposing the management interface on _https://localhost:9002_:
0 commit comments