diff --git a/archetypes/mp/basic/pom.xml b/archetypes/mp/basic/pom.xml new file mode 100644 index 00000000000..60732a1af48 --- /dev/null +++ b/archetypes/mp/basic/pom.xml @@ -0,0 +1,30 @@ + + + + 4.0.0 + + io.helidon.archetypes + helidon-archetypes-mp + 2.0.0-SNAPSHOT + + helidon-archetypes-mp-basic + Helidon Template Application MP basic + \ No newline at end of file diff --git a/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype-resources.txt b/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype-resources.txt new file mode 100644 index 00000000000..b58740f6166 --- /dev/null +++ b/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype-resources.txt @@ -0,0 +1,8 @@ +pom.xml.mustache +src/main/java/__pkg__/GreetResource.java.mustache +src/main/java/__pkg__/package-info.java.mustache +src/main/resources/META-INF/beans.xml +src/main/resources/META-INF/microprofile-config.properties +src/main/resources/logging.properties +src/main/resources/native-image/reflect-config.json +src/test/java/__pkg__/MainTest.java.mustache \ No newline at end of file diff --git a/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype.xml b/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype.xml new file mode 100644 index 00000000000..37c507e167a --- /dev/null +++ b/archetypes/mp/basic/src/main/resources/META-INF/helidon-archetype.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + src/main/java + + **/*.mustache + + + + src/test/java + + **/*.mustache + + + + . + + build.gradle.mustache + + + + . + + pom.xml.mustache + + + + + + src/main/java + + **/*.mustache + + + + src/main/resources + + **/* + + + + src/test/java + + **/*.mustache + + + + src/test/resources + + **/* + + + + + + + + + + + \ No newline at end of file diff --git a/archetypes/mp/src/main/resources/archetype-resources/pom.xml b/archetypes/mp/basic/src/main/resources/pom.xml.mustache similarity index 80% rename from archetypes/mp/src/main/resources/archetype-resources/pom.xml rename to archetypes/mp/basic/src/main/resources/pom.xml.mustache index 5fb47d0d032..325eccad2b9 100644 --- a/archetypes/mp/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/mp/basic/src/main/resources/pom.xml.mustache @@ -1,4 +1,3 @@ -#set( $symbol_dollar = '$' ) io.helidon.applications helidon-mp - @project.version@ - + {{helidonVersion}} - ${groupId} - ${artifactId} - ${version} - ${artifactId} - - -#if( $mainClass.matches("y|yes|true") ) - ${package}.Main -#end - + {{groupId}} + {{artifactId}} + {{version}} + {{name}} @@ -32,16 +24,18 @@ runtime true -#if( $unitTest.matches("y|yes|true") ) + + jakarta.activation + jakarta.activation-api + runtime + org.junit.jupiter junit-jupiter-api test -#end - diff --git a/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/GreetResource.java.mustache b/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/GreetResource.java.mustache new file mode 100644 index 00000000000..bc4b88471c9 --- /dev/null +++ b/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/GreetResource.java.mustache @@ -0,0 +1,50 @@ + +package {{package}}; + +import java.util.Collections; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.json.Json; +import javax.json.JsonBuilderFactory; +import javax.json.JsonObject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.eclipse.microprofile.config.inject.ConfigProperty; + +/** + * A simple JAX-RS resource to greet you. Examples: + * + * Get default greeting message: + * curl -X GET http://localhost:8080/greet + * + * The message is returned as a JSON object. + */ +@Path("/greet") +public class GreetResource { + private static final JsonBuilderFactory JSON = Json.createBuilderFactory(Collections.emptyMap()); + + private final String message; + + @Inject + public GreetResource(@ConfigProperty(name = "app.greeting") String message) { + this.message = message; + } + + /** + * Return a wordly greeting message. + * + * @return {@link JsonObject} + */ + @GET + @Produces(MediaType.APPLICATION_JSON) + public JsonObject getDefaultMessage() { + String msg = String.format("%s %s!", message, "World"); + return JSON.createObjectBuilder() + .add("message", msg) + .build(); + } +} diff --git a/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache b/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache new file mode 100644 index 00000000000..055e4189e29 --- /dev/null +++ b/archetypes/mp/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache @@ -0,0 +1,2 @@ + +package {{package}}; diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml.vm b/archetypes/mp/basic/src/main/resources/src/main/resources/META-INF/beans.xml similarity index 99% rename from archetypes/mp/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml.vm rename to archetypes/mp/basic/src/main/resources/src/main/resources/META-INF/beans.xml index 125ef995e5e..5d94aab5a26 100644 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml.vm +++ b/archetypes/mp/basic/src/main/resources/src/main/resources/META-INF/beans.xml @@ -1,5 +1,4 @@ - current = CDI.current(); + ((SeContainer) current).close(); + } + + private String getConnectionString(String path) { + return "http://localhost:" + server.port() + path; + } +} diff --git a/archetypes/mp/pom.xml b/archetypes/mp/pom.xml index 05b000af0c1..5471560416e 100644 --- a/archetypes/mp/pom.xml +++ b/archetypes/mp/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 io.helidon.archetypes helidon-archetypes-project 2.0.0-SNAPSHOT - helidon-mp - maven-archetype - Helidon MP Archetype - Archetype to generate a basic Helidon MP application + helidon-archetypes-mp + Helidon Template Application Types for MP + pom - - - - org.apache.maven.archetype - archetype-packaging - - - + + basic + diff --git a/archetypes/mp/src/main/resources/META-INF/archetype-post-generate.groovy b/archetypes/mp/src/main/resources/META-INF/archetype-post-generate.groovy deleted file mode 100644 index 3bb2d777aa0..00000000000 --- a/archetypes/mp/src/main/resources/META-INF/archetype-post-generate.groovy +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * - * 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. - */ - -def rootDir = new File(request.getOutputDirectory() + "/" + request.getArtifactId()) -def javaPackage = request.getProperties().get("package") -def javaPkgDir = new File(rootDir, "src/main/java/" + javaPackage.replace('.','/')) -def testJavaPkgDir = new File(rootDir, "src/test/java/" + javaPackage.replace('.','/')) -def resourcesDir = new File(rootDir, "src/main/resources") -def testResourcesDir = new File(rootDir, "src/test/resources") - -def optionalFiles = [ - mainClass: [ "${javaPkgDir}/Main.java.vm" ], - restResource: [ "${javaPkgDir}/__applicationName__.java.vm", "${javaPkgDir}/__restResourceName__.java.vm" ], - unitTest: [ "${testJavaPkgDir}/MainTest.java.vm", "${testResourcesDir}/microprofile-config.properties.vm" ], - loggingConfig: [ "${resourcesDir}/logging.properties.vm" ], - applicationYaml: [ "${resourcesDir}/application.yaml.vm" ] -] - -// remove optional files that should not be included -optionalFiles.each{ prop, fnames -> - if (request.getProperties().get(prop).matches("n|no|false")) { - fnames.each{ fname -> - request.getProperties().each { entry -> - fname = fname.replaceAll("__${entry.key}__","${entry.value}") - } - new File(fname).delete() - } - } -} - -// rename .vm files -rootDir.traverse(type: groovy.io.FileType.FILES, maxDepth: -1) { file -> - if (file.path.endsWith(".vm")) { - file.renameTo file.path.substring(0, file.path.length() - 3) - } -} - -// delete empty dirs -rootDir.traverse(type: groovy.io.FileType.DIRECTORIES, maxDepth: -1, postDir: { dir -> - if (dir.list().length == 0) { - dir.delete() - } -}) \ No newline at end of file diff --git a/archetypes/mp/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/mp/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 25c822e1887..00000000000 --- a/archetypes/mp/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - no - - - ExampleApplication - ([$_a-zA-Z][$_a-zA-Z0-9]*) - - - yes - - - ExampleResource - ([$_a-zA-Z][$_a-zA-Z0-9]*) - - - /example - ^\/.* - - - no - - - yes - - - no - - - - - src/main/java - - **/*.java.vm - - - - src/test/java - - **/*.java.vm - - - - src/main/resources - - **/* - - - - src/test/resources - - **/* - - - - diff --git a/archetypes/mp/src/main/resources/archetype-resources/.gitignore b/archetypes/mp/src/main/resources/archetype-resources/.gitignore deleted file mode 100644 index 594f3abf63c..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -hs_err_pid* -target/ -.DS_Store -.idea/ -*.iws -*.ipr -*.iml -atlassian-ide-plugin.xml -nbactions.xml -nb-configuration.xml -.settings -.settings/ -.project -.classpath -*.swp -*~ diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/Main.java.vm b/archetypes/mp/src/main/resources/archetype-resources/src/main/java/Main.java.vm deleted file mode 100644 index 722ccea8649..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/Main.java.vm +++ /dev/null @@ -1,65 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -#if( $loggingConfig.matches("y|yes|true") ) -import java.io.InputStream; -#end -import java.io.IOException; -#if( $loggingConfig.matches("y|yes|true") ) -import java.util.logging.LogManager; -#end - -import io.helidon.microprofile.server.Server; - -/** - * The application main class. - */ -public final class Main { - - /** - * Cannot be instantiated. - */ - private Main() { } - - /** - * Application main entry point. - * @param args command line arguments - * @throws IOException if there are problems reading logging properties - */ - public static void main(final String[] args) throws IOException { -#if( $loggingConfig.matches("y|yes|true") ) - // load logging configuration - setupLogging(); - -#end - // start the server - Server server = startServer(); -#if( $restResource.matches("y|yes|true") ) - System.out.println("http://localhost:" + server.port() + "${restResourcePath}"); -#end - } - - /** - * Start the server. - * @return the created {@link Server} instance - */ - static Server startServer() { - // Server will automatically pick up configuration from - // microprofile-config.properties - // and Application classes annotated as @ApplicationScoped - return Server.create().start(); - } -#if( $loggingConfig.matches("y|yes|true") ) - - /** - * Configure logging from logging.properties file. - */ - private static void setupLogging() throws IOException { - try (InputStream is = Main.class.getResourceAsStream("/logging.properties")) { - LogManager.getLogManager().readConfiguration(is); - } - } -#end -} diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__applicationName__.java.vm b/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__applicationName__.java.vm deleted file mode 100644 index f07465fa2d2..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__applicationName__.java.vm +++ /dev/null @@ -1,20 +0,0 @@ -package ${package}; - -import java.util.Set; - -import javax.enterprise.context.ApplicationScoped; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** - * Simple JAXRS Application that registers one resource class. - */ -@ApplicationScoped -@ApplicationPath("/") -public class ${applicationName} extends Application { - - @Override - public Set> getClasses() { - return Set.of(${restResourceName}.class); - } -} diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__restResourceName__.java.vm b/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__restResourceName__.java.vm deleted file mode 100644 index bd8fc3c5d86..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/java/__restResourceName__.java.vm +++ /dev/null @@ -1,19 +0,0 @@ -package ${package}; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; - -/** - * Simple JAXRS resource class. - */ -@Path("${restResourcePath}") -public class ${restResourceName} { - - @Produces("text/plain") - @Path("/") - @GET - public String get() { - return "It works!"; - } -} diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm b/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm deleted file mode 100644 index 4e6926c596d..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm +++ /dev/null @@ -1,3 +0,0 @@ -#set( $symbol_pound = '#' ) -server: - port: 8080 \ No newline at end of file diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm b/archetypes/mp/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm deleted file mode 100644 index b85d4c35d5e..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm +++ /dev/null @@ -1,55 +0,0 @@ -package ${package}; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.core.Response; - -#if( $mainClass.matches("n|no|false") ) -import io.helidon.microprofile.server.Main; -#end -import io.helidon.microprofile.server.Server; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -class MainTest { - private static int port; - - @BeforeAll - public static void startTheServer() throws Exception { -#if( $mainClass.matches("n|no|false") ) - Main.main(new String[0]); - port = Main.serverPort(); -#else - port = Main.startServer().port(); -#end - } - -#if( $restResource.matches("y|yes|true") ) - @Test - void testRestResource() { - Client client = ClientBuilder.newClient(); - - String response = client - .target(getConnectionString("${restResourcePath}")) - .request() - .get(String.class); - Assertions.assertEquals("It works!", response); - } - -#end - @Test - void testRoot(){ - Client client = ClientBuilder.newClient(); - Response response = client - .target(getConnectionString("/")) - .request() - .get(); - Assertions.assertEquals(404, response.getStatus()); - } - - private static String getConnectionString(String path) { - return "http://localhost:" + port + path; - } -} diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/test/resources/META-INF/microprofile-config.properties.vm b/archetypes/mp/src/main/resources/archetype-resources/src/test/resources/META-INF/microprofile-config.properties.vm deleted file mode 100644 index 2035b4cf9a5..00000000000 --- a/archetypes/mp/src/main/resources/archetype-resources/src/test/resources/META-INF/microprofile-config.properties.vm +++ /dev/null @@ -1,5 +0,0 @@ -# Override configuration to use a random port for the unit tests -config_ordinal=1000 -# Microprofile server properties -server.port=-1 -server.host=0.0.0.0 diff --git a/archetypes/mp/src/test/resources/projects/it1/archetype.properties b/archetypes/mp/src/test/resources/projects/it1/archetype.properties deleted file mode 100644 index bcf8ed9fd4f..00000000000 --- a/archetypes/mp/src/test/resources/projects/it1/archetype.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it1 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it1 -applicationName=TestApp -mainClass=n -restResource=n -restResourceName=RemoveMe -restResourcePath=/noop -loggingConfig=n -applicationYaml=n -unitTest=yes \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it1/goal.txt b/archetypes/mp/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/mp/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it2/archetype.properties b/archetypes/mp/src/test/resources/projects/it2/archetype.properties deleted file mode 100644 index e4899b325e0..00000000000 --- a/archetypes/mp/src/test/resources/projects/it2/archetype.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it2 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it2 -applicationName=TestApp -mainClass=y -restResource=y -restResourceName=TestResource -restResourcePath=/test -loggingConfig=y -applicationYaml=y -unitTest=yes \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it2/goal.txt b/archetypes/mp/src/test/resources/projects/it2/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/mp/src/test/resources/projects/it2/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it3/archetype.properties b/archetypes/mp/src/test/resources/projects/it3/archetype.properties deleted file mode 100644 index 76cd3b50aba..00000000000 --- a/archetypes/mp/src/test/resources/projects/it3/archetype.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it3 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it3 -applicationName=TestApp -mainClass=n -restResource=y -restResourceName=TestResource -restResourcePath=/test -loggingConfig=y -applicationYaml=n -unitTest=yes \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it3/goal.txt b/archetypes/mp/src/test/resources/projects/it3/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/mp/src/test/resources/projects/it3/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it4/archetype.properties b/archetypes/mp/src/test/resources/projects/it4/archetype.properties deleted file mode 100644 index b8ed9962f1c..00000000000 --- a/archetypes/mp/src/test/resources/projects/it4/archetype.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it4 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it4 -applicationName=TestApp -mainClass=n -restResource=y -restResourceName=TestResource -restResourcePath=/test -loggingConfig=y -applicationYaml=n -unitTest=no \ No newline at end of file diff --git a/archetypes/mp/src/test/resources/projects/it4/goal.txt b/archetypes/mp/src/test/resources/projects/it4/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/mp/src/test/resources/projects/it4/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/pom.xml b/archetypes/pom.xml index d35f20be8af..bcabe7a48a6 100644 --- a/archetypes/pom.xml +++ b/archetypes/pom.xml @@ -1,7 +1,7 @@ - - + 4.0.0 io.helidon @@ -27,74 +27,26 @@ io.helidon.archetypes helidon-archetypes-project - Helidon Archetypes + Helidon Template Application Types used by CLI pom + + UTF-8 + + - mp se + mp - - - org.apache.maven.archetype - archetype-packaging - ${version.plugin.archetype-packaging} - - - - - src/main/resources - true - - archetype-resources/pom.xml - - - - src/main/resources - false - - archetype-resources/pom.xml - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - default-resources - - false - - @ - - - - - - - + + + io.helidon.build-tools.archetype + helidon-archetype-maven-plugin + ${version.plugin.helidon-build-tools} + true + + - - - - - io.helidon.applications - helidon-se - ${project.version} - pom - true - - - io.helidon.applications - helidon-mp - ${project.version} - pom - true - - diff --git a/archetypes/se/basic/pom.xml b/archetypes/se/basic/pom.xml new file mode 100644 index 00000000000..78a98177f8a --- /dev/null +++ b/archetypes/se/basic/pom.xml @@ -0,0 +1,30 @@ + + + + 4.0.0 + + io.helidon.archetypes + helidon-archetypes-se + 2.0.0-SNAPSHOT + + helidon-archetypes-se-basic + Helidon Template Application SE basic + \ No newline at end of file diff --git a/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype-resources.txt b/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype-resources.txt new file mode 100644 index 00000000000..dacbd1f8938 --- /dev/null +++ b/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype-resources.txt @@ -0,0 +1,8 @@ +pom.xml.mustache +src/main/java/__pkg__/Main.java.mustache +src/main/java/__pkg__/GreetService.java.mustache +src/main/java/__pkg__/package-info.java.mustache +src/main/resources/application.yaml +src/main/resources/logging.properties +src/main/resources/native-image/reflect-config.json +src/test/java/__pkg__/MainTest.java.mustache \ No newline at end of file diff --git a/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype.xml b/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype.xml new file mode 100644 index 00000000000..37c507e167a --- /dev/null +++ b/archetypes/se/basic/src/main/resources/META-INF/helidon-archetype.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + src/main/java + + **/*.mustache + + + + src/test/java + + **/*.mustache + + + + . + + build.gradle.mustache + + + + . + + pom.xml.mustache + + + + + + src/main/java + + **/*.mustache + + + + src/main/resources + + **/* + + + + src/test/java + + **/*.mustache + + + + src/test/resources + + **/* + + + + + + + + + + + \ No newline at end of file diff --git a/archetypes/se/src/main/resources/archetype-resources/pom.xml b/archetypes/se/basic/src/main/resources/pom.xml.mustache similarity index 79% rename from archetypes/se/src/main/resources/archetype-resources/pom.xml rename to archetypes/se/basic/src/main/resources/pom.xml.mustache index fd0bce9838c..f33ba516134 100644 --- a/archetypes/se/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/se/basic/src/main/resources/pom.xml.mustache @@ -1,4 +1,3 @@ -#set( $symbol_dollar = '$' ) io.helidon.applications helidon-se - @project.version@ - + {{helidonVersion}} - ${groupId} - ${artifactId} - ${version} - ${artifactId} + {{groupId}} + {{artifactId}} + {{version}} + {{name}} - ${package}.Main + {{package}}.Main @@ -24,19 +22,14 @@ io.helidon.webserver helidon-webserver -#if( $jsonSupport.matches("y|yes|true") ) io.helidon.media.jsonp helidon-media-jsonp-common -#end -#if( $applicationYaml.matches("y|yes|true") ) io.helidon.config helidon-config-yaml -#end -#if( $healthSupport.matches("y|yes|true") ) io.helidon.health helidon-health @@ -45,20 +38,20 @@ io.helidon.health helidon-health-checks -#end -#if( $metricsSupport.matches("y|yes|true") ) io.helidon.metrics helidon-metrics -#end -#if( $unitTest.matches("y|yes|true") ) org.junit.jupiter junit-jupiter-api test -#end + + io.helidon.webclient + helidon-webclient + test + diff --git a/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/GreetService.java.mustache b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/GreetService.java.mustache new file mode 100644 index 00000000000..55db56070bf --- /dev/null +++ b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/GreetService.java.mustache @@ -0,0 +1,49 @@ + +package {{package}}; + +import java.util.Collections; +import java.util.logging.Logger; + +import javax.json.Json; +import javax.json.JsonBuilderFactory; +import javax.json.JsonObject; + +import io.helidon.config.Config; +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public class GreetService implements Service { + private static final Logger LOGGER = Logger.getLogger(GreetService.class.getName()); + private static final JsonBuilderFactory JSON = Json.createBuilderFactory(Collections.emptyMap()); + + private final String greeting; + + GreetService(Config config) { + greeting = config.get("app.greeting").asString().orElse("Ciao"); + } + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void update(Routing.Rules rules) { + rules.get("/", this::getDefaultMessageHandler); + } + + /** + * Return a wordly greeting message. + * @param request the server request + * @param response the server response + */ + private void getDefaultMessageHandler(ServerRequest request, ServerResponse response) { + String msg = String.format("%s %s!", greeting, "World"); + LOGGER.info("Greeting message is " + msg); + JsonObject returnObject = JSON.createObjectBuilder() + .add("message", msg) + .build(); + response.send(returnObject); + } +} \ No newline at end of file diff --git a/archetypes/se/src/main/resources/archetype-resources/src/main/java/Main.java.vm b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/Main.java.mustache similarity index 53% rename from archetypes/se/src/main/resources/archetype-resources/src/main/java/Main.java.vm rename to archetypes/se/basic/src/main/resources/src/main/java/__pkg__/Main.java.mustache index 9eea34882ce..eadb452984f 100644 --- a/archetypes/se/src/main/resources/archetype-resources/src/main/java/Main.java.vm +++ b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/Main.java.mustache @@ -1,27 +1,17 @@ -package ${package}; -#if( $loggingConfig.matches("y|yes|true") ) -import java.io.InputStream; -#end +package {{package}}; + import java.io.IOException; -#if( $loggingConfig.matches("y|yes|true") ) +import java.io.InputStream; import java.util.logging.LogManager; -#end -#if( $applicationYaml.matches("y|yes|true") ) import io.helidon.config.Config; -#end -#if( $healthSupport.matches("y|yes|true") ) import io.helidon.health.HealthSupport; import io.helidon.health.checks.HealthChecks; -#end -#if( $jsonSupport.matches("y|yes|true") ) import io.helidon.media.jsonp.common.JsonpSupport; -#end -#if( $metricsSupport.matches("y|yes|true") ) import io.helidon.metrics.MetricsSupport; -#end import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; import io.helidon.webserver.WebServer; /** @@ -32,7 +22,8 @@ public final class Main { /** * Cannot be instantiated. */ - private Main() { } + private Main() { + } /** * Application main entry point. @@ -49,83 +40,57 @@ public final class Main { * @throws IOException if there are problems reading logging properties */ static WebServer startServer() throws IOException { -#if( $loggingConfig.matches("y|yes|true") ) // load logging configuration setupLogging(); -#end -#if( $applicationYaml.matches("y|yes|true") ) // By default this will pick up application.yaml from the classpath Config config = Config.create(); -#end - WebServer server = WebServer.builder() -#if( $applicationYaml.matches("y|yes|true") ) - .routing(createRouting(config)) - .config(config.get("server")) -#else - .routing(createRouting()) -#end -#if( $jsonSupport.matches("y|yes|true") ) - .addMediaSupport(JsonpSupport.create()) -#end - .build(); + // Build server with JSONP support + WebServer server = WebServer.builder(createRouting(config)) + .config(config.get("server")) + .addMediaSupport(JsonpSupport.create()) + .build(); // Try to start the server. If successful, print some info and arrange to // print a message at shutdown. If unsuccessful, print the exception. server.start() - .thenAccept(ws -> { -#if( $restService.matches("y|yes|true") ) - System.out.println("WEB server is up! http://localhost:" + ws.port() + "${restServicePath}"); -#else - System.out.println("WEB server is up! http://localhost:" + ws.port()); -#end - ws.whenShutdown().thenRun(() - -> System.out.println("WEB server is DOWN. Good bye!")); + .thenAccept(ws -> { + System.out.println( + "WEB server is up! http://localhost:" + ws.port() + "/greet"); + ws.whenShutdown().thenRun(() + -> System.out.println("WEB server is DOWN. Good bye!")); }) - .exceptionally(t -> { - System.err.println("Startup failed: " + t.getMessage()); - t.printStackTrace(System.err); - return null; - }); + .exceptionally(t -> { + System.err.println("Startup failed: " + t.getMessage()); + t.printStackTrace(System.err); + return null; + }); // Server threads are not daemon. No need to block. Just react. + return server; } /** * Creates new {@link Routing}. * - * @return configured routing + * @return routing configured with JSON support, a health check, and a service * @param config configuration of this server */ -#if( $applicationYaml.matches("y|yes|true") ) private static Routing createRouting(Config config) { -#else - private static Routing createRouting() { -#end -#if( $metricsSupport.matches("y|yes|true") ) MetricsSupport metrics = MetricsSupport.create(); -#end -#if( $healthSupport.matches("y|yes|true") ) + GreetService greetService = new GreetService(config); HealthSupport health = HealthSupport.builder() - .add(HealthChecks.healthChecks()) // Adds a convenient set of checks + .addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks .build(); -#end return Routing.builder() -#if( $healthSupport.matches("y|yes|true") ) .register(health) // Health at "/health" -#end -#if( $metricsSupport.matches("y|yes|true") ) .register(metrics) // Metrics at "/metrics" -#end -#if( $restService.matches("y|yes|true") ) - .register("${restServicePath}", new ${restServiceName}()) -#end + .register("/greet", greetService) .build(); } -#if( $loggingConfig.matches("y|yes|true") ) /** * Configure logging from logging.properties file. @@ -135,5 +100,4 @@ public final class Main { LogManager.getLogManager().readConfiguration(is); } } -#end } diff --git a/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache new file mode 100644 index 00000000000..055e4189e29 --- /dev/null +++ b/archetypes/se/basic/src/main/resources/src/main/java/__pkg__/package-info.java.mustache @@ -0,0 +1,2 @@ + +package {{package}}; diff --git a/archetypes/se/basic/src/main/resources/src/main/resources/application.yaml b/archetypes/se/basic/src/main/resources/src/main/resources/application.yaml new file mode 100644 index 00000000000..984387f28ad --- /dev/null +++ b/archetypes/se/basic/src/main/resources/src/main/resources/application.yaml @@ -0,0 +1,7 @@ + +app: + greeting: "Hello" + +server: + port: 8080 + host: 0.0.0.0 diff --git a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/logging.properties.vm b/archetypes/se/basic/src/main/resources/src/main/resources/logging.properties similarity index 87% rename from archetypes/mp/src/main/resources/archetype-resources/src/main/resources/logging.properties.vm rename to archetypes/se/basic/src/main/resources/src/main/resources/logging.properties index c64776f4ead..cd238eb6615 100644 --- a/archetypes/mp/src/main/resources/archetype-resources/src/main/resources/logging.properties.vm +++ b/archetypes/se/basic/src/main/resources/src/main/resources/logging.properties @@ -1,3 +1,4 @@ + # Example Logging Configuration File # For more information see $JAVA_HOME/jre/lib/logging.properties @@ -14,9 +15,5 @@ java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$ #io.helidon.webserver.level=INFO #io.helidon.config.level=INFO #io.helidon.security.level=INFO -#io.helidon.microprofile.level=INFO #io.helidon.common.level=INFO #io.netty.level=INFO -#org.glassfish.jersey.level=INFO -#org.jboss.weld=INFO - diff --git a/archetypes/se/basic/src/main/resources/src/main/resources/native-image/reflect-config.json b/archetypes/se/basic/src/main/resources/src/main/resources/native-image/reflect-config.json new file mode 100644 index 00000000000..fe51488c706 --- /dev/null +++ b/archetypes/se/basic/src/main/resources/src/main/resources/native-image/reflect-config.json @@ -0,0 +1 @@ +[] diff --git a/archetypes/se/basic/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache b/archetypes/se/basic/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache new file mode 100644 index 00000000000..74143dbcff6 --- /dev/null +++ b/archetypes/se/basic/src/main/resources/src/test/java/__pkg__/MainTest.java.mustache @@ -0,0 +1,95 @@ + +package {{package}}; + +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +import javax.json.Json; +import javax.json.JsonBuilderFactory; +import javax.json.JsonObject; + +import io.helidon.media.common.MediaSupport; +import io.helidon.media.jsonp.common.JsonProcessing; +import io.helidon.webclient.WebClient; +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; + +public class MainTest { + + private static WebServer webServer; + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + @BeforeAll + public static void startTheServer() throws Exception { + webServer = Main.startServer(); + + long timeout = 2000; // 2 seconds should be enough to start the server + long now = System.currentTimeMillis(); + + while (!webServer.isRunning()) { + Thread.sleep(100); + if ((System.currentTimeMillis() - now) > timeout) { + Assertions.fail("Failed to start webserver"); + } + } + } + + @AfterAll + public static void stopServer() throws Exception { + if (webServer != null) { + webServer.shutdown() + .toCompletableFuture() + .get(10, TimeUnit.SECONDS); + } + } + + @Test + public void testHelloWorld() throws Exception { + JsonProcessing jsonProcessing = JsonProcessing.create(); + WebClient webClient = WebClient.builder() + .baseUri("http://localhost:" + webServer.port()) + .mediaSupport(MediaSupport.builder() + .registerDefaults() + .registerReader(jsonProcessing.newReader()) + .registerWriter(jsonProcessing.newWriter()) + .build()) + .build(); + + webClient.get() + .path("/greet") + .request(JsonObject.class) + .thenAccept(jsonObject -> Assertions.assertEquals("Hello World!", jsonObject.getString("message"))) + .exceptionally(throwable -> { + Assertions.fail(throwable); + return null; + }) + .toCompletableFuture() + .get(); + + webClient.get() + .path("/health") + .request() + .thenAccept(response -> Assertions.assertEquals(200, response.status().code())) + .exceptionally(throwable -> { + Assertions.fail(throwable); + return null; + }) + .toCompletableFuture() + .get(); + + webClient.get() + .path("/metrics") + .request() + .thenAccept(response -> Assertions.assertEquals(200, response.status().code())) + .exceptionally(throwable -> { + Assertions.fail(throwable); + return null; + }) + .toCompletableFuture() + .get(); + } +} diff --git a/archetypes/se/pom.xml b/archetypes/se/pom.xml index 9a9c62e2a84..86e82d80c67 100644 --- a/archetypes/se/pom.xml +++ b/archetypes/se/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 io.helidon.archetypes helidon-archetypes-project 2.0.0-SNAPSHOT - helidon-se - maven-archetype - Helidon SE Archetype - Archetype to generate a basic Helidon SE application + helidon-archetypes-se + Helidon Template Application Types for SE + pom - - - - org.apache.maven.archetype - archetype-packaging - - - - + + basic + + \ No newline at end of file diff --git a/archetypes/se/src/main/resources/META-INF/archetype-post-generate.groovy b/archetypes/se/src/main/resources/META-INF/archetype-post-generate.groovy deleted file mode 100644 index 4377df9fb3c..00000000000 --- a/archetypes/se/src/main/resources/META-INF/archetype-post-generate.groovy +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - * - * 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. - */ - -def rootDir = new File(request.getOutputDirectory() + "/" + request.getArtifactId()) -def javaPackage = request.getProperties().get("package") -def javaPkgDir = new File(rootDir, "src/main/java/" + javaPackage.replace('.','/')) -def testJavaPkgDir = new File(rootDir, "src/test/java/" + javaPackage.replace('.','/')) -def resourcesDir = new File(rootDir, "src/main/resources") - -def optionalFiles = [ - restService: [ "${javaPkgDir}/__restServiceName__.java.vm" ], - unitTest: [ "${testJavaPkgDir}/MainTest.java.vm" ], - loggingConfig: [ "${resourcesDir}/logging.properties.vm" ], - applicationYaml: [ "${resourcesDir}/application.yaml.vm" ], - nativeImageSupport: [ "${resourcesDir}/META-INF/native-image/native-image.properties.vm", - "${resourcesDir}/META-INF/native-image/helidon-example-reflection-config.json" ] -] - -// remove optional files that should not be included -optionalFiles.each{ prop, fnames -> - if (request.getProperties().get(prop).matches("n|no|false")) { - fnames.each{ fname -> - request.getProperties().each { entry -> - fname = fname.replaceAll("__${entry.key}__","${entry.value}") - } - new File(fname).delete() - } - } -} - -// rename .vm files -rootDir.traverse(type: groovy.io.FileType.FILES, maxDepth: -1) { file -> - if (file.path.endsWith(".vm")) { - file.renameTo file.path.substring(0, file.path.length() - 3) - } -} - -// delete empty dirs -rootDir.traverse(type: groovy.io.FileType.DIRECTORIES, maxDepth: -1, postDir: { dir -> - if (dir.list().length == 0) { - dir.delete() - } -}) \ No newline at end of file diff --git a/archetypes/se/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/se/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 54165f15c0e..00000000000 --- a/archetypes/se/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - yes - - - ExampleService - ([$_a-zA-Z][$_a-zA-Z0-9]*) - - - /example - ^\/.* - - - no - - - yes - - - no - - - no - - - no - - - no - - - no - - - - - src/main/java - - **/*.java.vm - - - - src/test/java - - **/*.java.vm - - - - src/main/resources - - **/* - - - - src/test/resources - - **/* - - - - diff --git a/archetypes/se/src/main/resources/archetype-resources/.gitignore b/archetypes/se/src/main/resources/archetype-resources/.gitignore deleted file mode 100644 index 594f3abf63c..00000000000 --- a/archetypes/se/src/main/resources/archetype-resources/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -hs_err_pid* -target/ -.DS_Store -.idea/ -*.iws -*.ipr -*.iml -atlassian-ide-plugin.xml -nbactions.xml -nb-configuration.xml -.settings -.settings/ -.project -.classpath -*.swp -*~ diff --git a/archetypes/se/src/main/resources/archetype-resources/src/main/java/__restServiceName__.java.vm b/archetypes/se/src/main/resources/archetype-resources/src/main/java/__restServiceName__.java.vm deleted file mode 100644 index 5b0ed96151b..00000000000 --- a/archetypes/se/src/main/resources/archetype-resources/src/main/java/__restServiceName__.java.vm +++ /dev/null @@ -1,19 +0,0 @@ -package ${package}; - -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - -public class ${restServiceName} implements Service { - - @Override - public void update(Routing.Rules rules) { - rules - .get("/", this::getDefaultMessageHandler); - } - - private void getDefaultMessageHandler(ServerRequest request, ServerResponse response) { - response.send("It works!"); - } -} diff --git a/archetypes/se/src/main/resources/archetype-resources/src/main/resources/META-INF/native-image/native-image.properties.vm b/archetypes/se/src/main/resources/archetype-resources/src/main/resources/META-INF/native-image/native-image.properties.vm deleted file mode 100644 index 04c45cc5256..00000000000 --- a/archetypes/se/src/main/resources/archetype-resources/src/main/resources/META-INF/native-image/native-image.properties.vm +++ /dev/null @@ -1 +0,0 @@ -Args=-H:ReflectionConfigurationResources=${.}/helidon-example-reflection-config.json diff --git a/archetypes/se/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm b/archetypes/se/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm deleted file mode 100644 index b46e1d1a133..00000000000 --- a/archetypes/se/src/main/resources/archetype-resources/src/main/resources/application.yaml.vm +++ /dev/null @@ -1,4 +0,0 @@ - -server: - port: 8080 - host: 0.0.0.0 \ No newline at end of file diff --git a/archetypes/se/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm b/archetypes/se/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm deleted file mode 100644 index 84f9e2abb57..00000000000 --- a/archetypes/se/src/main/resources/archetype-resources/src/test/java/MainTest.java.vm +++ /dev/null @@ -1,82 +0,0 @@ -package ${package}; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.TimeUnit; -import java.net.URL; -import java.net.HttpURLConnection; - -import io.helidon.webserver.WebServer; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class MainTest { - - private static WebServer webServer; - - @BeforeAll - public static void startTheServer() throws Exception { - webServer = Main.startServer(); - - long timeout = 2000; // 2 seconds should be enough to start the server - long now = System.currentTimeMillis(); - - while (!webServer.isRunning()) { - Thread.sleep(100); - if ((System.currentTimeMillis() - now) > timeout) { - Assertions.fail("Failed to start webserver"); - } - } - } - - @AfterAll - public static void stopServer() throws Exception { - if (webServer != null) { - webServer.shutdown() - .toCompletableFuture() - .get(10, TimeUnit.SECONDS); - } - } - -#if( $restService.matches("y|yes|true") ) - @Test - public void testRestService() throws Exception { - HttpURLConnection conn = getURLConnection("GET","${restServicePath}"); - Assertions.assertEquals(200, conn.getResponseCode()); - String body = readString(conn.getInputStream()); - Assertions.assertEquals("It works!", body); - } - -#end - @Test - public void testRoot() throws Exception { - HttpURLConnection conn = getURLConnection("GET","/"); - Assertions.assertEquals(404, conn.getResponseCode()); - } - - private static String readString(InputStream is) throws IOException { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { - String line; - while ((line = reader.readLine()) != null) { - sb.append(line); - } - } - return sb.toString(); - } - - private HttpURLConnection getURLConnection(String method, String path) throws Exception { - URL url = new URL("http://localhost:" + webServer.port() + path); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setRequestMethod(method); - conn.setRequestProperty("Accept", "application/json"); - System.out.println("Connecting: " + method + " " + url); - return conn; - } -} diff --git a/archetypes/se/src/test/resources/projects/it1/archetype.properties b/archetypes/se/src/test/resources/projects/it1/archetype.properties deleted file mode 100644 index 5950cd9b89a..00000000000 --- a/archetypes/se/src/test/resources/projects/it1/archetype.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it2 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it1 -applicationName=TestApp -restService=yes -restServiceName=TestService -restServicePath=/test -loggingConfig=yes -applicationYaml=yes -metricSupport=yes -healthSupport=yes -jsonSupport=yes -nativeImageSupport=yes -unitTest=yes \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it1/goal.txt b/archetypes/se/src/test/resources/projects/it1/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/se/src/test/resources/projects/it1/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it2/archetype.properties b/archetypes/se/src/test/resources/projects/it2/archetype.properties deleted file mode 100644 index 7326d289dbb..00000000000 --- a/archetypes/se/src/test/resources/projects/it2/archetype.properties +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it2 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it2 -restService=no -loggingConfig=no -restServiceName=RemoveMe -restServicePath=na -applicationYaml=/noop -metricSupport=no -healthSupport=no -jsonSupport=no -nativeImageSupport=no -unitTest=yes \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it2/goal.txt b/archetypes/se/src/test/resources/projects/it2/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/se/src/test/resources/projects/it2/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it3/archetype.properties b/archetypes/se/src/test/resources/projects/it3/archetype.properties deleted file mode 100644 index 7e844818427..00000000000 --- a/archetypes/se/src/test/resources/projects/it3/archetype.properties +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it3 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it3 -restService=yes -restServiceName=TestService -restServicePath=/test -loggingConfig=yes -applicationYaml=no -metricSupport=yes -healthSupport=yes -jsonSupport=no -nativeImageSupport=yes -unitTest=yes \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it3/goal.txt b/archetypes/se/src/test/resources/projects/it3/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/se/src/test/resources/projects/it3/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it4/archetype.properties b/archetypes/se/src/test/resources/projects/it4/archetype.properties deleted file mode 100644 index 6bb24e456ba..00000000000 --- a/archetypes/se/src/test/resources/projects/it4/archetype.properties +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# 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=com.acme.it3 -version=0.1-SNAPSHOT -groupId=com.acme -artifactId=it3 -restService=yes -restServiceName=TestService -restServicePath=/test -loggingConfig=yes -applicationYaml=no -metricSupport=yes -healthSupport=yes -jsonSupport=no -nativeImageSupport=yes -unitTest=no \ No newline at end of file diff --git a/archetypes/se/src/test/resources/projects/it4/goal.txt b/archetypes/se/src/test/resources/projects/it4/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/archetypes/se/src/test/resources/projects/it4/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file