Interface DevServicesBuildTimeConfig
-
Method Summary
Modifier and TypeMethodDescription@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String>command()The container start command to use for container-based Dev Service providers.Environment variables that are passed to the container.Generic properties that are passed for additional container configuration.dbName()The database name to use if this Dev Service supports overriding it.enabled()Whether this Dev Service should start with the application in dev mode or tests.@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String>The container image name for container-based Dev Service providers.The path to a SQL script to be loaded from the classpath and applied to the Dev Service database.password()The password to use if this Dev Service supports overriding it.port()Optional fixed port the dev service will listen to.Generic properties that are added to the database connection URL.booleanreuse()Whether to keep Dev Service containers running *after a dev mode session or test suite execution* to reuse them in the next dev mode session or test suite execution.username()The username to use if this Dev Service supports overriding it.volumes()The volumes to be mapped to the container.
-
Method Details
-
enabled
Whether this Dev Service should start with the application in dev mode or tests. Dev Services are enabled by default unless connection configuration (e.g. the JDBC URL or reactive client URL) is set explicitly. -
imageName
@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> imageName()The container image name for container-based Dev Service providers.This has no effect if the provider is not a container-based database, such as H2 or Derby.
-
containerEnv
Environment variables that are passed to the container. -
containerProperties
Generic properties that are passed for additional container configuration.Properties defined here are database-specific and are interpreted specifically in each database dev service implementation.
-
properties
Generic properties that are added to the database connection URL. -
port
OptionalInt port()Optional fixed port the dev service will listen to.If not defined, the port will be chosen randomly.
-
command
@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> command()The container start command to use for container-based Dev Service providers.This has no effect if the provider is not a container-based database, such as H2 or Derby.
-
dbName
The database name to use if this Dev Service supports overriding it. -
username
The username to use if this Dev Service supports overriding it. -
password
The password to use if this Dev Service supports overriding it. -
initScriptPath
The path to a SQL script to be loaded from the classpath and applied to the Dev Service database.This has no effect if the provider is not a container-based database, such as H2 or Derby.
-
volumes
The volumes to be mapped to the container.The map key corresponds to the host location; the map value is the container location. If the host location starts with "classpath:", the mapping loads the resource from the classpath with read-only permission.
When using a file system location, the volume will be generated with read-write permission, potentially leading to data loss or modification in your file system.
This has no effect if the provider is not a container-based database, such as H2 or Derby.
-
reuse
@WithDefault("true") boolean reuse()Whether to keep Dev Service containers running *after a dev mode session or test suite execution* to reuse them in the next dev mode session or test suite execution. Within a dev mode session or test suite execution, Quarkus will always reuse Dev Services as long as their configuration (username, password, environment, port bindings, ...) did not change. This feature is specifically about keeping containers running **when Quarkus is not running** to reuse them across runs. WARNING: This feature needs to be enabled explicitly in `testcontainers.properties`, may require changes to how you configure data initialization in dev mode and tests, and may leave containers running indefinitely, forcing you to stop and remove them manually. See xref:databases-dev-services.adoc#reuse[this section of the documentation] for more information. This configuration property is set to `true` by default, so it is mostly useful to *disable* reuse, if you enabled it in `testcontainers.properties` but only want to use it for some of your Quarkus applications or datasources.
-