From 3780c04ea7c05b38371cf220505e41b42a4e9b90 Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Wed, 23 Jun 2021 02:56:23 +0200 Subject: [PATCH 1/3] Quarkus 1.7.0.Final -> 1.7.6.Final, Gradle support, WildFly version split, CI - Quarkus version - Gradle support - WildFly feature pack update to fix Maven clean install - Gradle upgrade Signed-off-by: Michal Karm Babacek --- .github/workflows/main.yml | 56 ++++--- pom.xml | 7 - .../microprofile/starter/TestMatrixTest.java | 29 +++- .../microprofile/starter/utils/Commands.java | 37 ++++- .../microprofile/starter/utils/Whitelist.java | 9 ++ .../servers/MicroprofileServersAddon.java | 2 +- .../servers/model/JDKSelector.java | 1 + .../servers/model/SupportedServer.java | 4 +- .../servers/server/HelidonServer.java | 4 +- .../servers/server/QuarkusServer.java | 97 +++++------- .../servers/server/WildFlyServer.java | 61 ++++---- .../core/TemplateVariableProvider.java | 11 +- .../starter/core/addon/AddonManager.java | 4 +- .../starter/core/artifacts/GradleCreator.java | 7 +- src/main/resources/files.lst | 3 + .../files/TestSecureController.java.tpl | 5 - .../resources/files/gradle/build.gradle.tpl | 6 +- .../gradle/gradle-wrapper.properties.tpl | 2 +- .../files/gradle/helidon/build.gradle.tpl | 7 +- .../files/gradle/liberty/build.gradle.tpl | 10 +- .../gradle/payara-micro/build.gradle.tpl | 12 +- .../files/gradle/quarkus/build.gradle.tpl | 48 ++++++ .../gradle/quarkus/gradle.properties.tpl | 6 + .../files/gradle/quarkus/settings.gradle.tpl | 11 ++ .../files/quarkus/MetricController.java.tpl | 2 +- .../files/quarkus/application.properties.tpl | 5 + .../files/quarkus/mp3_x/index.html.tpl | 3 +- .../files/quarkus/readme.md.secondary.tpl | 98 +++++++++--- .../resources/files/quarkus/readme.md.tpl | 148 +++++++++++++----- .../service-b/application.properties.tpl | 1 + src/main/resources/files/readme.md.tpl | 56 ++----- src/main/resources/pom-servers.xml | 34 ++-- .../core/TemplateVariableProviderTest.java | 4 +- 33 files changed, 504 insertions(+), 286 deletions(-) create mode 100644 src/main/resources/files/gradle/quarkus/build.gradle.tpl create mode 100644 src/main/resources/files/gradle/quarkus/gradle.properties.tpl create mode 100644 src/main/resources/files/gradle/quarkus/settings.gradle.tpl diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23a23cd7..c07e3dd8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,50 +27,56 @@ on: env: LANG: en_US.UTF-8 - JAVA_HOME: ${{ github.workspace }}/openjdk - + GRADLE_USER_HOME: ~/.gradle + jobs: run-starter: - name: MicroProfile Starter build and test - ${{ matrix.jdk }} - runs-on: ubuntu-18.04 + name: MicroProfile Starter ${{ matrix.runtime }} + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - jdk: ['OpenJDK11-latest-GA'] - include: - - jdk: 'OpenJDK11-latest-GA' - release_type: 'ga' + runtime: [ 'helidon', + 'kumuluzee', + 'liberty', + 'payara', + 'quarkus', + 'thorntail', + 'tomee', + 'wildfly' ] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: fetch-depth: 1 - path: starter - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ runner.os }}-${{ matrix.runtime }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | - ${{ runner.os }}-maven- - - name: Get OpenJDK 11 - run: | - curl -sL https://api.adoptopenjdk.net/v3/binary/latest/11/${{ matrix.release_type }}/linux/x64/jdk/hotspot/normal/openjdk -o jdk.tar.gz - mkdir -p ${JAVA_HOME} - tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1 - echo ${JAVA_HOME} - ${JAVA_HOME}/bin/java --version + ${{ runner.os }}-${{ matrix.runtime }}-maven- + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-${{ matrix.runtime }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.runtime }}-gradle- + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + check-latest: true - name: Build and run tests for Starter run: | - cd ${{ github.workspace }} - export PATH=${JAVA_HOME}/bin:${PATH} - mvn clean verify -Pthorntail + mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* - name: Prepare failure archive (if maven failed) if: failure() shell: bash - run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' -o -name "*.log" | tar -czf test-reports.tgz -T - + run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports.tgz -T - - name: Upload failure Archive (if maven failed) uses: actions/upload-artifact@v2 if: failure() with: name: test-reports path: 'test-reports.tgz' - diff --git a/pom.xml b/pom.xml index 0c541343..654c28f7 100644 --- a/pom.xml +++ b/pom.xml @@ -328,13 +328,6 @@ test - - junit - junit - ${junit.version} - test - - diff --git a/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java b/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java index c480cc19..9fefaf6a 100644 --- a/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java +++ b/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java @@ -48,9 +48,12 @@ import static org.eclipse.microprofile.starter.utils.Commands.cleanWorkspace; import static org.eclipse.microprofile.starter.utils.Commands.download; import static org.eclipse.microprofile.starter.utils.Commands.getWorkspaceDir; +import static org.eclipse.microprofile.starter.utils.Commands.isThisWindows; +import static org.eclipse.microprofile.starter.utils.Commands.linuxCmdCleaner; import static org.eclipse.microprofile.starter.utils.Commands.processStopper; import static org.eclipse.microprofile.starter.utils.Commands.runCommand; import static org.eclipse.microprofile.starter.utils.Commands.unzip; +import static org.eclipse.microprofile.starter.utils.Commands.windowsCmdCleaner; import static org.eclipse.microprofile.starter.utils.Logs.archiveLog; import static org.eclipse.microprofile.starter.utils.Logs.checkLog; import static org.eclipse.microprofile.starter.utils.ReadmeParser.parseReadme; @@ -178,6 +181,13 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection Commands.runCommand(new String[]{"./gradlew", "libertyStop"}, directoryB, runLogB); } } + if (buildTool == BuildTool.GRADLE && supportedServer.equalsIgnoreCase("LIBERTY")) { + if (isThisWindows()) { + windowsCmdCleaner("defaultServer"); + } else { + linuxCmdCleaner("defaultServer"); + } + } checkLog(this.getClass().getCanonicalName(), testName.getMethodName(), "Runtime log", runLogA); if (specSelection.hasServiceB) { @@ -186,11 +196,11 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection LOGGER.info("Gonna wait for ports closed..."); // Release ports assertTrue("Main ports are still open", - Commands.waitForTcpClosed("localhost", Commands.parsePort(urlBase), 60)); + Commands.waitForTcpClosed("localhost", Commands.parsePort(urlBase), 90)); if (additionalPortsToCheck != null) { for (int port : additionalPortsToCheck) { assertTrue("Ports are still open", - Commands.waitForTcpClosed("localhost", port, 30)); + Commands.waitForTcpClosed("localhost", port, 60)); } } } finally { @@ -226,6 +236,10 @@ public void testWebPages(String urlBase, String homePage, String supportedServer } else if (supportedServer.equalsIgnoreCase("WILDFLY")) { // Wildfly has a special port specialUrlBase = urlBase.replace(SupportedServer.WILDFLY.getPortServiceA(), "9990"); + // Pertinent for Q 2.x+, also in index.html + //} else if (supportedServer.equalsIgnoreCase("QUARKUS")) { + // // Quarkus prepends /q + // specialUrlBase = urlBase + "q/"; } else { specialUrlBase = urlBase; } @@ -245,7 +259,7 @@ public void testWebPages(String urlBase, String homePage, String supportedServer testWeb(urlBase + MPSpecGET.METRICS.urlContent[0][0], 5, MPSpecGET.METRICS.urlContent[0][1]); testWeb(specialUrlBase + MPSpecGET.METRICS.urlContent[1][0], 10, MPSpecGET.METRICS.urlContent[1][1]); testWeb(urlBase + MPSpecGET.JWT_AUTH.urlContent[0][0], 5, MPSpecGET.JWT_AUTH.urlContent[0][1]); - if (supportedServer.equalsIgnoreCase("TOMEE")) { + if (supportedServer.equalsIgnoreCase("TOMEE") || supportedServer.equalsIgnoreCase("QUARKUS")) { testWeb(specialUrlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); } else { testWeb(urlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); @@ -260,7 +274,7 @@ public void testWebPages(String urlBase, String homePage, String supportedServer testWeb(specialUrlBase + MPSpecGET.HEALTH_CHECKS.urlContent[0][0], 5, MPSpecGET.HEALTH_CHECKS.urlContent[0][1]); testWeb(urlBase + MPSpecGET.METRICS.urlContent[0][0], 5, MPSpecGET.METRICS.urlContent[0][1]); testWeb(specialUrlBase + MPSpecGET.METRICS.urlContent[1][0], 5, MPSpecGET.METRICS.urlContent[1][1]); - if (supportedServer.equalsIgnoreCase("TOMEE")) { + if (supportedServer.equalsIgnoreCase("TOMEE") || supportedServer.equalsIgnoreCase("QUARKUS")) { testWeb(specialUrlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); } else { testWeb(urlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); @@ -513,6 +527,13 @@ public void quarkusEmpty() throws IOException, InterruptedException { SpecSelection.EMPTY, new int[]{9990}, BuildTool.MAVEN); } + @Test + @RunAsClient + public void quarkusAllGradle() throws IOException, InterruptedException { + testRuntime("QUARKUS", "quarkus", + SpecSelection.ALL, new int[]{9990, 8180, 10090}, BuildTool.GRADLE); + } + @Test @RunAsClient public void quarkusAll() throws IOException, InterruptedException { diff --git a/src/it/java/org/eclipse/microprofile/starter/utils/Commands.java b/src/it/java/org/eclipse/microprofile/starter/utils/Commands.java index aca38b6d..6e25233b 100644 --- a/src/it/java/org/eclipse/microprofile/starter/utils/Commands.java +++ b/src/it/java/org/eclipse/microprofile/starter/utils/Commands.java @@ -42,6 +42,8 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static org.eclipse.microprofile.starter.TestMatrixTest.API_URL; import static org.eclipse.microprofile.starter.TestMatrixTest.TMP; @@ -55,6 +57,8 @@ public class Commands { private static final String STARTER_TS_WORKSPACE = "STARTER_TS_WORKSPACE"; + private static final Pattern LINUX_PS_AUX_PID = Pattern.compile("\\w*\\s*(\\d*).*"); + public static String getWorkspaceDir() { String env = System.getenv().get(STARTER_TS_WORKSPACE); if (StringUtils.isNotBlank(env)) { @@ -197,11 +201,11 @@ public static void processStopper(Process p, String artifactId) throws Interrupt } } - public static void windowsCmdCleaner(String artifactId) throws IOException, InterruptedException { + public static void windowsCmdCleaner(String appName) throws IOException, InterruptedException { List pidsToKill = new ArrayList<>(2); String[] wmicPIDcmd = new String[]{ "wmic", "process", "where", "(", - "commandline", "like", "\"%\\\\" + artifactId + "\\\\%\"", "and", "name", "=", "\"java.exe\"", "and", + "commandline", "like", "\"%\\\\" + appName + "\\\\%\"", "and", "name", "=", "\"java.exe\"", "and", "not", "commandline", "like", "\"%wmic%\"", "and", "not", "commandline", "like", "\"%maven%\"", ")", "get", "Processid", "/format:list"}; @@ -229,6 +233,35 @@ public static void windowsCmdCleaner(String artifactId) throws IOException, Inte pidsToKill.forEach(Commands::pidKiller); } + public static void linuxCmdCleaner(String appName) throws IOException, InterruptedException { + List pidsToKill = new ArrayList<>(2); + ProcessBuilder pbA = new ProcessBuilder("ps", "aux"); + pbA.redirectErrorStream(true); + Process p = pbA.start(); + try (BufferedReader processOutputReader = new BufferedReader(new InputStreamReader(p.getInputStream()))) { + String l; + while ((l = processOutputReader.readLine()) != null) { + if (l.contains(appName)) { + Matcher m = LINUX_PS_AUX_PID.matcher(l); + if (m.lookingAt()) { + try { + pidsToKill.add(Long.parseLong(m.group(1))); + } catch (NumberFormatException ex) { + //Silence is golden. We don't care about ps output glitches. This is a best effort. + } + } + } + } + p.waitFor(); + } + if (pidsToKill.isEmpty()) { + LOGGER.warning("ps didn't find any additional PIDs to kill."); + } else { + LOGGER.info(String.format("ps found %d additional pids to kill", pidsToKill.size())); + } + pidsToKill.forEach(Commands::pidKiller); + } + public static boolean isThisWindows() { return System.getProperty("os.name").matches(".*[Ww]indows.*"); } diff --git a/src/it/java/org/eclipse/microprofile/starter/utils/Whitelist.java b/src/it/java/org/eclipse/microprofile/starter/utils/Whitelist.java index 8fb9e3d5..a2589445 100755 --- a/src/it/java/org/eclipse/microprofile/starter/utils/Whitelist.java +++ b/src/it/java/org/eclipse/microprofile/starter/utils/Whitelist.java @@ -54,11 +54,20 @@ public enum Whitelist { }), TOMEE("tomee", new Pattern[]{}), QUARKUS("quarkus", new Pattern[]{ + Pattern.compile(".*error_prone_annotations.*"), + Pattern.compile(".*error_prone_parent.*"), Pattern.compile(".*\\[org.jboss.threads.errors] Thread Thread\\[build.*"), Pattern.compile(".*org/jboss/threads/EnhancedQueueExecutor.*"), + // If there is nobody to receive traces, there is a log about it. + Pattern.compile(".*io.jaegertracing.internal.exceptions.SenderException.*"), }), WILDFLY("wildfly", new Pattern[]{ + Pattern.compile(".*error_prone_annotations.*"), + Pattern.compile(".*error_prone_parent.*"), Pattern.compile(".*wildfly-domain-http-error-context.*"), + // Known warning, needs WF update + Pattern.compile(".*io/netty/util/internal/logging/Log4J2Logger.*"), + Pattern.compile(".*io.undertow.servlet.handlers.SendErrorPageHandler.*"), }); public final String name; diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java index 4751bc8d..cdd57dd2 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java @@ -59,7 +59,7 @@ public class MicroprofileServersAddon extends AbstractMicroprofileAddon { private List microprofileSpecs; private List microprofileStandaloneSpecs; - private static final String VERTX_JWT_VERSION = "3.9.2"; + public static final String VERTX_JWT_VERSION = "3.9.5"; @PostConstruct public void init() { diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java index 25eafe6b..28f83f26 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java @@ -44,6 +44,7 @@ public void init() { fillJavaSEVersion(data, SupportedServer.THORNTAIL_V2, JavaSEVersion.SE11, MicroProfileVersion.MP22, null); // Supported from MP 2.2 fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE8, null, null); // Supported for all MPVersions + fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported for all MPVersions fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE8, null, null); // Supported for all MPVersions fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported from MP 3.2 diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java index 7e60df4a..af50de0b 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java @@ -54,10 +54,10 @@ public enum SupportedServer { , "8080" //portServiceA , "8180" //portServiceB , "https://quarkus.io/" - , false) // GradleSupport + , true) // GradleSupport , WILDFLY("wildfly", "WildFly", Arrays.asList(MicroProfileVersion.MP32, MicroProfileVersion.MP33, MicroProfileVersion.MP40) - , "%s-wildfly.jar" //jarFileName + , "%s-bootable.jar" //jarFileName , "-Djboss.socket.binding.port-offset=100" //jarParameters , "8080" //portServiceA , "8180" //portServiceB diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java index f147a0c0..0711856b 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java @@ -33,10 +33,10 @@ import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.HashSet; @ApplicationScoped public class HelidonServer extends AbstractMicroprofileAddon { @@ -94,7 +94,7 @@ public void createFiles(JessieModel model) { Set tempAlternative = new HashSet<>(alternatives); tempAlternative.add(JessieModel.SECONDARY_INDICATOR); templateEngine.processTemplateFile(viewDirectory, - "RestApplication.java",variables.get("application") + "RestApplication.java", tempAlternative, variables); + "RestApplication.java", variables.get("application") + "RestApplication.java", tempAlternative, variables); String bResourcesDir = model.getDirectory(false) + "/" + MavenCreator.SRC_MAIN_RESOURCES; String bResourcesMETAINFDir = bResourcesDir + "/META-INF"; diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/QuarkusServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/QuarkusServer.java index c4124975..b93357ba 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/QuarkusServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/QuarkusServer.java @@ -19,10 +19,7 @@ */ package org.eclipse.microprofile.starter.addon.microprofile.servers.server; -import org.apache.maven.model.ActivationProperty; import org.apache.maven.model.Model; -import org.apache.maven.model.Profile; -import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.microprofile.starter.addon.microprofile.servers.AbstractMicroprofileAddon; import org.eclipse.microprofile.starter.addon.microprofile.servers.model.MicroprofileSpec; import org.eclipse.microprofile.starter.addon.microprofile.servers.model.SupportedServer; @@ -31,7 +28,7 @@ import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; -import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -88,70 +85,22 @@ public void createFiles(JessieModel model) { } @Override - public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProject) { - String quarkusVersion = ""; - switch (model.getSpecification().getMicroProfileVersion()) { + public Map defineAdditionalVariables(JessieModel model, boolean mainProject) { + // For customization of the gradle.properties file + Map result = new HashMap<>(); + result.put("quarkus_version", defineQuarkusVersion(model)); + return result; + } - case NONE: - break; - case MP32: - quarkusVersion = "1.7.0.Final"; - break; - case MP30: - break; - case MP22: - break; - case MP21: - break; - case MP20: - break; - case MP14: - break; - case MP13: - break; - case MP12: - break; - default: - } - pomFile.addProperty("version.quarkus", quarkusVersion); + @Override + public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProject) { + pomFile.addProperty("version.quarkus", defineQuarkusVersion(model)); pomFile.setPackaging("jar"); List microprofileSpecs = model.getParameter(JessieModel.Parameter.MICROPROFILESPECS); - Profile nativeProfile = pomFile.getProfiles().get(0).clone(); - nativeProfile.setId("native"); - nativeProfile.getActivation().setActiveByDefault(false); - ActivationProperty activationPropertyNative = new ActivationProperty(); - activationPropertyNative.setName("name"); - activationPropertyNative.setValue("native"); - nativeProfile.getActivation().setProperty(activationPropertyNative); - nativeProfile.getBuild().getPlugins().get(0).getExecutions().get(0).setGoals(Collections.singletonList("native-image")); - - Xpp3Dom configuration = new Xpp3Dom("configuration"); - - Xpp3Dom enableHttpUrlHandler = new Xpp3Dom("enableHttpUrlHandler"); - enableHttpUrlHandler.setValue("true"); - configuration.addChild(enableHttpUrlHandler); - - if (microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH) && mainProject) { - Xpp3Dom additionalBuildArgsLog = new Xpp3Dom("additionalBuildArgs"); - additionalBuildArgsLog.setValue("-H:Log=registerResource:"); - configuration.addChild(additionalBuildArgsLog); - - Xpp3Dom additionalBuildArgsResources = new Xpp3Dom("additionalBuildArgs"); - additionalBuildArgsResources.setValue("-H:IncludeResources=privateKey.pem"); - configuration.addChild(additionalBuildArgsResources); - } - - nativeProfile.getBuild().getPlugins().get(0).setConfiguration(configuration); - - pomFile.addProfile(nativeProfile); - // We add Rest by default as all our examples use it anyway. mavenHelper.addDependency(pomFile, "io.quarkus", "quarkus-resteasy", "${version.quarkus}"); - //if (microprofileSpecs.contains(MicroprofileSpec.CONFIG)) { - // Config is present by default. - //} if (microprofileSpecs.contains(MicroprofileSpec.FAULT_TOLERANCE) && mainProject) { mavenHelper.addDependency(pomFile, "io.quarkus", "quarkus-smallrye-fault-tolerance", "${version.quarkus}"); } @@ -175,4 +124,30 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec } } + private String defineQuarkusVersion(JessieModel model) { + switch (model.getSpecification().getMicroProfileVersion()) { + case NONE: + break; + case MP40: + break; + case MP33: + break; + case MP32: + return "1.7.6.Final"; + case MP22: + break; + case MP21: + break; + case MP20: + break; + case MP14: + break; + case MP13: + break; + case MP12: + break; + default: + } + return null; + } } diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/WildFlyServer.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/WildFlyServer.java index 64add263..b42943d7 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/WildFlyServer.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/WildFlyServer.java @@ -82,37 +82,7 @@ public void createFiles(JessieModel model) { @Override public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProject) { - String wildflyVersion = ""; - switch (model.getSpecification().getMicroProfileVersion()) { - - case NONE: - break; - case MP40: - wildflyVersion = "23.0.0.Final"; - break; - case MP33: - wildflyVersion = "19.1.0.Final"; - break; - case MP32: - wildflyVersion = "19.0.0.Final"; - break; - case MP30: - break; - case MP22: - break; - case MP21: - break; - case MP20: - break; - case MP14: - break; - case MP13: - break; - case MP12: - break; - default: - } - pomFile.addProperty("version.wildfly", wildflyVersion); + pomFile.addProperty("version.wildfly", defineWildFlyVersion(model)); List microprofileSpecs = model.getParameter(JessieModel.Parameter.MICROPROFILESPECS); Xpp3Dom configuration = (Xpp3Dom) pomFile.getProfiles().get(0).getBuild().getPlugins() .get(0).getConfiguration(); @@ -158,7 +128,7 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec layer.setValue("open-tracing"); layers.addChild(layer); } - if((microprofileSpecs.contains(MicroprofileSpec.REST_CLIENT) || + if ((microprofileSpecs.contains(MicroprofileSpec.REST_CLIENT) || microprofileSpecs.contains(MicroprofileSpec.JWT_AUTH)) && mainProject && !microprofileSpecs.contains(MicroprofileSpec.CONFIG)) { layer = new Xpp3Dom("layer"); @@ -167,4 +137,31 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec } configuration.addChild(layers); } + + private String defineWildFlyVersion(JessieModel model) { + switch (model.getSpecification().getMicroProfileVersion()) { + case NONE: + break; + case MP40: + return "23.0.2.Final"; + case MP33: + return "20.0.0.Final"; + case MP32: + return "20.0.0.Final"; + case MP22: + break; + case MP21: + break; + case MP20: + break; + case MP14: + break; + case MP13: + break; + case MP12: + break; + default: + } + return null; + } } diff --git a/src/main/java/org/eclipse/microprofile/starter/core/TemplateVariableProvider.java b/src/main/java/org/eclipse/microprofile/starter/core/TemplateVariableProvider.java index af0236db..59018ad0 100755 --- a/src/main/java/org/eclipse/microprofile/starter/core/TemplateVariableProvider.java +++ b/src/main/java/org/eclipse/microprofile/starter/core/TemplateVariableProvider.java @@ -23,6 +23,7 @@ package org.eclipse.microprofile.starter.core; import org.apache.commons.lang3.StringUtils; +import org.eclipse.microprofile.starter.core.model.BuildTool; import org.eclipse.microprofile.starter.core.model.JavaSEVersion; import org.eclipse.microprofile.starter.core.model.JessieModel; @@ -53,8 +54,14 @@ public Map determineVariables(JessieModel model) { result.put("secondary_project", model.hasMainAndSecondaryProject() ? "true" : "false"); JavaSEVersion seVersion = model.getSpecification().getJavaSEVersion(); - result.put("se_version", seVersion.getCode()); + if (model.getSpecification().getBuildTool() == BuildTool.GRADLE) { + // Gradle: + // Good: sourceCompatibility = JavaVersion.VERSION_1_8 + // No-good: sourceCompatibility = JavaVersion.VERSION_1.8 + result.put("se_version", seVersion.getCode().replace(".", "_")); + } else { + result.put("se_version", seVersion.getCode()); + } return result; - } } diff --git a/src/main/java/org/eclipse/microprofile/starter/core/addon/AddonManager.java b/src/main/java/org/eclipse/microprofile/starter/core/addon/AddonManager.java index 66121c4d..39288525 100755 --- a/src/main/java/org/eclipse/microprofile/starter/core/addon/AddonManager.java +++ b/src/main/java/org/eclipse/microprofile/starter/core/addon/AddonManager.java @@ -79,8 +79,8 @@ public List getMavenAdapters() { public List getGradleAdapters() { - Iterator mavenAdapterIterator = gradleAdapters.iterator(); - return getProviders(mavenAdapterIterator); + Iterator gradleAdapterIterator = gradleAdapters.iterator(); + return getProviders(gradleAdapterIterator); } private List getProviders(Iterator alternativesIterator) { diff --git a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/GradleCreator.java b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/GradleCreator.java index b1a85553..e4badf3f 100755 --- a/src/main/java/org/eclipse/microprofile/starter/core/artifacts/GradleCreator.java +++ b/src/main/java/org/eclipse/microprofile/starter/core/artifacts/GradleCreator.java @@ -22,6 +22,7 @@ */ package org.eclipse.microprofile.starter.core.artifacts; +import org.eclipse.microprofile.starter.addon.microprofile.servers.model.MicroprofileSpec; import org.eclipse.microprofile.starter.core.addon.AddonManager; import org.eclipse.microprofile.starter.core.model.JessieModel; import org.eclipse.microprofile.starter.spi.JessieAddon; @@ -35,6 +36,7 @@ import java.util.Map; import java.util.Set; +import static org.eclipse.microprofile.starter.addon.microprofile.servers.MicroprofileServersAddon.VERTX_JWT_VERSION; import static org.eclipse.microprofile.starter.core.model.JessieModel.MAIN_INDICATOR; /** @@ -65,7 +67,6 @@ protected void createDefaultDirectories(JessieModel model, boolean mainProject) alternatives.add("gradle"); // So that files can be placed in a separate directory if (!mainProject) { - alternatives.add(JessieModel.SECONDARY_INDICATOR); } @@ -87,7 +88,11 @@ protected void createDefaultDirectories(JessieModel model, boolean mainProject) } else { variables.put("mainProject", "false"); } + if (variables.containsKey("mp_" + MicroprofileSpec.JWT_AUTH.getCode())) { + variables.put("vertx_auth_jwt_version", VERTX_JWT_VERSION); + } templateEngine.processTemplateFile(rootDirectory, "build.gradle", alternatives, variables); + templateEngine.processTemplateFile(rootDirectory, "gradle.properties", alternatives, variables); templateEngine.processTemplateFile(rootDirectory, "settings.gradle", alternatives, variables); } diff --git a/src/main/resources/files.lst b/src/main/resources/files.lst index 13ee92ef..b22c3f2f 100644 --- a/src/main/resources/files.lst +++ b/src/main/resources/files.lst @@ -13,6 +13,9 @@ src/main/resources/files/gradle/gradlew.tpl src/main/resources/files/gradle/helidon/build.gradle.tpl src/main/resources/files/gradle/liberty/build.gradle.tpl src/main/resources/files/gradle/payara-micro/build.gradle.tpl +src/main/resources/files/gradle/quarkus/build.gradle.tpl +src/main/resources/files/gradle/quarkus/gradle.properties.tpl +src/main/resources/files/gradle/quarkus/settings.gradle.tpl src/main/resources/files/gradle/settings.gradle.tpl src/main/resources/files/helidon/logging.properties.tpl src/main/resources/files/helidon/microprofile-config.properties.tpl diff --git a/src/main/resources/files/TestSecureController.java.tpl b/src/main/resources/files/TestSecureController.java.tpl index 2502cc0b..83a5b399 100644 --- a/src/main/resources/files/TestSecureController.java.tpl +++ b/src/main/resources/files/TestSecureController.java.tpl @@ -38,7 +38,6 @@ public class TestSecureController { throw new WebApplicationException("Unable to read privateKey.pem", 500); } String jwt = generateJWT(key); - // any method to send a REST request with an appropriate header will work of course. WebTarget target = ClientBuilder.newClient().target("http://localhost:[# th:text="${port_service_b}"/]/data/protected"); Response response = target.request().header("authorization", "Bearer " + jwt).buildGet().invoke(); return String.format("Claim value within JWT of 'custom-value' : %s", response.readEntity(String.class)); @@ -55,15 +54,11 @@ public class TestSecureController { token.setAud("targetService"); token.setIss("https://server.example.com"); // Must match the expected issues configuration values token.setJti(UUID.randomUUID().toString()); - token.setSub("Jessie"); // Sub is required for WildFly Swarm token.setUpn("Jessie"); - token.setIat(System.currentTimeMillis()); token.setExp(System.currentTimeMillis() + 30000); // 30 Seconds expiration! - token.addAdditionalClaims("custom-value", "Jessie specific value"); - token.setGroups(Arrays.asList("user", "protected")); return provider.generateToken(new io.vertx.core.json.JsonObject().mergeIn(token.toJSONString()), new JWTOptions().setAlgorithm("RS256")); diff --git a/src/main/resources/files/gradle/build.gradle.tpl b/src/main/resources/files/gradle/build.gradle.tpl index c82353cc..6996530e 100644 --- a/src/main/resources/files/gradle/build.gradle.tpl +++ b/src/main/resources/files/gradle/build.gradle.tpl @@ -3,8 +3,8 @@ apply plugin: 'war' group = '[# th:text="${maven_groupid}"/]' version = '1.0-SNAPSHOT' -sourceCompatibility = [# th:text="${se_version}"/] -targetCompatibility = [# th:text="${se_version}"/] +sourceCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] +targetCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] tasks.withType(JavaCompile) { options.encoding = 'UTF-8' @@ -17,7 +17,7 @@ repositories { dependencies { providedCompile 'org.eclipse.microprofile:microprofile:[# th:text="${mp_depversion}"/]' [# th:if="${mainProject and mp_JWT_auth}"] - implementation 'io.vertx:vertx-auth-jwt:3.9.2' + implementation 'io.vertx:vertx-auth-jwt:[# th:text="${vertx_auth_jwt_version}"/]' [/] [# th:if="${mainProject and mp_graphql}"] providedCompile 'org.eclipse.microprofile.graphql:microprofile-graphql-api:1.0.2' diff --git a/src/main/resources/files/gradle/gradle-wrapper.properties.tpl b/src/main/resources/files/gradle/gradle-wrapper.properties.tpl index 44e7c4d1..442d9132 100644 --- a/src/main/resources/files/gradle/gradle-wrapper.properties.tpl +++ b/src/main/resources/files/gradle/gradle-wrapper.properties.tpl @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/resources/files/gradle/helidon/build.gradle.tpl b/src/main/resources/files/gradle/helidon/build.gradle.tpl index 737413de..f9c4f05c 100644 --- a/src/main/resources/files/gradle/helidon/build.gradle.tpl +++ b/src/main/resources/files/gradle/helidon/build.gradle.tpl @@ -8,8 +8,8 @@ version = '1.0-SNAPSHOT' description = "MicroProfile Starter example" -sourceCompatibility = [# th:text="${se_version}"/] -targetCompatibility = [# th:text="${se_version}"/] +sourceCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] +targetCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] tasks.withType(JavaCompile) { options.encoding = 'UTF-8' @@ -34,8 +34,7 @@ dependencies { runtimeOnly 'org.jboss:jandex' runtimeOnly 'jakarta.activation:jakarta.activation-api' [# th:if="${mainProject and mp_JWT_auth}"] - implementation 'io.vertx:vertx-auth-jwt:3.9.2' - [/] + implementation 'io.vertx:vertx-auth-jwt:[# th:text="${vertx_auth_jwt_version}"/]'[/] } // define a custom task to copy all dependencies in the runtime classpath diff --git a/src/main/resources/files/gradle/liberty/build.gradle.tpl b/src/main/resources/files/gradle/liberty/build.gradle.tpl index f98b2064..67f577bd 100644 --- a/src/main/resources/files/gradle/liberty/build.gradle.tpl +++ b/src/main/resources/files/gradle/liberty/build.gradle.tpl @@ -7,8 +7,8 @@ version = '1.0-SNAPSHOT' description = "MicroProfile Starter example" -sourceCompatibility = [# th:text="${se_version}"/] -targetCompatibility = [# th:text="${se_version}"/] +sourceCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] +targetCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] tasks.withType(JavaCompile) { options.encoding = 'UTF-8' @@ -35,11 +35,9 @@ repositories { dependencies { providedCompile 'org.eclipse.microprofile:microprofile:[# th:text="${mp_depversion}"/]' [# th:if="${mainProject and mp_JWT_auth}"] - implementation 'io.vertx:vertx-auth-jwt:3.9.2' - [/] + implementation 'io.vertx:vertx-auth-jwt:[# th:text="${vertx_auth_jwt_version}"/]'[/] [# th:if="${mainProject and mp_graphql}"] - providedCompile 'org.eclipse.microprofile.graphql:microprofile-graphql-api:1.0.2' - [/] + providedCompile 'org.eclipse.microprofile.graphql:microprofile-graphql-api:1.0.2'[/] } ext { diff --git a/src/main/resources/files/gradle/payara-micro/build.gradle.tpl b/src/main/resources/files/gradle/payara-micro/build.gradle.tpl index 195a7482..deaa15a6 100644 --- a/src/main/resources/files/gradle/payara-micro/build.gradle.tpl +++ b/src/main/resources/files/gradle/payara-micro/build.gradle.tpl @@ -7,8 +7,8 @@ version = '1.0-SNAPSHOT' description = "MicroProfile Starter example" -sourceCompatibility = [# th:text="${se_version}"/] -targetCompatibility = [# th:text="${se_version}"/] +sourceCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] +targetCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] payaraMicro { payaraVersion = '[# th:text="${payara_version}"/]' @@ -21,13 +21,11 @@ payaraMicro { dependencies { providedCompile 'org.eclipse.microprofile:microprofile:[# th:text="${mp_depversion}"/]' [# th:if="${mainProject and mp_JWT_auth}"] - implementation 'io.vertx:vertx-auth-jwt:3.9.2' - [/] + implementation 'io.vertx:vertx-auth-jwt:[# th:text="${vertx_auth_jwt_version}"/]'[/] [# th:if="${mainProject and mp_graphql}"] - providedCompile 'org.eclipse.microprofile.graphql:microprofile-graphql-api:1.0.2' - [/] + providedCompile 'org.eclipse.microprofile.graphql:microprofile-graphql-api:1.0.2'[/] } repositories { mavenCentral() -} \ No newline at end of file +} diff --git a/src/main/resources/files/gradle/quarkus/build.gradle.tpl b/src/main/resources/files/gradle/quarkus/build.gradle.tpl new file mode 100644 index 00000000..84542c06 --- /dev/null +++ b/src/main/resources/files/gradle/quarkus/build.gradle.tpl @@ -0,0 +1,48 @@ +plugins { + id 'java' + id 'io.quarkus' +} + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") + implementation 'io.quarkus:quarkus-arc' + implementation 'io.quarkus:quarkus-resteasy' + [# th:if="${mainProject and mp_fault_tolerance}"] + implementation 'io.quarkus:quarkus-smallrye-fault-tolerance'[/] + [# th:if="${mp_JWT_auth}"] + implementation 'io.quarkus:quarkus-smallrye-jwt'[/] + [# th:if="${mainProject and mp_metrics}"] + implementation 'io.quarkus:quarkus-smallrye-metrics'[/] + [# th:if="${mainProject and mp_health_checks}"] + implementation 'io.quarkus:quarkus-smallrye-health'[/] + [# th:if="${mainProject and mp_open_API}"] + implementation 'io.quarkus:quarkus-smallrye-openapi'[/] + [# th:if="${mp_open_tracing}"] + implementation 'io.quarkus:quarkus-smallrye-opentracing'[/] + [# th:if="${mainProject and (mp_rest_client or mp_JWT_auth)}"] + implementation 'io.quarkus:quarkus-rest-client'[/] + [# th:if="${mainProject and mp_JWT_auth}"] + implementation 'io.vertx:vertx-auth-jwt:[# th:text="${vertx_auth_jwt_version}"/]'[/] +} + +group '[# th:text="${maven_groupid}"/]' +description = "MicroProfile Starter example" + +java { + sourceCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] + targetCompatibility = JavaVersion.VERSION_[# th:text="${se_version}"/] +} + +compileJava { + options.encoding = 'UTF-8' + options.compilerArgs << '-parameters' +} + +compileTestJava { + options.encoding = 'UTF-8' +} diff --git a/src/main/resources/files/gradle/quarkus/gradle.properties.tpl b/src/main/resources/files/gradle/quarkus/gradle.properties.tpl new file mode 100644 index 00000000..9da6b4d0 --- /dev/null +++ b/src/main/resources/files/gradle/quarkus/gradle.properties.tpl @@ -0,0 +1,6 @@ +#Gradle properties +quarkusPluginId=io.quarkus +quarkusPluginVersion=[# th:text="${quarkus_version}"/] +quarkusPlatformGroupId=io.quarkus +quarkusPlatformArtifactId=quarkus-bom +quarkusPlatformVersion=[# th:text="${quarkus_version}"/] diff --git a/src/main/resources/files/gradle/quarkus/settings.gradle.tpl b/src/main/resources/files/gradle/quarkus/settings.gradle.tpl new file mode 100644 index 00000000..d05c801a --- /dev/null +++ b/src/main/resources/files/gradle/quarkus/settings.gradle.tpl @@ -0,0 +1,11 @@ +pluginManagement { + repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() + } + plugins { + id "${quarkusPluginId}" version "${quarkusPluginVersion}" + } +} +rootProject.name = '[# th:text="${maven_artifactid}"/]' diff --git a/src/main/resources/files/quarkus/MetricController.java.tpl b/src/main/resources/files/quarkus/MetricController.java.tpl index 969ddf1c..03f87582 100755 --- a/src/main/resources/files/quarkus/MetricController.java.tpl +++ b/src/main/resources/files/quarkus/MetricController.java.tpl @@ -48,7 +48,7 @@ public class MetricController { } @Gauge(name = "counter_gauge", unit = MetricUnits.NONE) - private long getCustomerCount() { + long getCustomerCount() { return counter.getCount(); } } diff --git a/src/main/resources/files/quarkus/application.properties.tpl b/src/main/resources/files/quarkus/application.properties.tpl index 409fcebd..a6691982 100644 --- a/src/main/resources/files/quarkus/application.properties.tpl +++ b/src/main/resources/files/quarkus/application.properties.tpl @@ -1,5 +1,6 @@ injected.value=Injected value value=lookup value +quarkus.package.output-name=[# th:text="${maven_artifactid}"/] [# th:if="${mp_rest_client}"] [# th:text="${java_package}"/].client.Service/mp-rest/url=http://localhost:[# th:text="${port_service_b}"/]/data/client/service [/] @@ -13,3 +14,7 @@ quarkus.jaeger.sampler-type=const quarkus.jaeger.sampler-param=1 quarkus.jaeger.endpoint=http://localhost:14268/api/traces [/] +[# th:if="${mp_JWT_auth}"] +# These options are needed only if you build your project into a native executable. +quarkus.native.additional-build-args=-H:Log=registerResource:,-H:IncludeResources=privateKey.pem,--initialize-at-run-time=io.vertx.ext.auth.impl.jose.JWT +[/] diff --git a/src/main/resources/files/quarkus/mp3_x/index.html.tpl b/src/main/resources/files/quarkus/mp3_x/index.html.tpl index f638902d..223947ce 100755 --- a/src/main/resources/files/quarkus/mp3_x/index.html.tpl +++ b/src/main/resources/files/quarkus/mp3_x/index.html.tpl @@ -45,7 +45,8 @@ [# th:if="${mp_open_tracing}"]

Open Tracing

-If you have
./jaeger-all-in-one
running, open http://localhost:16686 +If you have
./jaeger-all-in-one
running, open http://localhost:16686.
+You can download Jaeger to try the tracing capability. [/] [# th:if="${mp_rest_client}"] diff --git a/src/main/resources/files/quarkus/readme.md.secondary.tpl b/src/main/resources/files/quarkus/readme.md.secondary.tpl index f683aa17..cc0b6b04 100755 --- a/src/main/resources/files/quarkus/readme.md.secondary.tpl +++ b/src/main/resources/files/quarkus/readme.md.secondary.tpl @@ -3,33 +3,97 @@ ## Introduction MicroProfile Starter has generated this MicroProfile application for you containing some endpoints which are called from the main application (see the `service-a` directory) +[# th:if="${build_tool} == 'GRADLE'"] +This project uses Quarkus, the Supersonic Subatomic Java Framework. -The generation of the executable jar file can be performed by issuing the following command +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . - mvn clean compile package +## Packaging and running the application -This will create a jar file **[# th:text="${jar_file}"/]** within the _target_ maven folder. This can be started by executing the following command +If you want to build an _über-jar_, execute the following command: + + ./gradlew build -Dquarkus.package.type=uber-jar + +To run the application: + + java [# th:text="${jar_parameters}"/] -jar build/[# th:text="${jar_file}"/] + +The application can be also packaged using simple: + + ./gradlew build + +It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory. +Be aware that it is not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory. + +## Creating a native executable + +Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation. + +You can create a native executable using: + + ./gradlew build -Dquarkus.package.type=native + +Or, if you don't have [Mandrel](https://github.com/graalvm/mandrel/releases/) or +[GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases) installed, you can run the native executable +build in a container using: + + ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true + +Or to use Mandrel distribution: + + ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11 + +You can then execute your native executable with: + + ./build/[# th:text="${jar_file_no_suffix}"/] [# th:text="${jar_parameters}"/] + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image. +[/][# th:if="${build_tool} == 'MAVEN'"] +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Packaging and running the application + +If you want to build an _über-jar_, execute the following command: + + mvn package -Dquarkus.package.type=uber-jar + +To run the application: java [# th:text="${jar_parameters}"/] -jar target/[# th:text="${jar_file}"/] -You can also start the project in development mode where it automatically updates code on the fly as you save your files: +The application can be also packaged using simple: - mvn [# th:text="${jar_parameters}"/] clean compile quarkus:dev + mvn package -Last but not least, you can build the whole application into a one statically linked executable that does not require JVM: +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it is not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. - mvn clean compile package -Pnative +## Creating a native executable -Native executable build might take a minute. Then you can execute it on a compatible architecture without JVM: +Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation. - ./target/[# th:text="${jar_file_no_suffix}"/] [# th:text="${jar_parameters}"/] +You can create a native executable using: + + mvn package -Dquarkus.package.type=native + +Or, if you don't have [Mandrel](https://github.com/graalvm/mandrel/releases/) or +[GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases) installed, you can run the native executable +build in a container using: + + mvn package -Dquarkus.package.type=native -Dquarkus.native.container-build=true + +Or to use Mandrel distribution: -## Note on Native image + mvn package -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11 - * You need GraalVM installed from the GraalVM web site. Using the community edition is enough. Version 19.1.1+ is required. - * The GRAALVM_HOME environment variable configured appropriately - * The native-image tool must be installed; this can be done by running ```gu install native-image``` from your GraalVM directory +You can then execute your native executable with: + ./target/[# th:text="${jar_file_no_suffix}"/] [# th:text="${jar_parameters}"/] + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image. +[/] ## Specification examples [# th:if="${mp_JWT_auth}"] @@ -40,14 +104,8 @@ The **ProtectedController** contains the protected endpoint since it contains th The _TestSecureController_ code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs. - -[/] - -[# th:if="${mp_rest_client}"] +[/][# th:if="${mp_rest_client}"] ### Rest Client - A type safe invocation of HTTP rest endpoints. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) - The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean. - [/] \ No newline at end of file diff --git a/src/main/resources/files/quarkus/readme.md.tpl b/src/main/resources/files/quarkus/readme.md.tpl index 148481bf..03b64109 100755 --- a/src/main/resources/files/quarkus/readme.md.tpl +++ b/src/main/resources/files/quarkus/readme.md.tpl @@ -3,38 +3,121 @@ ## Introduction MicroProfile Starter has generated this MicroProfile application for you. +[# th:if="${build_tool} == 'GRADLE'"] +This project uses Quarkus, the Supersonic Subatomic Java Framework. -The generation of the executable jar file can be performed by issuing the following command +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . - mvn clean compile package +## Packaging and running the application -This will create a jar file **[# th:text="${jar_file}"/]** within the _target_ maven folder. This can be started by executing the following command +If you want to build an _über-jar_, execute the following command: - java -jar target/[# th:text="${jar_file}"/] + ./gradlew build -Dquarkus.package.type=uber-jar -You can also start the project in development mode where it automatically updates code on the fly as you save your files: +To run the application: - mvn clean compile quarkus:dev + java -jar build/[# th:text="${jar_file}"/] -Last but not least, you can build the whole application into a one statically linked executable that does not require JVM: +The application can be also packaged using simple: - mvn clean compile package -Pnative + ./gradlew build -Native executable build might take a minute. Then you can execute it on a compatible architecture without JVM: +It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory. +Be aware that it is not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory. - ./target/[# th:text="${jar_file_no_suffix}"/] +To launch the test page, open your browser at the following URL + + http://localhost:[# th:text="${port_service_a}"/]/index.html + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: + + ./gradlew quarkusDev + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/. + +## Creating a native executable + +Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation. + +You can create a native executable using: + + ./gradlew build -Dquarkus.package.type=native + +Or, if you don't have [Mandrel](https://github.com/graalvm/mandrel/releases/) or +[GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases) installed, you can run the native executable +build in a container using: + + ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true + +Or to use Mandrel distribution: + + ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11 + +You can then execute your native executable with: + + ./build/[# th:text="${jar_file_no_suffix}"/] + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image. +[/][# th:if="${build_tool} == 'MAVEN'"] +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Packaging and running the application + +If you want to build an _über-jar_, execute the following command: + + mvn package -Dquarkus.package.type=uber-jar + +To run the application: + + java -jar target/[# th:text="${jar_file}"/] + +The application can be also packaged using simple: + + mvn package + +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it is not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. To launch the test page, open your browser at the following URL http://localhost:[# th:text="${port_service_a}"/]/index.html -## Note on Native image +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: - * You need GraalVM installed from the GraalVM web site. Using the community edition is enough. Version 19.1.1+ is required. - * The GRAALVM_HOME environment variable configured appropriately - * The native-image tool must be installed; this can be done by running ```gu install native-image``` from your GraalVM directory - * To read more about Quarkus and Native image, see https://quarkus.io/guides/building-native-image-guide + mvn compile quarkus:dev +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/. + +## Creating a native executable + +Mind having GRAALVM_HOME set to your Mandrel or GraalVM installation. + +You can create a native executable using: + + mvn package -Dquarkus.package.type=native + +Or, if you don't have [Mandrel](https://github.com/graalvm/mandrel/releases/) or +[GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases) installed, you can run the native executable +build in a container using: + + mvn package -Dquarkus.package.type=native -Dquarkus.native.container-build=true + +Or to use Mandrel distribution: + + mvn package -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11 + +You can then execute your native executable with: + + ./target/[# th:text="${jar_file_no_suffix}"/] + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image. +[/] ## Specification examples By default, there is always the creation of a JAX-RS application class to define the path on which the JAX-RS endpoints are available. @@ -42,40 +125,31 @@ By default, there is always the creation of a JAX-RS application class to define Also, a simple Hello world endpoint is created, have a look at the class **HelloController**. More information on MicroProfile can be found [here](https://microprofile.io/) - [# th:if="${mp_config}"] ### Config Configuration of your application parameters. Specification [here](https://microprofile.io/project/eclipse/microprofile-config) The example class **ConfigTestController** shows you how to inject a configuration parameter and how you can retrieve it programmatically. -[/] - -[# th:if="${mp_fault_tolerance}"] +[/][# th:if="${mp_fault_tolerance}"] ### Fault tolerance Add resilient features to your applications like TimeOut, RetryPolicy, Fallback, bulkhead and circuit breaker. Specification [here](https://microprofile.io/project/eclipse/microprofile-fault-tolerance) The example class **ResilienceController** has an example of a FallBack mechanism where an fallback result is returned when the execution takes too long. -[/] - -[# th:if="${mp_health_checks}"] +[/][# th:if="${mp_health_checks}"] ### Health The health status can be used to determine if the 'computing node' needs to be discarded/restarted or not. Specification [here](https://microprofile.io/project/eclipse/microprofile-health) The class **ServiceHealthCheck** contains an example of a custom check which can be integrated to health status checks of the instance. The index page contains a link to the status data. -[/] - -[# th:if="${mp_metrics}"] +[/][# th:if="${mp_metrics}"] ### Metrics The Metrics exports _Telemetric_ data in a uniform way of system and custom resources. Specification [here](https://microprofile.io/project/eclipse/microprofile-metrics) The example class **MetricController** contains an example how you can measure the execution time of a request. The index page also contains a link to the metric page (with all metric info) -[/] - -[# th:if="${mp_JWT_auth}"] +[/][# th:if="${mp_JWT_auth}"] ### JWT Auth Using the OpenId Connect JWT token to pass authentication and authorization information to the JAX-RS endpoint. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) @@ -85,32 +159,22 @@ The **ProtectedController** (secondary application) contains the protected endpo The _TestSecureController_ code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs. -[/] - -[# th:if="${mp_open_API}"] +[/][# th:if="${mp_open_API}"] ### Open API Exposes the information about your endpoints in the format of the OpenAPI v3 specification. Specification [here](https://microprofile.io/project/eclipse/microprofile-open-api) The index page contains a link to the OpenAPI information of your endpoints. - -[/] - -[# th:if="${mp_open_tracing}"] +[/][# th:if="${mp_open_tracing}"] ### Open Tracing Allow the participation in distributed tracing of your requests through various micro services. Specification [here](https://microprofile.io/project/eclipse/microprofile-opentracing) To show this capability download [Jaeger](https://www.jaegertracing.io/download/#binaries) and run ```./jaeger-all-in-one```. Open [http://localhost:16686/](http://localhost:16686/) to see the traces. Mind that you have to access your demo app endpoint for any traces to show on Jaeger UI. - -[/] - -[# th:if="${mp_rest_client}"] +[/][# th:if="${mp_rest_client}"] ### Rest Client A type safe invocation of HTTP rest endpoints. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) -The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean. - -[/] \ No newline at end of file +The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean.[/] diff --git a/src/main/resources/files/quarkus/service-b/application.properties.tpl b/src/main/resources/files/quarkus/service-b/application.properties.tpl index ac4ee94d..6c22b9e5 100644 --- a/src/main/resources/files/quarkus/service-b/application.properties.tpl +++ b/src/main/resources/files/quarkus/service-b/application.properties.tpl @@ -1,4 +1,5 @@ quarkus.ssl.native=true +quarkus.package.output-name=[# th:text="${maven_artifactid}"/] [# th:if="${mp_JWT_auth}"] mp.jwt.verify.publickey.location=META-INF/resources/publicKey.pem mp.jwt.verify.issuer=https://server.example.com diff --git a/src/main/resources/files/readme.md.tpl b/src/main/resources/files/readme.md.tpl index 2922c6e5..d95613ab 100755 --- a/src/main/resources/files/readme.md.tpl +++ b/src/main/resources/files/readme.md.tpl @@ -13,15 +13,12 @@ This will create an executable jar file **[# th:text="${jar_file}"/]** within th java -jar target/[# th:text="${jar_file}"/] -[/] -[# th:if="${build_tool} == 'GRADLE'"] +[/][# th:if="${build_tool} == 'GRADLE'"] [# th:if="${mp_servername} == 'payara-micro'"] ./gradlew microBundle -[/] -[# th:if="${mp_servername} == 'liberty'"] +[/][# th:if="${mp_servername} == 'liberty'"] ./gradlew libertyPackage -[/] -[# th:if="${mp_servername} == 'helidon'"] +[/][# th:if="${mp_servername} == 'helidon'"] ./gradlew assemble [/] @@ -29,15 +26,11 @@ This will create an executable jar file **[# th:text="${jar_file}"/]** within th [# th:if="${mp_servername} == 'payara-micro'"] ./gradlew microStart -[/] -[# th:if="${mp_servername} == 'liberty'"] +[/][# th:if="${mp_servername} == 'liberty'"] ./gradlew libertyRun --no-daemon -[/] -[# th:if="${mp_servername} == 'helidon'"] +[/][# th:if="${mp_servername} == 'helidon'"] java -jar build/libs/[# th:text="${jar_file}"/] -[/] -[/] - +[/][/] [# th:if="${mp_servername} == 'liberty'"] ### Liberty Dev Mode @@ -82,33 +75,25 @@ More information on MicroProfile can be found [here](https://microprofile.io/) Configuration of your application parameters. Specification [here](https://microprofile.io/project/eclipse/microprofile-config) The example class **ConfigTestController** shows you how to inject a configuration parameter and how you can retrieve it programmatically. -[/] - -[# th:if="${mp_fault_tolerance}"] +[/][# th:if="${mp_fault_tolerance}"] ### Fault tolerance Add resilient features to your applications like TimeOut, RetryPolicy, Fallback, bulkhead and circuit breaker. Specification [here](https://microprofile.io/project/eclipse/microprofile-fault-tolerance) The example class **ResilienceController** has an example of a FallBack mechanism where an fallback result is returned when the execution takes too long. -[/] - -[# th:if="${mp_health_checks}"] +[/][# th:if="${mp_health_checks}"] ### Health The health status can be used to determine if the 'computing node' needs to be discarded/restarted or not. Specification [here](https://microprofile.io/project/eclipse/microprofile-health) The class **ServiceHealthCheck** contains an example of a custom check which can be integrated to health status checks of the instance. The index page contains a link to the status data. -[/] - -[# th:if="${mp_metrics}"] +[/][# th:if="${mp_metrics}"] ### Metrics The Metrics exports _Telemetric_ data in a uniform way of system and custom resources. Specification [here](https://microprofile.io/project/eclipse/microprofile-metrics) The example class **MetricController** contains an example how you can measure the execution time of a request. The index page also contains a link to the metric page (with all metric info) -[/] - -[# th:if="${mp_JWT_auth}"] +[/][# th:if="${mp_JWT_auth}"] ### JWT Auth Using the OpenId Connect JWT token to pass authentication and authorization information to the JAX-RS endpoint. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) @@ -118,18 +103,13 @@ The **ProtectedController** (secondary application) contains the protected endpo The _TestSecureController_ code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs. -[/] - -[# th:if="${mp_open_API}"] +[/][# th:if="${mp_open_API}"] ### Open API Exposes the information about your endpoints in the format of the OpenAPI v3 specification. Specification [here](https://microprofile.io/project/eclipse/microprofile-open-api) The index page contains a link to the OpenAPI information of your endpoints. - -[/] - -[# th:if="${mp_open_tracing}"] +[/][# th:if="${mp_open_tracing}"] ### Open Tracing Allow the participation in distributed tracing of your requests through various micro services. Specification [here](https://microprofile.io/project/eclipse/microprofile-opentracing) @@ -139,18 +119,13 @@ Alternatively, you can download the docker image of `all-in-one` using ```docker followed by running the docker image. Refer to [Jaeger doc](https://www.jaegertracing.io/docs/) for more info. Open [http://localhost:16686/](http://localhost:16686/) to see the traces. You have to invoke your demo app endpoint for any traces to show on Jaeger UI. -[/] -[/] - -[# th:if="${mp_rest_client}"] +[/][/][# th:if="${mp_rest_client}"] ### Rest Client A type safe invocation of HTTP rest endpoints. Specification [here](https://microprofile.io/project/eclipse/microprofile-rest-client) The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean. -[/] - -[# th:if="${mp_graphql}"] +[/][# th:if="${mp_graphql}"] ### GraphQL GraphQL is a remote data query language initially invented by Facebook and now evolving under it's own specification and community. MicroProfile GraphQL provides annotation-based APIs for building GraphQL services in Java. The specification is available [here](https://microprofile.io/project/eclipse/microprofile-graphql). @@ -169,5 +144,4 @@ query allHeroes { } } ``` -[/] -[/] +[/][/] diff --git a/src/main/resources/pom-servers.xml b/src/main/resources/pom-servers.xml index 677ec16a..cb61a861 100755 --- a/src/main/resources/pom-servers.xml +++ b/src/main/resources/pom-servers.xml @@ -33,7 +33,6 @@ microprofile-server 1.0-SNAPSHOT - wildfly-swarm-1.2 @@ -111,7 +110,7 @@ org.wildfly.plugins wildfly-jar-maven-plugin - 1.0.0.Alpha4 + 2.0.2.Final wildfly@maven(org.jboss.universe:community-universe)#${version.wildfly} @@ -158,7 +157,6 @@ io.thorntail thorntail-maven-plugin ${version.thorntail} - @@ -166,21 +164,29 @@ - - - + quarkus + + 3.8.1 + true + UTF-8 + UTF-8 + ${version.quarkus} + quarkus-bom + io.quarkus + ${version.quarkus} + - io.quarkus - quarkus-universe-bom - ${version.quarkus} + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} pom import @@ -193,19 +199,23 @@ io.quarkus quarkus-maven-plugin - ${version.quarkus} + ${quarkus-plugin.version} + true - prepare build + generate-code maven-compiler-plugin - 3.8.1 + ${compiler-plugin.version} + + ${maven.compiler.parameters} + diff --git a/src/test/java/org/eclipse/microprofile/starter/core/TemplateVariableProviderTest.java b/src/test/java/org/eclipse/microprofile/starter/core/TemplateVariableProviderTest.java index c05907d7..e599f1a3 100644 --- a/src/test/java/org/eclipse/microprofile/starter/core/TemplateVariableProviderTest.java +++ b/src/test/java/org/eclipse/microprofile/starter/core/TemplateVariableProviderTest.java @@ -19,10 +19,10 @@ */ package org.eclipse.microprofile.starter.core; -import org.eclipse.microprofile.starter.core.model.JessieMaven; -import org.eclipse.microprofile.starter.core.model.JessieModel; import org.eclipse.microprofile.starter.core.model.BuildTool; import org.eclipse.microprofile.starter.core.model.JavaSEVersion; +import org.eclipse.microprofile.starter.core.model.JessieMaven; +import org.eclipse.microprofile.starter.core.model.JessieModel; import org.eclipse.microprofile.starter.core.model.JessieSpecification; import org.eclipse.microprofile.starter.core.model.MicroProfileVersion; import org.junit.Assert; From 770b5f5ebf3d0f2d18d89ffcd2bc7e0277d11d30 Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Mon, 19 Jul 2021 15:42:54 +0200 Subject: [PATCH 2/3] CI update to avoid tmp, comments cleanup --- .github/workflows/main.yml | 12 ++++++------ .../eclipse/microprofile/starter/TestMatrixTest.java | 8 ++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c07e3dd8..36cfc546 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: MicroProfile Starter Tests +name: Tests on: push: @@ -31,7 +31,7 @@ env: jobs: run-starter: - name: MicroProfile Starter ${{ matrix.runtime }} + name: ${{ matrix.runtime }} MicroProfile Starter runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -69,14 +69,14 @@ jobs: check-latest: true - name: Build and run tests for Starter run: | - mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* + mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP - name: Prepare failure archive (if maven failed) if: failure() shell: bash - run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports.tgz -T - + run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-${{ matrix.runtime }}.tgz -T - - name: Upload failure Archive (if maven failed) uses: actions/upload-artifact@v2 if: failure() with: - name: test-reports - path: 'test-reports.tgz' + name: test-reports-${{ matrix.runtime }} + path: 'test-reports-${{ matrix.runtime }}.tgz' diff --git a/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java b/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java index 9fefaf6a..7081b8fd 100644 --- a/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java +++ b/src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java @@ -236,10 +236,6 @@ public void testWebPages(String urlBase, String homePage, String supportedServer } else if (supportedServer.equalsIgnoreCase("WILDFLY")) { // Wildfly has a special port specialUrlBase = urlBase.replace(SupportedServer.WILDFLY.getPortServiceA(), "9990"); - // Pertinent for Q 2.x+, also in index.html - //} else if (supportedServer.equalsIgnoreCase("QUARKUS")) { - // // Quarkus prepends /q - // specialUrlBase = urlBase + "q/"; } else { specialUrlBase = urlBase; } @@ -259,7 +255,7 @@ public void testWebPages(String urlBase, String homePage, String supportedServer testWeb(urlBase + MPSpecGET.METRICS.urlContent[0][0], 5, MPSpecGET.METRICS.urlContent[0][1]); testWeb(specialUrlBase + MPSpecGET.METRICS.urlContent[1][0], 10, MPSpecGET.METRICS.urlContent[1][1]); testWeb(urlBase + MPSpecGET.JWT_AUTH.urlContent[0][0], 5, MPSpecGET.JWT_AUTH.urlContent[0][1]); - if (supportedServer.equalsIgnoreCase("TOMEE") || supportedServer.equalsIgnoreCase("QUARKUS")) { + if (supportedServer.equalsIgnoreCase("TOMEE")) { testWeb(specialUrlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); } else { testWeb(urlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); @@ -274,7 +270,7 @@ public void testWebPages(String urlBase, String homePage, String supportedServer testWeb(specialUrlBase + MPSpecGET.HEALTH_CHECKS.urlContent[0][0], 5, MPSpecGET.HEALTH_CHECKS.urlContent[0][1]); testWeb(urlBase + MPSpecGET.METRICS.urlContent[0][0], 5, MPSpecGET.METRICS.urlContent[0][1]); testWeb(specialUrlBase + MPSpecGET.METRICS.urlContent[1][0], 5, MPSpecGET.METRICS.urlContent[1][1]); - if (supportedServer.equalsIgnoreCase("TOMEE") || supportedServer.equalsIgnoreCase("QUARKUS")) { + if (supportedServer.equalsIgnoreCase("TOMEE")) { testWeb(specialUrlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); } else { testWeb(urlBase + MPSpecGET.OPEN_API.urlContent[0][0], 5, MPSpecGET.OPEN_API.urlContent[0][1]); From 767437411496c9ff048686e79cefa76a19ce9e98 Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Fri, 30 Jul 2021 09:44:09 +0200 Subject: [PATCH 3/3] Fixing comment about JDK11 and Quarkus --- .../starter/addon/microprofile/servers/model/JDKSelector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java index 28f83f26..1e985652 100644 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java @@ -44,7 +44,7 @@ public void init() { fillJavaSEVersion(data, SupportedServer.THORNTAIL_V2, JavaSEVersion.SE11, MicroProfileVersion.MP22, null); // Supported from MP 2.2 fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE8, null, null); // Supported for all MPVersions - fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported for all MPVersions + fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported from MP 3.2 fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE8, null, null); // Supported for all MPVersions fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported from MP 3.2