Interface DevServicesBuildTimeConfig


public interface DevServicesBuildTimeConfig
  • Method Details

    • enabled

      Optional<Boolean> 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

      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

      @ConfigDocMapKey("environment-variable-name") Map<String,String> containerEnv()
      Environment variables that are passed to the container.
    • containerProperties

      @ConfigDocMapKey("property-key") Map<String,String> 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

      @ConfigDocMapKey("property-key") Map<String,String> 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

      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

      Optional<String> dbName()
      The database name to use if this Dev Service supports overriding it.
    • username

      Optional<String> username()
      The username to use if this Dev Service supports overriding it.
    • password

      Optional<String> password()
      The password to use if this Dev Service supports overriding it.
    • initScriptPath

      Optional<String> 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

      @ConfigDocMapKey("host-path") Map<String,String> 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.