diff --git a/applications/pom.xml b/applications/pom.xml index ac74b3c0d80..faabd6470e1 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - src/main/java - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - . - - build.gradle.mustache - README.md.mustache - - - - . - - pom.xml.mustache - README.md.mustache - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/* - - - - src/test/java - - **/*.mustache - - - - src/test/resources - - **/* - - - - - - - - - - - diff --git a/archetypes/bare-mp/src/main/resources/pom.xml.mustache b/archetypes/bare-mp/src/main/resources/pom.xml.mustache deleted file mode 100644 index 04ff293f269..00000000000 --- a/archetypes/bare-mp/src/main/resources/pom.xml.mustache +++ /dev/null @@ -1,82 +0,0 @@ - - - 4.0.0 - - io.helidon.applications - helidon-mp - {{helidonVersion}} - - - {{groupId}} - {{artifactId}} - {{version}} - {{name}} - - - - io.helidon.microprofile.bundles - helidon-microprofile-core - - - io.helidon.microprofile.metrics - helidon-microprofile-metrics - - - io.helidon.microprofile.health - helidon-microprofile-health - - - io.helidon.media - helidon-media-jsonp - - org.jboss - jandex - runtime - true - - - org.junit.jupiter - junit-jupiter-api - test - - - io.helidon.microprofile.tests - helidon-microprofile-tests-junit5 - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - org.jboss.jandex - jandex-maven-plugin - - - make-index - - - - - io.helidon.build-tools - helidon-maven-plugin - - - third-party-license-report - - - - - - diff --git a/archetypes/bare-mp/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache b/archetypes/bare-mp/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache deleted file mode 100644 index cc463618e44..00000000000 --- a/archetypes/bare-mp/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache +++ /dev/null @@ -1,52 +0,0 @@ - -package {{package}}; - -import jakarta.inject.Inject; -import jakarta.enterprise.inject.se.SeContainer; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.json.JsonObject; -import jakarta.ws.rs.client.Client; -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.client.WebTarget; - -import jakarta.ws.rs.core.Response; - -import io.helidon.microprofile.server.Server; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import io.helidon.microprofile.tests.junit5.HelidonTest; - -@HelidonTest -class MainTest { - - @Inject - private WebTarget target; - - @Test - void testHelloWorld() { - JsonObject jsonObject = target - .path("greet") - .request() - .get(JsonObject.class); - Assertions.assertEquals("Hello World!", jsonObject.getString("message"), - "default message"); - - try (Response r = target - .path("metrics") - .request() - .get()) { - Assertions.assertEquals(200, r.getStatus(), "GET metrics status code"); - } - - try (Response r = target - .path("health") - .request() - .get()) { - Assertions.assertEquals(200, r.getStatus(), "GET health status code"); - } - } -} diff --git a/archetypes/bare-mp/src/test/resources/projects/it1/goal.txt b/archetypes/bare-mp/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/bare-mp/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/bare-se/src/main/resources/META-INF/helidon-archetype.xml.mustache b/archetypes/bare-se/src/main/resources/META-INF/helidon-archetype.xml.mustache deleted file mode 100644 index 15e6e31ad18..00000000000 --- a/archetypes/bare-se/src/main/resources/META-INF/helidon-archetype.xml.mustache +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - src/main/java - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - . - - build.gradle.mustache - README.md.mustache - - - - . - - pom.xml.mustache - README.md.mustache - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/* - - - - src/test/java - - **/*.mustache - - - - src/test/resources - - **/* - - - - - - - - - - - diff --git a/archetypes/bare-se/src/main/resources/src/main/resources/application.yaml b/archetypes/bare-se/src/main/resources/src/main/resources/application.yaml deleted file mode 100644 index 984387f28ad..00000000000 --- a/archetypes/bare-se/src/main/resources/src/main/resources/application.yaml +++ /dev/null @@ -1,7 +0,0 @@ - -app: - greeting: "Hello" - -server: - port: 8080 - host: 0.0.0.0 diff --git a/archetypes/bare-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache b/archetypes/bare-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache deleted file mode 100644 index b91105fcbd6..00000000000 --- a/archetypes/bare-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache +++ /dev/null @@ -1,70 +0,0 @@ - -package {{package}}; - -import java.util.Collections; -import java.util.concurrent.TimeUnit; - -import jakarta.json.Json; -import jakarta.json.JsonBuilderFactory; -import jakarta.json.JsonObject; - -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.webclient.WebClient; -import io.helidon.webclient.WebClientResponse; -import io.helidon.webserver.WebServer; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class MainTest { - - private static WebServer webServer; - private static WebClient webClient; - private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); - - @BeforeAll - public static void startTheServer() throws Exception { - webServer = Main.startServer().await(); - - webClient = WebClient.builder() - .baseUri("http://localhost:" + webServer.port()) - .addMediaSupport(JsonpSupport.create()) - .build(); - } - - @AfterAll - public static void stopServer() throws Exception { - if (webServer != null) { - webServer.shutdown() - .toCompletableFuture() - .get(10, TimeUnit.SECONDS); - } - } - - @Test - public void testHelloWorld() throws Exception { - JsonObject jsonObject; - WebClientResponse response; - - jsonObject = webClient.get() - .path("/greet") - .request(JsonObject.class) - .await(); - assertEquals("Hello World!", jsonObject.getString("message")); - - response = webClient.get() - .path("/health") - .request() - .await(); - assertEquals(200, response.status().code()); - - response = webClient.get() - .path("/metrics") - .request() - .await(); - assertEquals(200, response.status().code()); - } -} diff --git a/archetypes/bare-se/src/test/resources/projects/it1/archetype.properties b/archetypes/bare-se/src/test/resources/projects/it1/archetype.properties deleted file mode 100644 index 907c49265c7..00000000000 --- a/archetypes/bare-se/src/test/resources/projects/it1/archetype.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -package=io.helidon.archetypes.tests -version=0.1-SNAPSHOT -groupId=io.helidon.archetypes.tests -artifactId=se-it1 \ No newline at end of file diff --git a/archetypes/bare-se/src/test/resources/projects/it1/goal.txt b/archetypes/bare-se/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/bare-se/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/catalog/catalog.xml.mustache b/archetypes/catalog/catalog.xml.mustache deleted file mode 100644 index 2c3b919e2aa..00000000000 --- a/archetypes/catalog/catalog.xml.mustache +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - diff --git a/archetypes/database-mp/src/main/resources/META-INF/helidon-archetype.xml.mustache b/archetypes/database-mp/src/main/resources/META-INF/helidon-archetype.xml.mustache deleted file mode 100644 index b51aeb6f577..00000000000 --- a/archetypes/database-mp/src/main/resources/META-INF/helidon-archetype.xml.mustache +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - . - - build.gradle.mustache - README.md.mustache - - - - . - - pom.xml.mustache - README.md.mustache - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/* - - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - src/test/resources - - **/* - - - - - - - - - - - diff --git a/archetypes/database-mp/src/main/resources/pom.xml.mustache b/archetypes/database-mp/src/main/resources/pom.xml.mustache deleted file mode 100644 index e381fb16e5c..00000000000 --- a/archetypes/database-mp/src/main/resources/pom.xml.mustache +++ /dev/null @@ -1,195 +0,0 @@ - - - 4.0.0 - - io.helidon.applications - helidon-mp - {{helidonVersion}} - - - {{groupId}} - {{artifactId}} - {{version}} - {{name}} - - - - jakarta.annotation - jakarta.annotation-api - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - - jakarta.inject - jakarta.inject-api - - - jakarta.ws.rs - jakarta.ws.rs-api - - - jakarta.json.bind - jakarta.json.bind-api - - - jakarta.persistence - jakarta.persistence-api - - - jakarta.transaction - jakarta.transaction-api - - - io.helidon.common - helidon-common - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - io.helidon.microprofile.server - helidon-microprofile-server - - - io.helidon.microprofile.bundles - helidon-microprofile - runtime - - - - com.h2database - h2 - runtime - - - io.helidon.integrations.cdi - helidon-integrations-cdi-hibernate - runtime - - - io.helidon.integrations.cdi - helidon-integrations-cdi-jta-weld - runtime - - - io.helidon.integrations.cdi - helidon-integrations-cdi-datasource-hikaricp - runtime - - - io.helidon.integrations.cdi - helidon-integrations-cdi-jpa - runtime - - - org.jboss - jandex - runtime - - - org.glassfish.jersey.media - jersey-media-json-binding - runtime - - - org.junit.jupiter - junit-jupiter-api - test - - - org.hamcrest - hamcrest-all - test - - - io.helidon.microprofile.tests - helidon-microprofile-tests-junit5 - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - org.jboss.jandex - jandex-maven-plugin - - - make-index - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - Generate persistence.xml Java objects - - generate - - - io.helidon.archetypes.tests.jaxb - true - - - - jakarta.persistence - jakarta.persistence-api - javax/persistence/persistence_2_2.xsd - - - - false - - - - - - org.hibernate.orm.tooling - hibernate-enhance-maven-plugin - - - - true - true - true - - - enhance - - - - - - io.helidon.build-tools - helidon-maven-plugin - - - third-party-license-report - - - - - - diff --git a/archetypes/database-mp/src/main/resources/src/main/java/__pkg__/package-info.java.mustache b/archetypes/database-mp/src/main/resources/src/main/java/__pkg__/package-info.java.mustache deleted file mode 100644 index 055e4189e29..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/java/__pkg__/package-info.java.mustache +++ /dev/null @@ -1,2 +0,0 @@ - -package {{package}}; diff --git a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/beans.xml b/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/beans.xml deleted file mode 100644 index 5d94aab5a26..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties b/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties deleted file mode 100644 index f1aedfbb504..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties +++ /dev/null @@ -1 +0,0 @@ -Args=-H:+RemoveSaturatedTypeFlows \ No newline at end of file diff --git a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/reflect-config.json.mustache b/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/reflect-config.json.mustache deleted file mode 100644 index fe51488c706..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/native-image/reflect-config.json.mustache +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/persistence.xml.mustache b/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/persistence.xml.mustache deleted file mode 100644 index b25715acfb1..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/resources/META-INF/persistence.xml.mustache +++ /dev/null @@ -1,17 +0,0 @@ - - - - test - {{package}}.Pokemon - {{package}}.PokemonType - - - - - - - diff --git a/archetypes/database-mp/src/main/resources/src/main/resources/logging.properties b/archetypes/database-mp/src/main/resources/src/main/resources/logging.properties deleted file mode 100644 index 5157244b93c..00000000000 --- a/archetypes/database-mp/src/main/resources/src/main/resources/logging.properties +++ /dev/null @@ -1,22 +0,0 @@ - -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -# Send messages to the console -handlers=io.helidon.common.HelidonConsoleHandler - -# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n - -# Global logging level. Can be overridden by specific loggers -.level=INFO - -# Quiet Weld -org.jboss.level=WARNING - -# Component specific log levels -#io.helidon.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.common.level=INFO -#io.netty.level=INFO diff --git a/archetypes/database-mp/src/test/resources/projects/it1/archetype.properties b/archetypes/database-mp/src/test/resources/projects/it1/archetype.properties deleted file mode 100644 index e431dcc2d09..00000000000 --- a/archetypes/database-mp/src/test/resources/projects/it1/archetype.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -package=io.helidon.archetypes.tests -version=0.1-SNAPSHOT -groupId=io.helidon.archetypes.tests -artifactId=mp-it1 \ No newline at end of file diff --git a/archetypes/database-mp/src/test/resources/projects/it1/goal.txt b/archetypes/database-mp/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/database-mp/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/database-se/src/main/resources/META-INF/helidon-archetype.xml.mustache b/archetypes/database-se/src/main/resources/META-INF/helidon-archetype.xml.mustache deleted file mode 100644 index cb607facedd..00000000000 --- a/archetypes/database-se/src/main/resources/META-INF/helidon-archetype.xml.mustache +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - . - - build.gradle.mustache - README.md.mustache - - - - . - - pom.xml.mustache - README.md.mustache - - - - - - src/main/java - - **/*.mustache - - - - src/main/resources - - **/* - - - **/*.mustache - - - - src/test/java - - **/*.mustache - - - - src/test/resources - - **/* - - - - - - - - - - - diff --git a/archetypes/database-se/src/main/resources/pom.xml.mustache b/archetypes/database-se/src/main/resources/pom.xml.mustache deleted file mode 100644 index 0491129b99a..00000000000 --- a/archetypes/database-se/src/main/resources/pom.xml.mustache +++ /dev/null @@ -1,146 +0,0 @@ - - - - - 4.0.0 - - io.helidon.applications - helidon-se - {{helidonVersion}} - - - {{groupId}} - {{artifactId}} - {{version}} - {{name}} - - - {{package}}.Main - - - - - io.helidon.health - helidon-health - - - io.helidon.metrics - helidon-metrics - - - io.helidon.dbclient - helidon-dbclient-jdbc - - - io.helidon.dbclient - helidon-dbclient-mongodb - - - io.helidon.dbclient - helidon-dbclient-tracing - - - io.helidon.dbclient - helidon-dbclient-metrics - - - io.helidon.dbclient - helidon-dbclient-metrics-jdbc - - - io.helidon.dbclient - helidon-dbclient-health - - - io.helidon.dbclient - helidon-dbclient-jsonp - - - com.zaxxer - HikariCP - - - org.slf4j - slf4j-jdk14 - - - io.helidon.webserver - helidon-webserver - - - io.helidon.media - helidon-media-jsonp - - - io.helidon.media - helidon-media-jsonb - - - io.helidon.config - helidon-config-yaml - - - - com.h2database - h2 - runtime - - - org.junit.jupiter - junit-jupiter-api - test - - - org.hamcrest - hamcrest-all - test - - - io.helidon.webclient - helidon-webclient - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - io.helidon.build-tools - helidon-maven-plugin - - - third-party-license-report - - - - - - diff --git a/archetypes/database-se/src/main/resources/src/main/java/__pkg__/Main.java.mustache b/archetypes/database-se/src/main/resources/src/main/java/__pkg__/Main.java.mustache deleted file mode 100644 index ee444cb7c59..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/java/__pkg__/Main.java.mustache +++ /dev/null @@ -1,102 +0,0 @@ - -package {{package}}; - -import io.helidon.common.LogConfig; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.dbclient.DbClient; -import io.helidon.dbclient.health.DbClientHealthCheck; -import io.helidon.health.HealthSupport; -import io.helidon.media.jsonb.JsonbSupport; -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.metrics.MetricsSupport; -import io.helidon.webserver.Routing; -import io.helidon.webserver.WebServer; - -/** - * Main class that starts up server and registers Pokemon services. - * - * Pokémon, and Pokémon character names are trademarks of Nintendo. - */ -public final class Main { - - /** - * Cannot be instantiated. - */ - private Main() { - } - - /** - * Application main entry point. - * - * @param args command line arguments - */ - public static void main(final String[] args) { - startServer(); - } - - /** - * Start the server. - * - * @return the created {@link io.helidon.webserver.WebServer} instance - */ - static Single startServer() { - // Load logging configuration - LogConfig.configureRuntime(); - - // By default this will pick up application.yaml from the classpath - Config config = Config.create(); - - // Prepare routing and build server - Routing routing = createRouting(config); - WebServer server = WebServer.builder(routing) - .addMediaSupport(JsonpSupport.create()) - .addMediaSupport(JsonbSupport.create()) - .config(config.get("server")) - .build(); - - Single webserver = server.start(); - - // Try to start the server. If successful, print some info and arrange to - // print a message at shutdown. If unsuccessful, print the exception. - webserver.thenAccept(ws -> { - System.out.println( - "WEB server is up! http://localhost:" + ws.port() + "/pokemon"); - ws.whenShutdown().thenRun(() - -> System.out.println("WEB server is DOWN. Good bye!")); - }) - .exceptionallyAccept(t -> { - System.err.println("Startup failed: " + t.getMessage()); - t.printStackTrace(System.err); - }); - - return webserver; - } - - /** - * Creates new {@link io.helidon.webserver.Routing}. - * - * @param config configuration for this server - * @return routing configured with JSON support, a health check, and a service - */ - private static Routing createRouting(Config config) { - Config dbConfig = config.get("db"); - - // Client services are added through a service loader - DbClient dbClient = DbClient.builder(dbConfig).build(); - - // Support for health - HealthSupport health = HealthSupport.builder() - .addLiveness(DbClientHealthCheck.create(dbClient, dbConfig.get("health-check"))) - .build(); - - // Initialize database schema - InitializeDb.init(dbClient); - - return Routing.builder() - .register(health) // Health at "/health" - .register(MetricsSupport.create()) // Metrics at "/metrics" - .register("/", new PokemonService(dbClient)) - .build(); - } -} diff --git a/archetypes/database-se/src/main/resources/src/main/java/__pkg__/package-info.java.mustache b/archetypes/database-se/src/main/resources/src/main/java/__pkg__/package-info.java.mustache deleted file mode 100644 index 055e4189e29..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/java/__pkg__/package-info.java.mustache +++ /dev/null @@ -1,2 +0,0 @@ - -package {{package}}; diff --git a/archetypes/database-se/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties b/archetypes/database-se/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties deleted file mode 100644 index f1aedfbb504..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/resources/META-INF/native-image/native-image.properties +++ /dev/null @@ -1 +0,0 @@ -Args=-H:+RemoveSaturatedTypeFlows \ No newline at end of file diff --git a/archetypes/database-se/src/main/resources/src/main/resources/Pokemons.json b/archetypes/database-se/src/main/resources/src/main/resources/Pokemons.json deleted file mode 100644 index c4e78bed732..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/resources/Pokemons.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - {"id": 1, "name": "Bulbasaur", "idType": 12}, - {"id": 2, "name": "Charmander", "idType": 10}, - {"id": 3, "name": "Squirtle", "idType": 11}, - {"id": 4, "name": "Caterpie", "idType": 7}, - {"id": 5, "name": "Weedle", "idType": 7}, - {"id": 6, "name": "Pidgey", "idType": 3} -] diff --git a/archetypes/database-se/src/main/resources/src/main/resources/Types.json b/archetypes/database-se/src/main/resources/src/main/resources/Types.json deleted file mode 100644 index 646ec725b82..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/resources/Types.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - {"id": 1, "name": "Normal"}, - {"id": 2, "name": "Fighting"}, - {"id": 3, "name": "Flying"}, - {"id": 4, "name": "Poison"}, - {"id": 5, "name": "Ground"}, - {"id": 6, "name": "Rock"}, - {"id": 7, "name": "Bug"}, - {"id": 8, "name": "Ghost"}, - {"id": 9, "name": "Steel"}, - {"id": 10, "name": "Fire"}, - {"id": 11, "name": "Water"}, - {"id": 12, "name": "Grass"}, - {"id": 13, "name": "Electric"}, - {"id": 14, "name": "Psychic"}, - {"id": 15, "name": "Ice"}, - {"id": 16, "name": "Dragon"}, - {"id": 17, "name": "Dark"}, - {"id": 18, "name": "Fairy"} -] diff --git a/archetypes/database-se/src/main/resources/src/main/resources/logging.properties b/archetypes/database-se/src/main/resources/src/main/resources/logging.properties deleted file mode 100644 index b649887ffda..00000000000 --- a/archetypes/database-se/src/main/resources/src/main/resources/logging.properties +++ /dev/null @@ -1,21 +0,0 @@ - -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -# Send messages to the console -handlers=io.helidon.common.HelidonConsoleHandler - -# Global default logging level. Can be overriden by specific handlers and loggers -.level=INFO - -# Helidon Web Server has a custom log formatter that extends SimpleFormatter. -# It replaces "!thread!" with the current thread name -io.helidon.common.HelidonConsoleHandler.level=ALL -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n - -#Component specific log levels -#io.helidon.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.common.level=INFO -#io.netty.level=INFO diff --git a/archetypes/database-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache b/archetypes/database-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache deleted file mode 100644 index c35dcff5a07..00000000000 --- a/archetypes/database-se/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache +++ /dev/null @@ -1,128 +0,0 @@ - -package {{package}}; - -import java.util.Collections; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; - -import jakarta.json.Json; -import jakarta.json.JsonArray; -import jakarta.json.JsonBuilderFactory; -import jakarta.json.JsonObject; - -import io.helidon.common.http.Http; -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.webclient.WebClient; -import io.helidon.webclient.WebClientResponse; -import io.helidon.webserver.WebServer; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class MainTest { - private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); - - private static WebServer webServer; - private static WebClient webClient; - - @BeforeAll - public static void startTheServer() { - webServer = Main.startServer().await(); - - webClient = WebClient.builder() - .baseUri("http://localhost:" + webServer.port()) - .addMediaSupport(JsonpSupport.create()) - .build(); - } - - @AfterAll - public static void stopServer() throws Exception { - if (webServer != null) { - webServer.shutdown() - .toCompletableFuture() - .get(10, TimeUnit.SECONDS); - } - } - - @Test - public void testPokemonTypes() { - JsonArray array = webClient.get() - .path("/type") - .request(JsonArray.class) - .await(); - - assertThat(array.size(), is(18)); - assertThat(array.get(0).asJsonObject().getInt("id"), is(1)); - assertThat(array.get(0).asJsonObject().getString("name"), is("Normal")); - } - - @Test - public void testPokemons() { - assertThat(getPokemonCount(), is(6)); - - WebClientResponse response; - JsonObject pokemon; - - pokemon = webClient.get() - .path("/pokemon/1") - .request(JsonObject.class) - .await(); - assertThat(pokemon.getString("name"), is("Bulbasaur")); - - pokemon = webClient.get() - .path("/pokemon/name/Charmander") - .request(JsonObject.class) - .await(); - assertThat(pokemon.getJsonNumber("idType").intValue(), is(10)); - - JsonObject json = JSON_BUILDER.createObjectBuilder() - .add("id", 100) - .add("idType", 1) - .add("name", "Test") - .build(); - response = webClient.post() - .path("/pokemon") - .submit(json) - .await(); - assertThat(response.status(), is(Http.Status.OK_200)); - assertThat(getPokemonCount(), is(7)); - - response = webClient.delete() - .path("/pokemon/100") - .request() - .await(); - assertThat(response.status(), is(Http.Status.OK_200)); - - assertThat(getPokemonCount(), is(6)); - } - - @Test - public void testMetricsHealth() { - WebClientResponse response; - - response = webClient.get() - .path("/health") - .request() - .await(); - assertThat(response.status(), is(Http.Status.OK_200)); - - response = webClient.get() - .path("/metrics") - .request() - .await(); - assertThat(response.status(), is(Http.Status.OK_200)); - } - - private int getPokemonCount() { - JsonArray array = webClient.get() - .path("/pokemon") - .request(JsonArray.class) - .await(); - return array.size(); - } -} diff --git a/archetypes/database-se/src/test/resources/projects/it1/archetype.properties b/archetypes/database-se/src/test/resources/projects/it1/archetype.properties deleted file mode 100644 index 907c49265c7..00000000000 --- a/archetypes/database-se/src/test/resources/projects/it1/archetype.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2020 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -package=io.helidon.archetypes.tests -version=0.1-SNAPSHOT -groupId=io.helidon.archetypes.tests -artifactId=se-it1 \ No newline at end of file diff --git a/archetypes/database-se/src/test/resources/projects/it1/goal.txt b/archetypes/database-se/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/database-se/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/catalog/pom.xml b/archetypes/helidon/pom.xml similarity index 67% rename from archetypes/catalog/pom.xml rename to archetypes/helidon/pom.xml index 4b11f35375c..6aa8d694cd4 100644 --- a/archetypes/catalog/pom.xml +++ b/archetypes/helidon/pom.xml @@ -1,7 +1,7 @@ ${version.helidon-cli} + + + io.helidon.build-tools + helidon-archetype-maven-plugin + + + + ${project.version} + + + + + io.helidon.build-tools helidon-stager-maven-plugin @@ -88,15 +69,14 @@ - - - + + + -