Class DevServicesConfig


  • public class DevServicesConfig
    extends Object
    • Field Detail

      • enabled

        @ConfigItem(defaultValue="true")
        public boolean enabled
        If DevServices has been explicitly enabled or disabled.

        When DevServices is enabled Quarkus will attempt to automatically configure and start Keycloak when running in Dev or Test mode and when Docker is running.

      • imageName

        @ConfigItem(defaultValue="quay.io/keycloak/keycloak:19.0.3")
        public String imageName
        The container image name to use, for container based DevServices providers. Image with a Quarkus based distribution is used by default. Image with a WildFly based distribution can be selected instead, for example: 'quay.io/keycloak/keycloak:19.0.3-legacy'.

        Note Keycloak Quarkus and Keycloak WildFly images are initialized differently. By default, Dev Services for Keycloak will assume it is a Keycloak Quarkus image if the image version does not end with a '-legacy' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check.

      • keycloakXImage

        @ConfigItem
        public Optional<Boolean> keycloakXImage
        If Keycloak-X image is used. By default, Dev Services for Keycloak will assume a Keycloak-X image is used if the image name contains a 'keycloak-x' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check which may be necessary if you build custom Keycloak-X or Keycloak images. You do not need to set this property if the default check works.
      • shared

        @ConfigItem(defaultValue="true")
        public boolean shared
        Indicates if the Keycloak container managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Keycloak starts a new container.

        The discovery uses the quarkus-dev-service-label label. The value is configured using the service-name property.

        Container sharing is only used in dev mode.

      • serviceName

        @ConfigItem(defaultValue="quarkus")
        public String serviceName
        The value of the quarkus-dev-service-keycloak label attached to the started container. This property is used when shared is set to true. In this case, before starting a container, Dev Services for Keycloak looks for a container with the quarkus-dev-service-keycloak label set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with the quarkus-dev-service-keycloak label set to the specified value.

        Container sharing is only used in dev mode.

      • realmPath

        @ConfigItem
        public Optional<List<String>> realmPath
        The comma-separated list of class or file system paths to Keycloak realm files which will be used to initialize Keycloak. The first value in this list will be used to initialize default tenant connection properties.
      • javaOpts

        @ConfigItem
        public Optional<String> javaOpts
        The JAVA_OPTS passed to the keycloak JVM
      • showLogs

        @ConfigItem(defaultValue="false")
        public boolean showLogs
        Show Keycloak log messages with a "Keycloak:" prefix.
      • startCommand

        @ConfigItem
        public Optional<String> startCommand
        Keycloak start command. Use this property to experiment with Keycloak start options, see {@link https://www.keycloak.org/server/all-config}. Note it will be ignored when loading legacy Keycloak WildFly images.
      • realmName

        @ConfigItem
        public Optional<String> realmName
        The Keycloak realm name. This property will be used to create the realm if the realm file pointed to by the 'realm-path' property does not exist, default value is 'quarkus' in this case. If the realm file pointed to by the 'realm-path' property exists then it is still recommended to set this property for Dev Services for Keycloak to avoid parsing the realm file in order to determine the realm name.
      • createRealm

        @ConfigItem(defaultValue="true")
        public boolean createRealm
        Indicates if the Keycloak realm has to be created when the realm file pointed to by the 'realm-path' property does not exist. Disable it if you'd like to create a realm using Keycloak Administration Console or Keycloak Admin API from io.quarkus.test.common.QuarkusTestResourceLifecycleManager.
      • users

        @ConfigItem
        public Map<String,​String> users
        The Keycloak users map containing the username and password pairs. If this map is empty then two users, 'alice' and 'bob' with the passwords matching their names will be created. This property will be used to create the Keycloak users if the realm file pointed to by the 'realm-path' property does not exist.
      • roles

        @ConfigItem
        public Map<String,​List<String>> roles
        The Keycloak user roles. If this map is empty then a user named 'alice' will get 'admin' and 'user' roles and all other users will get a 'user' role. This property will be used to create the Keycloak roles if the realm file pointed to by the 'realm-path' property does not exist.
      • port

        @ConfigItem
        public OptionalInt port
        Optional fixed port the dev service will listen to.

        If not defined, the port will be chosen randomly.

    • Constructor Detail

      • DevServicesConfig

        public DevServicesConfig()