diff --git a/quarkus/README.md b/quarkus/README.md index baf9cf4a87b..a3466111d06 100644 --- a/quarkus/README.md +++ b/quarkus/README.md @@ -59,7 +59,16 @@ For development purposes, you can run the server in development mode instead usi This spins up Keycloak using a development database (h2-file) and with insecure HTTP enabled. ### Running from your IDE -Alternatively, you can run the server in development mode from your IDE. For that, run the `org.keycloak.quarkus._private.IDELauncher` main class in the `server` directory. +Alternatively, you can run the server in development mode from your IDE. For that, run the `org.keycloak.Keycloak` main class in the `tests/junit5` directory. + +If you have problems starting the server in debug mode, add following environment variables to your run config: + + -Djava.util.logging.manager=org.jboss.logmanager.LogManager + -Djava.util.concurrent.ForkJoinPool.common.threadFactory=io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory + +Set the `kc.home.dir` environment variable for keeping state between startups: + + -Dkc.home.dir=.kc ## Contributing Please make sure to read our [Contribution Guidelines](../CONTRIBUTING.md) before contributing. diff --git a/quarkus/server/pom.xml b/quarkus/server/pom.xml index f29fbf88429..876875b135a 100644 --- a/quarkus/server/pom.xml +++ b/quarkus/server/pom.xml @@ -33,19 +33,6 @@ com.fasterxml.jackson.core jackson-core - - - - io.quarkus - quarkus-vertx-http-dev-ui-resources - provided - - - - com.oracle.database.jdbc - ojdbc11 - provided - io.mvnpm importmap diff --git a/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java b/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java deleted file mode 100644 index 86d4dcea5a2..00000000000 --- a/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.keycloak.quarkus._private; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; - -import org.keycloak.quarkus.runtime.KeycloakMain; -import org.keycloak.quarkus.runtime.cli.Picocli; - -import io.quarkus.runtime.Quarkus; - -/** - *

This main class should be used to start the server in dev mode for development purposes. By running this class, - * developers should be able to mimic any server behavior and configuration as if they were using the CLI. - * - *

There are some limitations during development such as: - * - *

- * - *

Despite the limitations, it should be possible to debug the extension (e.g.: deployment steps) as well as perform changes at runtime - * without having to restart the JVM. - * - * @author Pedro Igor - */ -public class IDELauncher { - - public static void main(String[] args) { - if (System.getProperty("java.util.logging.manager") == null) { - System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); - } - - if (System.getProperty("picocli.disable.closures") == null) { - System.setProperty("picocli.disable.closures", "true"); - } - - if (System.getProperty("java.util.concurrent.ForkJoinPool.common.threadFactory") == null) { - System.setProperty("java.util.concurrent.ForkJoinPool.common.threadFactory", "io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory"); - } - - List devArgs = new ArrayList<>(Picocli.parseArgs(args)); - - if (System.getProperty("kc.home.dir") == null) { - // direct the auto-created files to the target folder, so they are cleaned by "mvn clean" - // users can still provide a different folder by setting the property when starting it from their IDE. - Path path = Paths.get(System.getProperty("user.dir"), "target", "kc"); - System.setProperty("kc.home.dir", path.toAbsolutePath().toString()); - } - - if (devArgs.isEmpty()) { - devArgs.add("start-dev"); - } - - Quarkus.run(KeycloakMain.class, devArgs.toArray(new String[devArgs.size()])); - } -} diff --git a/quarkus/tests/junit5/src/main/java/org/keycloak/Keycloak.java b/quarkus/tests/junit5/src/main/java/org/keycloak/Keycloak.java index 05ef4570c87..29563eaa517 100644 --- a/quarkus/tests/junit5/src/main/java/org/keycloak/Keycloak.java +++ b/quarkus/tests/junit5/src/main/java/org/keycloak/Keycloak.java @@ -114,6 +114,9 @@ public class Keycloak { } List args = new ArrayList<>(rawArgs); + if (args.isEmpty()) { + args.add("start-dev"); + } addOptionIfNotSet(args, HttpOptions.HTTP_ENABLED, true); addOptionIfNotSet(args, HttpOptions.HTTP_PORT);