From 93436efed01bf21258eb16bfc7712a423095d253 Mon Sep 17 00:00:00 2001 From: Ahmad bawaneh Date: Sun, 13 Jun 2021 20:50:47 +0300 Subject: [PATCH] update to latest versions --- build.gradle | 6 +- domino-cli.install4j | 2 +- .../ProjectBeanJsonDeserializerImpl.java | 32 ++-- .../model/ProjectBeanJsonSerializerImpl.java | 18 +- .../cli/model/Project_MapperImpl.java | 10 +- .../TemplateFileBeanJsonDeserializerImpl.java | 32 ++-- .../TemplateFileBeanJsonSerializerImpl.java | 18 +- .../files/TemplateFile_MapperImpl.java | 10 +- .../FolderBeanJsonDeserializerImpl.java | 32 ++-- .../folders/FolderBeanJsonSerializerImpl.java | 18 +- .../structure/folders/Folder_MapperImpl.java | 10 +- .../org/dominokit/cli/commands/CLIConfig.java | 5 +- .../cli/commands/GenerateAppCommand.java | 3 +- .../cli/commands/TemplateConfig.java | 6 + .../commands/TemplateDescriptorGenerator.java | 35 ++-- .../cli/generator/MultiModuleGenerator.java | 3 +- .../cli/generator/SingleModuleGenerator.java | 3 +- .../structure/files/FileContentProcessor.java | 4 +- .../files/ResourceFileContentProcessor.java | 19 +- .../cli/structure/files/TemplateFile.java | 16 +- .../files/VelocityContentProcessor.java | 6 +- .../files/VelocityStringContentProcessor.java | 38 ++++ .../app/gwt/basic/__name__-api/.dockerignore | 5 + .../app/gwt/basic/__name__-api/README.md | 54 ++++++ .../app/gwt/basic/__name__-api/pom.xml | 131 ++++++++++++++ .../src/main/docker/Dockerfile.jvm | 54 ++++++ .../src/main/docker/Dockerfile.legacy-jar | 51 ++++++ .../src/main/docker/Dockerfile.native | 27 +++ .../main/docker/Dockerfile.native-distroless | 23 +++ .../GreetingResource.java | 19 ++ .../resources/META-INF/resources/index.html | 170 ++++++++++++++++++ .../src/main/resources/application.properties | 1 + .../src/main/java/__rootPackage__/App.java | 2 +- src/main/resources/app/gwt/basic/pom.xml | 7 +- .../app/gwt/mvp/__name__-api/.dockerignore | 5 + .../app/gwt/mvp/__name__-api/README.md | 54 ++++++ .../app/gwt/mvp/__name__-api/pom.xml | 131 ++++++++++++++ .../src/main/docker/Dockerfile.jvm | 54 ++++++ .../src/main/docker/Dockerfile.legacy-jar | 51 ++++++ .../src/main/docker/Dockerfile.native | 27 +++ .../main/docker/Dockerfile.native-distroless | 23 +++ .../GreetingResource.java | 19 ++ .../resources/META-INF/resources/index.html | 170 ++++++++++++++++++ .../src/main/resources/application.properties | 1 + src/main/resources/app/gwt/mvp/pom.xml | 13 +- .../app/j2cl/basic/__name__-api/.dockerignore | 5 + .../app/j2cl/basic/__name__-api/README.md | 54 ++++++ .../app/j2cl/basic/__name__-api/pom.xml | 131 ++++++++++++++ .../src/main/docker/Dockerfile.jvm | 54 ++++++ .../src/main/docker/Dockerfile.legacy-jar | 51 ++++++ .../src/main/docker/Dockerfile.native | 27 +++ .../main/docker/Dockerfile.native-distroless | 23 +++ .../GreetingResource.java | 19 ++ .../resources/META-INF/resources/index.html | 170 ++++++++++++++++++ .../src/main/resources/application.properties | 1 + .../src/main/java/__rootPackage__/App.java | 2 +- src/main/resources/app/j2cl/basic/pom.xml | 7 +- .../app/j2cl/mvp/__name__-api/.dockerignore | 5 + .../app/j2cl/mvp/__name__-api/README.md | 54 ++++++ .../app/j2cl/mvp/__name__-api/pom.xml | 131 ++++++++++++++ .../src/main/docker/Dockerfile.jvm | 54 ++++++ .../src/main/docker/Dockerfile.legacy-jar | 51 ++++++ .../src/main/docker/Dockerfile.native | 27 +++ .../main/docker/Dockerfile.native-distroless | 23 +++ .../GreetingResource.java | 19 ++ .../resources/META-INF/resources/index.html | 170 ++++++++++++++++++ .../src/main/resources/application.properties | 1 + src/main/resources/app/j2cl/mvp/pom.xml | 13 +- .../template/project/gwt/domino-basic.json | 142 +++++++++++++++ .../template/project/gwt/domino-mvp.json | 113 ++++++++++++ .../template/project/j2cl/domino-basic.json | 142 +++++++++++++++ .../template/project/j2cl/domino-mvp.json | 113 ++++++++++++ 72 files changed, 2882 insertions(+), 138 deletions(-) create mode 100644 src/main/java/org/dominokit/cli/structure/files/VelocityStringContentProcessor.java create mode 100644 src/main/resources/app/gwt/basic/__name__-api/.dockerignore create mode 100644 src/main/resources/app/gwt/basic/__name__-api/README.md create mode 100644 src/main/resources/app/gwt/basic/__name__-api/pom.xml create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.jvm create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native-distroless create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/resources/META-INF/resources/index.html create mode 100644 src/main/resources/app/gwt/basic/__name__-api/src/main/resources/application.properties create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/.dockerignore create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/README.md create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/pom.xml create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.jvm create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/META-INF/resources/index.html create mode 100644 src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/application.properties create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/.dockerignore create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/README.md create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/pom.xml create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.jvm create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native-distroless create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/META-INF/resources/index.html create mode 100644 src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/application.properties create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/.dockerignore create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/README.md create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/pom.xml create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.jvm create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/META-INF/resources/index.html create mode 100644 src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/application.properties diff --git a/build.gradle b/build.gradle index a5867f4..badc90a 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'maven' apply plugin: "com.install4j.gradle" group = 'org.dominokit' -version = '1.0.0-RC1' +version = '1.0.0-RC4' description = "Domino CLI" @@ -36,8 +36,8 @@ dependencies { // https://mvnrepository.com/artifact/org.apache.velocity/velocity-tools compile group: 'org.apache.velocity', name: 'velocity-tools', version: '2.0' - implementation group: 'org.dominokit', name: 'domino-jackson', version: '1.0.0-RC2' - annotationProcessor group: 'org.dominokit', name: 'domino-jackson-processor', version: '1.0.0-RC2' + implementation group: 'org.dominokit', name: 'domino-jackson', version: '1.0.0-RC3' + annotationProcessor group: 'org.dominokit', name: 'domino-jackson-processor', version: '1.0.0-RC3' // https://mvnrepository.com/artifact/org.apache.maven/maven-model-builder compile group: 'org.apache.maven', name: 'maven-model-builder', version: '3.6.1' diff --git a/domino-cli.install4j b/domino-cli.install4j index f868b05..927f5f8 100644 --- a/domino-cli.install4j +++ b/domino-cli.install4j @@ -1,7 +1,7 @@ - + diff --git a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java index e6014c8..7e54f1e 100644 --- a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java +++ b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java @@ -6,24 +6,30 @@ import java.lang.Override; import java.lang.String; import java.util.Map; -import org.dominokit.jacksonapt.JacksonContextProvider; -import org.dominokit.jacksonapt.JsonDeserializationContext; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonDeserializerParameters; -import org.dominokit.jacksonapt.deser.BooleanJsonDeserializer; -import org.dominokit.jacksonapt.deser.StringJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.AbstractBeanJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.BeanPropertyDeserializer; -import org.dominokit.jacksonapt.deser.bean.HasDeserializerAndParameters; -import org.dominokit.jacksonapt.deser.bean.Instance; -import org.dominokit.jacksonapt.deser.bean.InstanceBuilder; -import org.dominokit.jacksonapt.deser.bean.MapLike; -import org.dominokit.jacksonapt.stream.JsonReader; +import org.dominokit.jackson.JacksonContextProvider; +import org.dominokit.jackson.JsonDeserializationContext; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonDeserializerParameters; +import org.dominokit.jackson.deser.BooleanJsonDeserializer; +import org.dominokit.jackson.deser.StringJsonDeserializer; +import org.dominokit.jackson.deser.bean.AbstractBeanJsonDeserializer; +import org.dominokit.jackson.deser.bean.BeanPropertyDeserializer; +import org.dominokit.jackson.deser.bean.HasDeserializerAndParameters; +import org.dominokit.jackson.deser.bean.Instance; +import org.dominokit.jackson.deser.bean.InstanceBuilder; +import org.dominokit.jackson.deser.bean.MapLike; +import org.dominokit.jackson.stream.JsonReader; public final class ProjectBeanJsonDeserializerImpl extends AbstractBeanJsonDeserializer { + private static final ProjectBeanJsonDeserializerImpl INSTANCE = new ProjectBeanJsonDeserializerImpl(); + public ProjectBeanJsonDeserializerImpl() { } + public static ProjectBeanJsonDeserializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getDeserializedType() { return Project.class; diff --git a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java index b0d3c2d..4f2c95f 100644 --- a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java +++ b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java @@ -4,17 +4,23 @@ import java.lang.Class; import java.lang.Override; import java.lang.String; -import org.dominokit.jacksonapt.JsonSerializationContext; -import org.dominokit.jacksonapt.JsonSerializer; -import org.dominokit.jacksonapt.ser.BooleanJsonSerializer; -import org.dominokit.jacksonapt.ser.StringJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.AbstractBeanJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.BeanPropertySerializer; +import org.dominokit.jackson.JsonSerializationContext; +import org.dominokit.jackson.JsonSerializer; +import org.dominokit.jackson.ser.BooleanJsonSerializer; +import org.dominokit.jackson.ser.StringJsonSerializer; +import org.dominokit.jackson.ser.bean.AbstractBeanJsonSerializer; +import org.dominokit.jackson.ser.bean.BeanPropertySerializer; public final class ProjectBeanJsonSerializerImpl extends AbstractBeanJsonSerializer { + private static final ProjectBeanJsonSerializerImpl INSTANCE = new ProjectBeanJsonSerializerImpl(); + public ProjectBeanJsonSerializerImpl() { } + public static ProjectBeanJsonSerializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getSerializedType() { return Project.class; diff --git a/src/main/generated/org/dominokit/cli/model/Project_MapperImpl.java b/src/main/generated/org/dominokit/cli/model/Project_MapperImpl.java index 14971ec..69a2136 100644 --- a/src/main/generated/org/dominokit/cli/model/Project_MapperImpl.java +++ b/src/main/generated/org/dominokit/cli/model/Project_MapperImpl.java @@ -1,9 +1,9 @@ package org.dominokit.cli.model; import java.lang.Override; -import org.dominokit.jacksonapt.AbstractObjectMapper; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonSerializer; +import org.dominokit.jackson.AbstractObjectMapper; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonSerializer; public final class Project_MapperImpl extends AbstractObjectMapper { public static final Project_MapperImpl INSTANCE = new Project_MapperImpl(); @@ -14,11 +14,11 @@ public Project_MapperImpl() { @Override protected JsonDeserializer newDeserializer() { - return new ProjectBeanJsonDeserializerImpl(); + return ProjectBeanJsonDeserializerImpl.getInstance(); } @Override protected JsonSerializer newSerializer() { - return new ProjectBeanJsonSerializerImpl(); + return ProjectBeanJsonSerializerImpl.getInstance(); } } diff --git a/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonDeserializerImpl.java b/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonDeserializerImpl.java index 69082be..be59608 100644 --- a/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonDeserializerImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonDeserializerImpl.java @@ -5,24 +5,30 @@ import java.lang.Override; import java.lang.String; import java.util.Map; -import org.dominokit.jacksonapt.JacksonContextProvider; -import org.dominokit.jacksonapt.JsonDeserializationContext; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonDeserializerParameters; -import org.dominokit.jacksonapt.deser.EnumJsonDeserializer; -import org.dominokit.jacksonapt.deser.StringJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.AbstractBeanJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.BeanPropertyDeserializer; -import org.dominokit.jacksonapt.deser.bean.HasDeserializerAndParameters; -import org.dominokit.jacksonapt.deser.bean.Instance; -import org.dominokit.jacksonapt.deser.bean.InstanceBuilder; -import org.dominokit.jacksonapt.deser.bean.MapLike; -import org.dominokit.jacksonapt.stream.JsonReader; +import org.dominokit.jackson.JacksonContextProvider; +import org.dominokit.jackson.JsonDeserializationContext; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonDeserializerParameters; +import org.dominokit.jackson.deser.EnumJsonDeserializer; +import org.dominokit.jackson.deser.StringJsonDeserializer; +import org.dominokit.jackson.deser.bean.AbstractBeanJsonDeserializer; +import org.dominokit.jackson.deser.bean.BeanPropertyDeserializer; +import org.dominokit.jackson.deser.bean.HasDeserializerAndParameters; +import org.dominokit.jackson.deser.bean.Instance; +import org.dominokit.jackson.deser.bean.InstanceBuilder; +import org.dominokit.jackson.deser.bean.MapLike; +import org.dominokit.jackson.stream.JsonReader; public final class TemplateFileBeanJsonDeserializerImpl extends AbstractBeanJsonDeserializer { + private static final TemplateFileBeanJsonDeserializerImpl INSTANCE = new TemplateFileBeanJsonDeserializerImpl(); + public TemplateFileBeanJsonDeserializerImpl() { } + public static TemplateFileBeanJsonDeserializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getDeserializedType() { return TemplateFile.class; diff --git a/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonSerializerImpl.java b/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonSerializerImpl.java index 750abab..24fe27d 100644 --- a/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonSerializerImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/files/TemplateFileBeanJsonSerializerImpl.java @@ -3,17 +3,23 @@ import java.lang.Class; import java.lang.Override; import java.lang.String; -import org.dominokit.jacksonapt.JsonSerializationContext; -import org.dominokit.jacksonapt.JsonSerializer; -import org.dominokit.jacksonapt.ser.EnumJsonSerializer; -import org.dominokit.jacksonapt.ser.StringJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.AbstractBeanJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.BeanPropertySerializer; +import org.dominokit.jackson.JsonSerializationContext; +import org.dominokit.jackson.JsonSerializer; +import org.dominokit.jackson.ser.EnumJsonSerializer; +import org.dominokit.jackson.ser.StringJsonSerializer; +import org.dominokit.jackson.ser.bean.AbstractBeanJsonSerializer; +import org.dominokit.jackson.ser.bean.BeanPropertySerializer; public final class TemplateFileBeanJsonSerializerImpl extends AbstractBeanJsonSerializer { + private static final TemplateFileBeanJsonSerializerImpl INSTANCE = new TemplateFileBeanJsonSerializerImpl(); + public TemplateFileBeanJsonSerializerImpl() { } + public static TemplateFileBeanJsonSerializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getSerializedType() { return TemplateFile.class; diff --git a/src/main/generated/org/dominokit/cli/structure/files/TemplateFile_MapperImpl.java b/src/main/generated/org/dominokit/cli/structure/files/TemplateFile_MapperImpl.java index f89720d..b6d973c 100644 --- a/src/main/generated/org/dominokit/cli/structure/files/TemplateFile_MapperImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/files/TemplateFile_MapperImpl.java @@ -1,9 +1,9 @@ package org.dominokit.cli.structure.files; import java.lang.Override; -import org.dominokit.jacksonapt.AbstractObjectMapper; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonSerializer; +import org.dominokit.jackson.AbstractObjectMapper; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonSerializer; public final class TemplateFile_MapperImpl extends AbstractObjectMapper { public static final TemplateFile_MapperImpl INSTANCE = new TemplateFile_MapperImpl(); @@ -14,11 +14,11 @@ public TemplateFile_MapperImpl() { @Override protected JsonDeserializer newDeserializer() { - return new TemplateFileBeanJsonDeserializerImpl(); + return TemplateFileBeanJsonDeserializerImpl.getInstance(); } @Override protected JsonSerializer newSerializer() { - return new TemplateFileBeanJsonSerializerImpl(); + return TemplateFileBeanJsonSerializerImpl.getInstance(); } } diff --git a/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonDeserializerImpl.java b/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonDeserializerImpl.java index 89de894..7dab9e6 100644 --- a/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonDeserializerImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonDeserializerImpl.java @@ -8,24 +8,30 @@ import java.util.Map; import org.dominokit.cli.structure.files.TemplateFile; import org.dominokit.cli.structure.files.TemplateFileBeanJsonDeserializerImpl; -import org.dominokit.jacksonapt.JacksonContextProvider; -import org.dominokit.jacksonapt.JsonDeserializationContext; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonDeserializerParameters; -import org.dominokit.jacksonapt.deser.StringJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.AbstractBeanJsonDeserializer; -import org.dominokit.jacksonapt.deser.bean.BeanPropertyDeserializer; -import org.dominokit.jacksonapt.deser.bean.HasDeserializerAndParameters; -import org.dominokit.jacksonapt.deser.bean.Instance; -import org.dominokit.jacksonapt.deser.bean.InstanceBuilder; -import org.dominokit.jacksonapt.deser.bean.MapLike; -import org.dominokit.jacksonapt.deser.collection.ListJsonDeserializer; -import org.dominokit.jacksonapt.stream.JsonReader; +import org.dominokit.jackson.JacksonContextProvider; +import org.dominokit.jackson.JsonDeserializationContext; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonDeserializerParameters; +import org.dominokit.jackson.deser.StringJsonDeserializer; +import org.dominokit.jackson.deser.bean.AbstractBeanJsonDeserializer; +import org.dominokit.jackson.deser.bean.BeanPropertyDeserializer; +import org.dominokit.jackson.deser.bean.HasDeserializerAndParameters; +import org.dominokit.jackson.deser.bean.Instance; +import org.dominokit.jackson.deser.bean.InstanceBuilder; +import org.dominokit.jackson.deser.bean.MapLike; +import org.dominokit.jackson.deser.collection.ListJsonDeserializer; +import org.dominokit.jackson.stream.JsonReader; public final class FolderBeanJsonDeserializerImpl extends AbstractBeanJsonDeserializer { + private static final FolderBeanJsonDeserializerImpl INSTANCE = new FolderBeanJsonDeserializerImpl(); + public FolderBeanJsonDeserializerImpl() { } + public static FolderBeanJsonDeserializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getDeserializedType() { return Folder.class; diff --git a/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonSerializerImpl.java b/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonSerializerImpl.java index e287993..3e39d4f 100644 --- a/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonSerializerImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/folders/FolderBeanJsonSerializerImpl.java @@ -6,17 +6,23 @@ import java.util.List; import org.dominokit.cli.structure.files.TemplateFile; import org.dominokit.cli.structure.files.TemplateFileBeanJsonSerializerImpl; -import org.dominokit.jacksonapt.JsonSerializationContext; -import org.dominokit.jacksonapt.JsonSerializer; -import org.dominokit.jacksonapt.ser.CollectionJsonSerializer; -import org.dominokit.jacksonapt.ser.StringJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.AbstractBeanJsonSerializer; -import org.dominokit.jacksonapt.ser.bean.BeanPropertySerializer; +import org.dominokit.jackson.JsonSerializationContext; +import org.dominokit.jackson.JsonSerializer; +import org.dominokit.jackson.ser.CollectionJsonSerializer; +import org.dominokit.jackson.ser.StringJsonSerializer; +import org.dominokit.jackson.ser.bean.AbstractBeanJsonSerializer; +import org.dominokit.jackson.ser.bean.BeanPropertySerializer; public final class FolderBeanJsonSerializerImpl extends AbstractBeanJsonSerializer { + private static final FolderBeanJsonSerializerImpl INSTANCE = new FolderBeanJsonSerializerImpl(); + public FolderBeanJsonSerializerImpl() { } + public static FolderBeanJsonSerializerImpl getInstance() { + return INSTANCE; + } + @Override public Class getSerializedType() { return Folder.class; diff --git a/src/main/generated/org/dominokit/cli/structure/folders/Folder_MapperImpl.java b/src/main/generated/org/dominokit/cli/structure/folders/Folder_MapperImpl.java index 7df41ad..7a62fdf 100644 --- a/src/main/generated/org/dominokit/cli/structure/folders/Folder_MapperImpl.java +++ b/src/main/generated/org/dominokit/cli/structure/folders/Folder_MapperImpl.java @@ -1,9 +1,9 @@ package org.dominokit.cli.structure.folders; import java.lang.Override; -import org.dominokit.jacksonapt.AbstractObjectMapper; -import org.dominokit.jacksonapt.JsonDeserializer; -import org.dominokit.jacksonapt.JsonSerializer; +import org.dominokit.jackson.AbstractObjectMapper; +import org.dominokit.jackson.JsonDeserializer; +import org.dominokit.jackson.JsonSerializer; public final class Folder_MapperImpl extends AbstractObjectMapper { public static final Folder_MapperImpl INSTANCE = new Folder_MapperImpl(); @@ -14,11 +14,11 @@ public Folder_MapperImpl() { @Override protected JsonDeserializer newDeserializer() { - return new FolderBeanJsonDeserializerImpl(); + return FolderBeanJsonDeserializerImpl.getInstance(); } @Override protected JsonSerializer newSerializer() { - return new FolderBeanJsonSerializerImpl(); + return FolderBeanJsonSerializerImpl.getInstance(); } } diff --git a/src/main/java/org/dominokit/cli/commands/CLIConfig.java b/src/main/java/org/dominokit/cli/commands/CLIConfig.java index 37b3fff..54610f0 100644 --- a/src/main/java/org/dominokit/cli/commands/CLIConfig.java +++ b/src/main/java/org/dominokit/cli/commands/CLIConfig.java @@ -4,6 +4,7 @@ import java.util.List; public class CLIConfig { - - public static final List RESOURCE_EXTENSIONS = Arrays.asList("ico", "png", "jpg"); + public static final List RESOURCE_EXTENSIONS = Arrays.asList("ico", "png", "jpg", "jar"); + public static final List RESOURCE_NAMES = Arrays.asList("mvnw"); + public static final List EXECUTABLE_NAMES = Arrays.asList("run"); } diff --git a/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java b/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java index 32b3741..0d2f474 100644 --- a/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java +++ b/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java @@ -5,6 +5,7 @@ import org.dominokit.cli.PomUtil; import org.dominokit.cli.model.Project; import org.dominokit.cli.structure.files.VelocityContentProcessor; +import org.dominokit.cli.structure.files.VelocityStringContentProcessor; import org.dominokit.cli.structure.folders.Folder; import org.dominokit.cli.structure.folders.Folder_MapperImpl; @@ -100,7 +101,7 @@ public void run() { try { - String projectTemplateConfig = new VelocityContentProcessor(getTemplateByType(j2cl, type), project) + String projectTemplateConfig = new VelocityStringContentProcessor(getTemplateByType(j2cl, type), project) .processedContent(); Folder folder = Folder_MapperImpl.INSTANCE .read(projectTemplateConfig); diff --git a/src/main/java/org/dominokit/cli/commands/TemplateConfig.java b/src/main/java/org/dominokit/cli/commands/TemplateConfig.java index e8d8457..4176f56 100644 --- a/src/main/java/org/dominokit/cli/commands/TemplateConfig.java +++ b/src/main/java/org/dominokit/cli/commands/TemplateConfig.java @@ -11,10 +11,12 @@ public class TemplateConfig { private Path templateRoot; private Path resourcesRoot = Paths.get("src/main/resources"); private final List resourcesExtensions; + private final List resourcesNames; private Map conditions = new HashMap<>(); public TemplateConfig(String name, Path templateRoot) throws IOException { resourcesExtensions = CLIConfig.RESOURCE_EXTENSIONS; + resourcesNames = CLIConfig.RESOURCE_NAMES; this.templateRoot = templateRoot; this.name = name; } @@ -39,6 +41,10 @@ public List getResourcesExtensions() { return resourcesExtensions; } + public List getResourcesNames() { + return resourcesNames; + } + public Map getConditions() { return conditions; } diff --git a/src/main/java/org/dominokit/cli/commands/TemplateDescriptorGenerator.java b/src/main/java/org/dominokit/cli/commands/TemplateDescriptorGenerator.java index 57041bc..b98a1d2 100644 --- a/src/main/java/org/dominokit/cli/commands/TemplateDescriptorGenerator.java +++ b/src/main/java/org/dominokit/cli/commands/TemplateDescriptorGenerator.java @@ -11,7 +11,7 @@ public class TemplateDescriptorGenerator { - public static Folder generate(TemplateConfig config){ + public static Folder generate(TemplateConfig config) { return new TemplateDescriptorGenerator().readFolder(config); } @@ -29,17 +29,17 @@ private void readFolder(TemplateConfig templateConfig, File file, Folder current if (subFile.getName().contains("__rootPackage__")) { finalName = finalName.replace("__rootPackage__", "${rootPackage}"); } - if(subFile.getName().contains("__subpackage__")){ - finalName= finalName.replace("__subpackage__","${subpackage}"); + if (subFile.getName().contains("__subpackage__")) { + finalName = finalName.replace("__subpackage__", "${subpackage}"); } - if(subFile.getName().contains("__name__")){ - finalName= finalName.replace("__name__","${name}"); + if (subFile.getName().contains("__name__")) { + finalName = finalName.replace("__name__", "${name}"); } - if(subFile.getName().contains("__artifactId__")){ - finalName= finalName.replace("__artifactId__","${artifactId}"); + if (subFile.getName().contains("__artifactId__")) { + finalName = finalName.replace("__artifactId__", "${artifactId}"); } - if(subFile.getName().contains("__moduleShortName__")){ - finalName= finalName.replace("__moduleShortName__","${moduleShortName}"); + if (subFile.getName().contains("__moduleShortName__")) { + finalName = finalName.replace("__moduleShortName__", "${moduleShortName}"); } Folder folder = Folder.create(finalName); folder.setCondition(templateConfig.getCondition(subFile)); @@ -48,20 +48,20 @@ private void readFolder(TemplateConfig templateConfig, File file, Folder current } else { TemplateFile templateFile = new TemplateFile(); String finalName = subFile.getName(); - if(finalName.contains("__name__")){ + if (finalName.contains("__name__")) { finalName = finalName.replace("__name__", "${name}"); } - if(finalName.contains("__moduleName__")){ + if (finalName.contains("__moduleName__")) { finalName = finalName.replace("__moduleName__", "${moduleName}"); } - if(finalName.contains("__artifactId__")){ + if (finalName.contains("__artifactId__")) { finalName = finalName.replace("__artifactId__", "${artifactId}"); } - if(subFile.getName().contains("__moduleShortName__")){ - finalName= finalName.replace("__moduleShortName__","${moduleShortName}"); + if (subFile.getName().contains("__moduleShortName__")) { + finalName = finalName.replace("__moduleShortName__", "${moduleShortName}"); } templateFile.setName(finalName); - boolean resource = isResourceType(templateConfig.getResourcesExtensions(), subFile.getName()); + boolean resource = isResourceType(templateConfig.getResourcesExtensions(), templateConfig.getResourcesNames(), subFile.getName()); templateFile.setType(resource ? TemplateType.RESOURCE : TemplateType.VELOCITY); templateFile.setTemplate(templateConfig.templateRelativePath(subFile)); currentFolder.append(templateFile); @@ -70,7 +70,10 @@ private void readFolder(TemplateConfig templateConfig, File file, Folder current } } - private boolean isResourceType(List resourcesExtensions, String name) { + private boolean isResourceType(List resourcesExtensions, List resourcesNames, String name) { + if (resourcesNames.contains(name)) { + return true; + } for (String extension : resourcesExtensions) { if (name.endsWith("." + extension)) { return true; diff --git a/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java b/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java index 4e47fde..c50d189 100644 --- a/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java +++ b/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java @@ -5,6 +5,7 @@ import org.dominokit.cli.PomUtil; import org.dominokit.cli.model.Module; import org.dominokit.cli.structure.files.VelocityContentProcessor; +import org.dominokit.cli.structure.files.VelocityStringContentProcessor; import org.dominokit.cli.structure.folders.Folder; import org.dominokit.cli.structure.folders.Folder_MapperImpl; @@ -17,7 +18,7 @@ public class MultiModuleGenerator { public void generate(Module module) throws IOException { String compiler = module.isJ2cl()?"j2cl":"gwt"; - String projectTemplateConfig = new VelocityContentProcessor("template/module/"+compiler+"/multi.json", module) + String projectTemplateConfig = new VelocityStringContentProcessor("template/module/"+compiler+"/multi.json", module) .processedContent(); Folder folder = Folder_MapperImpl.INSTANCE .read(projectTemplateConfig); diff --git a/src/main/java/org/dominokit/cli/generator/SingleModuleGenerator.java b/src/main/java/org/dominokit/cli/generator/SingleModuleGenerator.java index 991ae38..8470032 100644 --- a/src/main/java/org/dominokit/cli/generator/SingleModuleGenerator.java +++ b/src/main/java/org/dominokit/cli/generator/SingleModuleGenerator.java @@ -5,6 +5,7 @@ import org.dominokit.cli.PomUtil; import org.dominokit.cli.model.Module; import org.dominokit.cli.structure.files.VelocityContentProcessor; +import org.dominokit.cli.structure.files.VelocityStringContentProcessor; import org.dominokit.cli.structure.folders.Folder; import org.dominokit.cli.structure.folders.Folder_MapperImpl; @@ -18,7 +19,7 @@ public void generate(Module module) throws IOException { String compiler = module.isJ2cl()?"j2cl":"gwt"; - String projectTemplateConfig = new VelocityContentProcessor("template/module/"+compiler+"/single.json", module) + String projectTemplateConfig = new VelocityStringContentProcessor("template/module/"+compiler+"/single.json", module) .processedContent(); Folder folder = Folder_MapperImpl.INSTANCE .read(projectTemplateConfig); diff --git a/src/main/java/org/dominokit/cli/structure/files/FileContentProcessor.java b/src/main/java/org/dominokit/cli/structure/files/FileContentProcessor.java index 9b94843..7023a95 100644 --- a/src/main/java/org/dominokit/cli/structure/files/FileContentProcessor.java +++ b/src/main/java/org/dominokit/cli/structure/files/FileContentProcessor.java @@ -1,7 +1,7 @@ package org.dominokit.cli.structure.files; -public interface FileContentProcessor { - String processedContent(); +public interface FileContentProcessor { + T processedContent(); class ProcessContentException extends RuntimeException{ diff --git a/src/main/java/org/dominokit/cli/structure/files/ResourceFileContentProcessor.java b/src/main/java/org/dominokit/cli/structure/files/ResourceFileContentProcessor.java index 97bb5ab..f5c08ca 100644 --- a/src/main/java/org/dominokit/cli/structure/files/ResourceFileContentProcessor.java +++ b/src/main/java/org/dominokit/cli/structure/files/ResourceFileContentProcessor.java @@ -2,14 +2,9 @@ import org.apache.commons.io.IOUtils; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; -import java.util.stream.Stream; -public class ResourceFileContentProcessor implements FileContentProcessor { +public class ResourceFileContentProcessor implements FileContentProcessor { private static final Logger LOGGER = Logger.getLogger(ResourceFileContentProcessor.class.getCanonicalName()); @@ -20,16 +15,12 @@ public ResourceFileContentProcessor(String resourceName) { } @Override - public String processedContent() { - + public byte[] processedContent() { try { - InputStream resourceAsStream = getClass().getClassLoader() - .getResourceAsStream(resourceName); - Stream lines = IOUtils.readLines(resourceAsStream, StandardCharsets.UTF_8).stream(); - String data = lines.collect(Collectors.joining("\n")); - lines.close(); - return data; + byte[] bytes = IOUtils.resourceToByteArray(resourceName, getClass().getClassLoader()); + + return bytes; } catch (Exception e) { throw new ProcessContentException(resourceName, e); } diff --git a/src/main/java/org/dominokit/cli/structure/files/TemplateFile.java b/src/main/java/org/dominokit/cli/structure/files/TemplateFile.java index cf3f73e..9ba7d75 100644 --- a/src/main/java/org/dominokit/cli/structure/files/TemplateFile.java +++ b/src/main/java/org/dominokit/cli/structure/files/TemplateFile.java @@ -1,5 +1,6 @@ package org.dominokit.cli.structure.files; +import org.dominokit.cli.commands.CLIConfig; import org.dominokit.cli.model.IsContext; import org.dominokit.jackson.annotation.JSONMapper; @@ -7,10 +8,13 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.logging.Logger; @JSONMapper public class TemplateFile implements ProjectFile{ + private static final Logger LOGGER = Logger.getLogger(TemplateFile.class.getName()); + private String name; private String template; private TemplateType type = TemplateType.VELOCITY; @@ -43,14 +47,22 @@ public void setType(TemplateType type) { public void write(Path path, IsContext context) throws IOException{ Path targetPath = Paths.get(path.toAbsolutePath().toString(), name); + if(TemplateType.RESOURCE.equals(type)){ write(targetPath, new ResourceFileContentProcessor(template).processedContent()); }else{ write(targetPath, new VelocityContentProcessor(template, context).processedContent()); } + + if(CLIConfig.EXECUTABLE_NAMES.contains(name)){ + boolean result = Paths.get(path.toAbsolutePath().toString(), name).toFile().setExecutable(true); + LOGGER.info("Setting file ["+name+"] as executable result ["+result+"]"); + } + } - private void write(Path targetPath, String content) throws IOException{ - Files.write(targetPath, content.getBytes()); + private void write(Path targetPath, byte[] content) throws IOException{ + Files.write(targetPath, content); + } } diff --git a/src/main/java/org/dominokit/cli/structure/files/VelocityContentProcessor.java b/src/main/java/org/dominokit/cli/structure/files/VelocityContentProcessor.java index 41b2a21..a72070e 100644 --- a/src/main/java/org/dominokit/cli/structure/files/VelocityContentProcessor.java +++ b/src/main/java/org/dominokit/cli/structure/files/VelocityContentProcessor.java @@ -10,7 +10,7 @@ import java.io.StringWriter; -public class VelocityContentProcessor implements FileContentProcessor { +public class VelocityContentProcessor implements FileContentProcessor { private String templateName; private IsContext contextAware; @@ -21,7 +21,7 @@ public VelocityContentProcessor(String templateName, IsContext project) { } @Override - public String processedContent() { + public byte[] processedContent() { VelocityEngine velocityEngine = new VelocityEngine(); velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); velocityEngine.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); @@ -33,6 +33,6 @@ public String processedContent() { StringWriter writer = new StringWriter(); template.merge(contextAware.asContext(), writer); - return writer.toString(); + return writer.toString().getBytes(); } } diff --git a/src/main/java/org/dominokit/cli/structure/files/VelocityStringContentProcessor.java b/src/main/java/org/dominokit/cli/structure/files/VelocityStringContentProcessor.java new file mode 100644 index 0000000..c7b14ec --- /dev/null +++ b/src/main/java/org/dominokit/cli/structure/files/VelocityStringContentProcessor.java @@ -0,0 +1,38 @@ +package org.dominokit.cli.structure.files; + +import org.apache.velocity.Template; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.runtime.RuntimeConstants; +import org.apache.velocity.runtime.log.NullLogChute; +import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; +import org.dominokit.cli.model.IsContext; + +import java.io.StringWriter; + +public class VelocityStringContentProcessor implements FileContentProcessor { + + private String templateName; + private IsContext contextAware; + + public VelocityStringContentProcessor(String templateName, IsContext project) { + this.templateName = templateName; + this.contextAware = project; + } + + @Override + public String processedContent() { + VelocityEngine velocityEngine = new VelocityEngine(); + velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); + velocityEngine.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); + velocityEngine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, NullLogChute.class); + velocityEngine.init(); + + Template template = velocityEngine.getTemplate(templateName); + + StringWriter writer = new StringWriter(); + template.merge(contextAware.asContext(), writer); + + return writer.toString(); + } +} diff --git a/src/main/resources/app/gwt/basic/__name__-api/.dockerignore b/src/main/resources/app/gwt/basic/__name__-api/.dockerignore new file mode 100644 index 0000000..94810d0 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/.dockerignore @@ -0,0 +1,5 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/src/main/resources/app/gwt/basic/__name__-api/README.md b/src/main/resources/app/gwt/basic/__name__-api/README.md new file mode 100644 index 0000000..7f5307f --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/README.md @@ -0,0 +1,54 @@ +# contacts-api project + +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: +```shell script +mvn compile quarkus:dev +``` + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:9090/q/dev/. + +## Packaging and running the application + +The application can be packaged using: +```shell script +mvn package +``` +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. + +If you want to build an _über-jar_, execute the following command: +```shell script +mvn package -Dquarkus.package.type=uber-jar +``` + +The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. + +## Creating a native executable + +You can create a native executable using: +```shell script +mvn package -Pnative +``` + +Or, if you don't have GraalVM installed, you can run the native executable build in a container using: +```shell script +mvn package -Pnative -Dquarkus.native.container-build=true +``` + +You can then execute your native executable with: `./target/contacts-api-1.0.0-SNAPSHOT-runner` + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html. + +## Provided examples + +### RESTEasy JAX-RS example + +REST is easy peasy with this Hello World RESTEasy resource. + +[Related guide section...](https://quarkus.io/guides/contacts-api#the-jax-rs-resources) diff --git a/src/main/resources/app/gwt/basic/__name__-api/pom.xml b/src/main/resources/app/gwt/basic/__name__-api/pom.xml new file mode 100644 index 0000000..d4d2b50 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + ${groupId} + ${name} + ${version} + + ${artifactId}-api + + 3.8.1 + true + 11 + 11 + UTF-8 + UTF-8 + 1.13.3.Final + quarkus-universe-bom + io.quarkus + 1.13.3.Final + 3.0.0-M5 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-resteasy-jackson + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + true + + + + build + generate-code + generate-code-tests + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + ${maven.compiler.parameters} + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + + diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.jvm b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..1d7fb21 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.jvm @@ -0,0 +1,54 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/contacts-api-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-jvm +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=1001 target/quarkus-app/*.jar /deployments/ +COPY --chown=1001 target/quarkus-app/app/ /deployments/app/ +COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..e791653 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,51 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package -Dquarkus.package.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/contacts-api-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-legacy-jar +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/app.jar + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..98a64f0 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native-distroless b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native-distroless new file mode 100644 index 0000000..7051c5c --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native-distroless @@ -0,0 +1,23 @@ +#### +# This Dockerfile is used in order to build a distroless container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-distroless -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM quay.io/quarkus/quarkus-distroless-image:1.0 +COPY target/*-runner /application + +EXPOSE 8080 +USER nonroot + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java b/src/main/resources/app/gwt/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java new file mode 100644 index 0000000..4bad526 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java @@ -0,0 +1,19 @@ +#set($symbol_pound='#') +#set($symbol_dollar='$') +#set($symbol_escape='\' ) +package ${rootPackage}; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "hello"; + } +} \ No newline at end of file diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/META-INF/resources/index.html b/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/META-INF/resources/index.html new file mode 100644 index 0000000..53747f5 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/META-INF/resources/index.html @@ -0,0 +1,170 @@ + + + + + ${name}-api - ${version} + + + + + + +
+
+

Congratulations, you have created a new Quarkus cloud application.

+ +

What is this page?

+ +

This page is served by Quarkus. The source is in + src/main/resources/META-INF/resources/index.html.

+ +

What are your next steps?

+ +

If not already done, run the application in dev mode using: mvn compile quarkus:dev. +

+
    +
  • Your static assets are located in src/main/resources/META-INF/resources.
  • +
  • Configure your application in src/main/resources/application.properties.
  • +
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • +
  • Play with the getting started example code located in src/main/java:
  • +
+
+

RESTEasy JAX-RS example

+

REST is easy peasy with this Hello World RESTEasy resource.

+

@Path: /hello

+

Related guide section...

+
+ +
+
+
+

Application

+
    +
  • GroupId: ${groupId}
  • +
  • ArtifactId: ${artifactId}
  • +
  • Version: ${version}
  • +
  • Quarkus Version: 1.13.3.Final
  • +
+
+
+

Do you like Quarkus?

+
    +
  • Go give it a star on GitHub.
  • +
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/application.properties b/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/application.properties new file mode 100644 index 0000000..7cf3b93 --- /dev/null +++ b/src/main/resources/app/gwt/basic/__name__-api/src/main/resources/application.properties @@ -0,0 +1 @@ +quarkus.http.port=9090 \ No newline at end of file diff --git a/src/main/resources/app/gwt/basic/__name__-client/src/main/java/__rootPackage__/App.java b/src/main/resources/app/gwt/basic/__name__-client/src/main/java/__rootPackage__/App.java index 987f363..49dc4fb 100644 --- a/src/main/resources/app/gwt/basic/__name__-client/src/main/java/__rootPackage__/App.java +++ b/src/main/resources/app/gwt/basic/__name__-client/src/main/java/__rootPackage__/App.java @@ -21,7 +21,7 @@ public class App implements EntryPoint { * This is the entry point method. */ public void onModuleLoad() { - Layout layout = Layout.create("Domino-ui starter") + var layout = Layout.create("Domino-ui starter") .show(ColorScheme.BLUE); layout.getLeftPanel() diff --git a/src/main/resources/app/gwt/basic/pom.xml b/src/main/resources/app/gwt/basic/pom.xml index cf8f8b4..342d988 100644 --- a/src/main/resources/app/gwt/basic/pom.xml +++ b/src/main/resources/app/gwt/basic/pom.xml @@ -9,11 +9,11 @@ pom - 1.8 - 1.8 + 11 + 11 UTF-8 UTF-8 - 1.0.0-RC2 + 1.0.0-RC5 @@ -107,5 +107,6 @@ ${name}-client ${name}-shared ${name}-server + ${name}-api
diff --git a/src/main/resources/app/gwt/mvp/__name__-api/.dockerignore b/src/main/resources/app/gwt/mvp/__name__-api/.dockerignore new file mode 100644 index 0000000..94810d0 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/.dockerignore @@ -0,0 +1,5 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/src/main/resources/app/gwt/mvp/__name__-api/README.md b/src/main/resources/app/gwt/mvp/__name__-api/README.md new file mode 100644 index 0000000..7f5307f --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/README.md @@ -0,0 +1,54 @@ +# contacts-api project + +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: +```shell script +mvn compile quarkus:dev +``` + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:9090/q/dev/. + +## Packaging and running the application + +The application can be packaged using: +```shell script +mvn package +``` +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. + +If you want to build an _über-jar_, execute the following command: +```shell script +mvn package -Dquarkus.package.type=uber-jar +``` + +The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. + +## Creating a native executable + +You can create a native executable using: +```shell script +mvn package -Pnative +``` + +Or, if you don't have GraalVM installed, you can run the native executable build in a container using: +```shell script +mvn package -Pnative -Dquarkus.native.container-build=true +``` + +You can then execute your native executable with: `./target/contacts-api-1.0.0-SNAPSHOT-runner` + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html. + +## Provided examples + +### RESTEasy JAX-RS example + +REST is easy peasy with this Hello World RESTEasy resource. + +[Related guide section...](https://quarkus.io/guides/contacts-api#the-jax-rs-resources) diff --git a/src/main/resources/app/gwt/mvp/__name__-api/pom.xml b/src/main/resources/app/gwt/mvp/__name__-api/pom.xml new file mode 100644 index 0000000..d4d2b50 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + ${groupId} + ${name} + ${version} + + ${artifactId}-api + + 3.8.1 + true + 11 + 11 + UTF-8 + UTF-8 + 1.13.3.Final + quarkus-universe-bom + io.quarkus + 1.13.3.Final + 3.0.0-M5 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-resteasy-jackson + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + true + + + + build + generate-code + generate-code-tests + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + ${maven.compiler.parameters} + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + + diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.jvm b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..1d7fb21 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.jvm @@ -0,0 +1,54 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/contacts-api-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-jvm +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=1001 target/quarkus-app/*.jar /deployments/ +COPY --chown=1001 target/quarkus-app/app/ /deployments/app/ +COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..e791653 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,51 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package -Dquarkus.package.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/contacts-api-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-legacy-jar +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/app.jar + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..98a64f0 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless new file mode 100644 index 0000000..7051c5c --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless @@ -0,0 +1,23 @@ +#### +# This Dockerfile is used in order to build a distroless container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-distroless -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM quay.io/quarkus/quarkus-distroless-image:1.0 +COPY target/*-runner /application + +EXPOSE 8080 +USER nonroot + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java b/src/main/resources/app/gwt/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java new file mode 100644 index 0000000..4bad526 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java @@ -0,0 +1,19 @@ +#set($symbol_pound='#') +#set($symbol_dollar='$') +#set($symbol_escape='\' ) +package ${rootPackage}; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "hello"; + } +} \ No newline at end of file diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/META-INF/resources/index.html b/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/META-INF/resources/index.html new file mode 100644 index 0000000..53747f5 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/META-INF/resources/index.html @@ -0,0 +1,170 @@ + + + + + ${name}-api - ${version} + + + + + + +
+
+

Congratulations, you have created a new Quarkus cloud application.

+ +

What is this page?

+ +

This page is served by Quarkus. The source is in + src/main/resources/META-INF/resources/index.html.

+ +

What are your next steps?

+ +

If not already done, run the application in dev mode using: mvn compile quarkus:dev. +

+
    +
  • Your static assets are located in src/main/resources/META-INF/resources.
  • +
  • Configure your application in src/main/resources/application.properties.
  • +
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • +
  • Play with the getting started example code located in src/main/java:
  • +
+
+

RESTEasy JAX-RS example

+

REST is easy peasy with this Hello World RESTEasy resource.

+

@Path: /hello

+

Related guide section...

+
+ +
+
+
+

Application

+
    +
  • GroupId: ${groupId}
  • +
  • ArtifactId: ${artifactId}
  • +
  • Version: ${version}
  • +
  • Quarkus Version: 1.13.3.Final
  • +
+
+
+

Do you like Quarkus?

+
    +
  • Go give it a star on GitHub.
  • +
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/application.properties b/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/application.properties new file mode 100644 index 0000000..7cf3b93 --- /dev/null +++ b/src/main/resources/app/gwt/mvp/__name__-api/src/main/resources/application.properties @@ -0,0 +1 @@ +quarkus.http.port=9090 \ No newline at end of file diff --git a/src/main/resources/app/gwt/mvp/pom.xml b/src/main/resources/app/gwt/mvp/pom.xml index 288977c..ca73696 100644 --- a/src/main/resources/app/gwt/mvp/pom.xml +++ b/src/main/resources/app/gwt/mvp/pom.xml @@ -21,16 +21,16 @@ pom - 1.8 - 1.8 + 11 + 11 UTF-8 UTF-8 3.9.0 - 1.0.0-RC3 - 1.0.0-RC3 - 1.0.0-RC2 + 1.0.0-RC4 + 1.0.0-RC5 + 1.0.0-RC5 1.0.0-RC3 - 1.0.0-RC3 + 1.0.0-RC8 @@ -135,5 +135,6 @@ ${artifactId}-frontend ${artifactId}-backend + ${artifactId}-api
diff --git a/src/main/resources/app/j2cl/basic/__name__-api/.dockerignore b/src/main/resources/app/j2cl/basic/__name__-api/.dockerignore new file mode 100644 index 0000000..94810d0 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/.dockerignore @@ -0,0 +1,5 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/src/main/resources/app/j2cl/basic/__name__-api/README.md b/src/main/resources/app/j2cl/basic/__name__-api/README.md new file mode 100644 index 0000000..7f5307f --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/README.md @@ -0,0 +1,54 @@ +# contacts-api project + +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: +```shell script +mvn compile quarkus:dev +``` + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:9090/q/dev/. + +## Packaging and running the application + +The application can be packaged using: +```shell script +mvn package +``` +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. + +If you want to build an _über-jar_, execute the following command: +```shell script +mvn package -Dquarkus.package.type=uber-jar +``` + +The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. + +## Creating a native executable + +You can create a native executable using: +```shell script +mvn package -Pnative +``` + +Or, if you don't have GraalVM installed, you can run the native executable build in a container using: +```shell script +mvn package -Pnative -Dquarkus.native.container-build=true +``` + +You can then execute your native executable with: `./target/contacts-api-1.0.0-SNAPSHOT-runner` + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html. + +## Provided examples + +### RESTEasy JAX-RS example + +REST is easy peasy with this Hello World RESTEasy resource. + +[Related guide section...](https://quarkus.io/guides/contacts-api#the-jax-rs-resources) diff --git a/src/main/resources/app/j2cl/basic/__name__-api/pom.xml b/src/main/resources/app/j2cl/basic/__name__-api/pom.xml new file mode 100644 index 0000000..d4d2b50 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + ${groupId} + ${name} + ${version} + + ${artifactId}-api + + 3.8.1 + true + 11 + 11 + UTF-8 + UTF-8 + 1.13.3.Final + quarkus-universe-bom + io.quarkus + 1.13.3.Final + 3.0.0-M5 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-resteasy-jackson + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + true + + + + build + generate-code + generate-code-tests + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + ${maven.compiler.parameters} + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + + diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.jvm b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..1d7fb21 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.jvm @@ -0,0 +1,54 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/contacts-api-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-jvm +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=1001 target/quarkus-app/*.jar /deployments/ +COPY --chown=1001 target/quarkus-app/app/ /deployments/app/ +COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..e791653 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,51 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package -Dquarkus.package.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/contacts-api-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-legacy-jar +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/app.jar + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..98a64f0 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native-distroless b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native-distroless new file mode 100644 index 0000000..7051c5c --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native-distroless @@ -0,0 +1,23 @@ +#### +# This Dockerfile is used in order to build a distroless container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-distroless -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM quay.io/quarkus/quarkus-distroless-image:1.0 +COPY target/*-runner /application + +EXPOSE 8080 +USER nonroot + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java b/src/main/resources/app/j2cl/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java new file mode 100644 index 0000000..4bad526 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java @@ -0,0 +1,19 @@ +#set($symbol_pound='#') +#set($symbol_dollar='$') +#set($symbol_escape='\' ) +package ${rootPackage}; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "hello"; + } +} \ No newline at end of file diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/META-INF/resources/index.html b/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/META-INF/resources/index.html new file mode 100644 index 0000000..53747f5 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/META-INF/resources/index.html @@ -0,0 +1,170 @@ + + + + + ${name}-api - ${version} + + + + + + +
+
+

Congratulations, you have created a new Quarkus cloud application.

+ +

What is this page?

+ +

This page is served by Quarkus. The source is in + src/main/resources/META-INF/resources/index.html.

+ +

What are your next steps?

+ +

If not already done, run the application in dev mode using: mvn compile quarkus:dev. +

+
    +
  • Your static assets are located in src/main/resources/META-INF/resources.
  • +
  • Configure your application in src/main/resources/application.properties.
  • +
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • +
  • Play with the getting started example code located in src/main/java:
  • +
+
+

RESTEasy JAX-RS example

+

REST is easy peasy with this Hello World RESTEasy resource.

+

@Path: /hello

+

Related guide section...

+
+ +
+
+
+

Application

+
    +
  • GroupId: ${groupId}
  • +
  • ArtifactId: ${artifactId}
  • +
  • Version: ${version}
  • +
  • Quarkus Version: 1.13.3.Final
  • +
+
+
+

Do you like Quarkus?

+
    +
  • Go give it a star on GitHub.
  • +
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/application.properties b/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/application.properties new file mode 100644 index 0000000..7cf3b93 --- /dev/null +++ b/src/main/resources/app/j2cl/basic/__name__-api/src/main/resources/application.properties @@ -0,0 +1 @@ +quarkus.http.port=9090 \ No newline at end of file diff --git a/src/main/resources/app/j2cl/basic/__name__-client/src/main/java/__rootPackage__/App.java b/src/main/resources/app/j2cl/basic/__name__-client/src/main/java/__rootPackage__/App.java index 56c159e..a5af993 100644 --- a/src/main/resources/app/j2cl/basic/__name__-client/src/main/java/__rootPackage__/App.java +++ b/src/main/resources/app/j2cl/basic/__name__-client/src/main/java/__rootPackage__/App.java @@ -22,7 +22,7 @@ public class App implements EntryPoint { * This is the entry point method. */ public void onModuleLoad() { - Layout layout = Layout.create("Domino-ui starter") + var layout = Layout.create("Domino-ui starter") .show(ColorScheme.BLUE); layout.getLeftPanel() diff --git a/src/main/resources/app/j2cl/basic/pom.xml b/src/main/resources/app/j2cl/basic/pom.xml index cdafd90..c00c3cf 100644 --- a/src/main/resources/app/j2cl/basic/pom.xml +++ b/src/main/resources/app/j2cl/basic/pom.xml @@ -9,11 +9,11 @@ pom - 1.8 - 1.8 + 11 + 11 UTF-8 UTF-8 - 1.0.0-RC2 + 1.0.0-RC5 @@ -95,5 +95,6 @@ ${name}-client ${name}-shared ${name}-server + ${name}-api
diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/.dockerignore b/src/main/resources/app/j2cl/mvp/__name__-api/.dockerignore new file mode 100644 index 0000000..94810d0 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/.dockerignore @@ -0,0 +1,5 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* +!target/quarkus-app/* \ No newline at end of file diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/README.md b/src/main/resources/app/j2cl/mvp/__name__-api/README.md new file mode 100644 index 0000000..7f5307f --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/README.md @@ -0,0 +1,54 @@ +# contacts-api project + +This project uses Quarkus, the Supersonic Subatomic Java Framework. + +If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . + +## Running the application in dev mode + +You can run your application in dev mode that enables live coding using: +```shell script +mvn compile quarkus:dev +``` + +> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:9090/q/dev/. + +## Packaging and running the application + +The application can be packaged using: +```shell script +mvn package +``` +It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. +Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. + +If you want to build an _über-jar_, execute the following command: +```shell script +mvn package -Dquarkus.package.type=uber-jar +``` + +The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. + +## Creating a native executable + +You can create a native executable using: +```shell script +mvn package -Pnative +``` + +Or, if you don't have GraalVM installed, you can run the native executable build in a container using: +```shell script +mvn package -Pnative -Dquarkus.native.container-build=true +``` + +You can then execute your native executable with: `./target/contacts-api-1.0.0-SNAPSHOT-runner` + +If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html. + +## Provided examples + +### RESTEasy JAX-RS example + +REST is easy peasy with this Hello World RESTEasy resource. + +[Related guide section...](https://quarkus.io/guides/contacts-api#the-jax-rs-resources) diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/pom.xml b/src/main/resources/app/j2cl/mvp/__name__-api/pom.xml new file mode 100644 index 0000000..d4d2b50 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + ${groupId} + ${name} + ${version} + + ${artifactId}-api + + 3.8.1 + true + 11 + 11 + UTF-8 + UTF-8 + 1.13.3.Final + quarkus-universe-bom + io.quarkus + 1.13.3.Final + 3.0.0-M5 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-resteasy-jackson + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + true + + + + build + generate-code + generate-code-tests + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + ${maven.compiler.parameters} + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + + diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.jvm b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..1d7fb21 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.jvm @@ -0,0 +1,54 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/contacts-api-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-jvm +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=1001 target/quarkus-app/*.jar /deployments/ +COPY --chown=1001 target/quarkus-app/app/ /deployments/app/ +COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..e791653 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,51 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# mvn package -Dquarkus.package.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/contacts-api-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/contacts-api-legacy-jar +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 + +ARG JAVA_PACKAGE=java-11-openjdk-headless +ARG RUN_JAVA_VERSION=1.3.8 +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' +# Install java and the run-java script +# Also set up permissions for user `1001` +RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ + && microdnf update \ + && microdnf clean all \ + && mkdir /deployments \ + && chown 1001 /deployments \ + && chmod "g+rwX" /deployments \ + && chown 1001:root /deployments \ + && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ + && chown 1001 /deployments/run-java.sh \ + && chmod 540 /deployments/run-java.sh \ + && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security + +# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/app.jar + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..98a64f0 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless new file mode 100644 index 0000000..7051c5c --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless @@ -0,0 +1,23 @@ +#### +# This Dockerfile is used in order to build a distroless container that runs the Quarkus application in native (no JVM) mode +# +# Before building the container image run: +# +# mvn package -Pnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-distroless -t quarkus/contacts-api . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/contacts-api +# +### +FROM quay.io/quarkus/quarkus-distroless-image:1.0 +COPY target/*-runner /application + +EXPOSE 8080 +USER nonroot + +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java new file mode 100644 index 0000000..4bad526 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java @@ -0,0 +1,19 @@ +#set($symbol_pound='#') +#set($symbol_dollar='$') +#set($symbol_escape='\' ) +package ${rootPackage}; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "hello"; + } +} \ No newline at end of file diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/META-INF/resources/index.html b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/META-INF/resources/index.html new file mode 100644 index 0000000..53747f5 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/META-INF/resources/index.html @@ -0,0 +1,170 @@ + + + + + ${name}-api - ${version} + + + + + + +
+
+

Congratulations, you have created a new Quarkus cloud application.

+ +

What is this page?

+ +

This page is served by Quarkus. The source is in + src/main/resources/META-INF/resources/index.html.

+ +

What are your next steps?

+ +

If not already done, run the application in dev mode using: mvn compile quarkus:dev. +

+
    +
  • Your static assets are located in src/main/resources/META-INF/resources.
  • +
  • Configure your application in src/main/resources/application.properties.
  • +
  • Quarkus now ships with a Dev UI (available in dev mode only)
  • +
  • Play with the getting started example code located in src/main/java:
  • +
+
+

RESTEasy JAX-RS example

+

REST is easy peasy with this Hello World RESTEasy resource.

+

@Path: /hello

+

Related guide section...

+
+ +
+
+
+

Application

+
    +
  • GroupId: ${groupId}
  • +
  • ArtifactId: ${artifactId}
  • +
  • Version: ${version}
  • +
  • Quarkus Version: 1.13.3.Final
  • +
+
+
+

Do you like Quarkus?

+
    +
  • Go give it a star on GitHub.
  • +
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/application.properties b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/application.properties new file mode 100644 index 0000000..7cf3b93 --- /dev/null +++ b/src/main/resources/app/j2cl/mvp/__name__-api/src/main/resources/application.properties @@ -0,0 +1 @@ +quarkus.http.port=9090 \ No newline at end of file diff --git a/src/main/resources/app/j2cl/mvp/pom.xml b/src/main/resources/app/j2cl/mvp/pom.xml index 8bac395..fe390ba 100644 --- a/src/main/resources/app/j2cl/mvp/pom.xml +++ b/src/main/resources/app/j2cl/mvp/pom.xml @@ -9,16 +9,16 @@ pom - 1.8 - 1.8 + 11 + 11 UTF-8 UTF-8 3.8.1 - 1.0.0-RC3 - 1.0.0-RC3 + 1.0.0-RC4 + 1.0.0-RC5 1.0.0-RC3 - 1.0.0-RC2 - 1.0.0-RC3 + 1.0.0-RC5 + 1.0.0-RC8 @@ -97,5 +97,6 @@ ${artifactId}-frontend ${artifactId}-backend + ${artifactId}-api
diff --git a/src/main/resources/template/project/gwt/domino-basic.json b/src/main/resources/template/project/gwt/domino-basic.json index 887d1ba..031f938 100644 --- a/src/main/resources/template/project/gwt/domino-basic.json +++ b/src/main/resources/template/project/gwt/domino-basic.json @@ -209,6 +209,148 @@ "type": "VELOCITY" } ] + }, + { + "name": "${name}-api", + "condition": "true", + "folders": [ + { + "name": "src", + "condition": "true", + "folders": [ + { + "name": "main", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [ + { + "name": "META-INF", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [], + "files": [ + { + "name": "index.html", + "template": "app/gwt/basic/__name__-api/src/main/resources/META-INF/resources/index.html", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [ + { + "name": "application.properties", + "template": "app/gwt/basic/__name__-api/src/main/resources/application.properties", + "type": "VELOCITY" + } + ] + }, + { + "name": "java.${rootPackage}", + "condition": "true", + "folders": [], + "files": [ + { + "name": "GreetingResource.java", + "template": "app/gwt/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java", + "type": "VELOCITY" + } + ] + }, + { + "name": "docker", + "condition": "true", + "folders": [], + "files": [ + { + "name": "Dockerfile.jvm", + "template": "app/gwt/basic/__name__-api/src/main/docker/Dockerfile.jvm", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native-distroless", + "template": "app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native-distroless", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native", + "template": "app/gwt/basic/__name__-api/src/main/docker/Dockerfile.native", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.legacy-jar", + "template": "app/gwt/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [] + } + ], + "files": [ + { + "name": ".dockerignore", + "template": "app/gwt/basic/__name__-api/.dockerignore", + "type": "VELOCITY" + }, + { + "name": "pom.xml", + "template": "app/gwt/basic/__name__-api/pom.xml", + "type": "VELOCITY" + }, + { + "name": "README.md", + "template": "app/gwt/basic/__name__-api/README.md", + "type": "VELOCITY" + } + ] + }, + { + "name": ".idea", + "condition": "true", + "folders": [ + { + "name": "runConfigurations", + "condition": "true", + "folders": [], + "files": [ + { + "name": "${name}-api.xml", + "template": "app/gwt/basic/.idea/runConfigurations/__name__-api.xml", + "type": "VELOCITY" + }, + { + "name": "development.xml", + "template": "app/gwt/basic/.idea/runConfigurations/development.xml", + "type": "VELOCITY" + }, + { + "name": "tomcat.xml", + "template": "app/gwt/basic/.idea/runConfigurations/tomcat.xml", + "type": "VELOCITY" + }, + { + "name": "code_server.xml", + "template": "app/gwt/basic/.idea/runConfigurations/code_server.xml", + "type": "VELOCITY" + } + ] + } + ], + "files": [] } ], "files": [ diff --git a/src/main/resources/template/project/gwt/domino-mvp.json b/src/main/resources/template/project/gwt/domino-mvp.json index cff4a96..7107fd1 100644 --- a/src/main/resources/template/project/gwt/domino-mvp.json +++ b/src/main/resources/template/project/gwt/domino-mvp.json @@ -114,6 +114,114 @@ } ] }, + { + "name": "${name}-api", + "condition": "true", + "folders": [ + { + "name": "src", + "condition": "true", + "folders": [ + { + "name": "main", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [ + { + "name": "META-INF", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [], + "files": [ + { + "name": "index.html", + "template": "app/gwt/mvp/__name__-api/src/main/resources/META-INF/resources/index.html", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [ + { + "name": "application.properties", + "template": "app/gwt/mvp/__name__-api/src/main/resources/application.properties", + "type": "VELOCITY" + } + ] + }, + { + "name": "java.${rootPackage}", + "condition": "true", + "folders": [], + "files": [ + { + "name": "GreetingResource.java", + "template": "app/gwt/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java", + "type": "VELOCITY" + } + ] + }, + { + "name": "docker", + "condition": "true", + "folders": [], + "files": [ + { + "name": "Dockerfile.jvm", + "template": "app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.jvm", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native-distroless", + "template": "app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native", + "template": "app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.native", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.legacy-jar", + "template": "app/gwt/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [] + } + ], + "files": [ + { + "name": ".dockerignore", + "template": "app/gwt/mvp/__name__-api/.dockerignore", + "type": "VELOCITY" + }, + { + "name": "pom.xml", + "template": "app/gwt/mvp/__name__-api/pom.xml", + "type": "VELOCITY" + }, + { + "name": "README.md", + "template": "app/gwt/mvp/__name__-api/README.md", + "type": "VELOCITY" + } + ] + }, { "name": ".idea", "condition": "true", @@ -128,6 +236,11 @@ "template": "app/gwt/mvp/.idea/runConfigurations/process_sources.xml", "type": "VELOCITY" }, + { + "name": "${name}api.xml", + "template": "app/gwt/mvp/.idea/runConfigurations/__name__api.xml", + "type": "VELOCITY" + }, { "name": "${name}-dev.xml", "template": "app/gwt/mvp/.idea/runConfigurations/__name__-dev.xml", diff --git a/src/main/resources/template/project/j2cl/domino-basic.json b/src/main/resources/template/project/j2cl/domino-basic.json index e1dd574..8d56ee8 100644 --- a/src/main/resources/template/project/j2cl/domino-basic.json +++ b/src/main/resources/template/project/j2cl/domino-basic.json @@ -255,6 +255,148 @@ "type": "VELOCITY" } ] + }, + { + "name": "${name}-api", + "condition": "true", + "folders": [ + { + "name": "src", + "condition": "true", + "folders": [ + { + "name": "main", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [ + { + "name": "META-INF", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [], + "files": [ + { + "name": "index.html", + "template": "app/j2cl/basic/__name__-api/src/main/resources/META-INF/resources/index.html", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [ + { + "name": "application.properties", + "template": "app/j2cl/basic/__name__-api/src/main/resources/application.properties", + "type": "VELOCITY" + } + ] + }, + { + "name": "java.${rootPackage}", + "condition": "true", + "folders": [], + "files": [ + { + "name": "GreetingResource.java", + "template": "app/j2cl/basic/__name__-api/src/main/java.__rootPackage__/GreetingResource.java", + "type": "VELOCITY" + } + ] + }, + { + "name": "docker", + "condition": "true", + "folders": [], + "files": [ + { + "name": "Dockerfile.jvm", + "template": "app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.jvm", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native-distroless", + "template": "app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native-distroless", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native", + "template": "app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.native", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.legacy-jar", + "template": "app/j2cl/basic/__name__-api/src/main/docker/Dockerfile.legacy-jar", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [] + } + ], + "files": [ + { + "name": ".dockerignore", + "template": "app/j2cl/basic/__name__-api/.dockerignore", + "type": "VELOCITY" + }, + { + "name": "pom.xml", + "template": "app/j2cl/basic/__name__-api/pom.xml", + "type": "VELOCITY" + }, + { + "name": "README.md", + "template": "app/j2cl/basic/__name__-api/README.md", + "type": "VELOCITY" + } + ] + }, + { + "name": ".idea", + "condition": "true", + "folders": [ + { + "name": "runConfigurations", + "condition": "true", + "folders": [], + "files": [ + { + "name": "${name}-api.xml", + "template": "app/j2cl/basic/.idea/runConfigurations/__name__-api.xml", + "type": "VELOCITY" + }, + { + "name": "development.xml", + "template": "app/j2cl/basic/.idea/runConfigurations/development.xml", + "type": "VELOCITY" + }, + { + "name": "tomcat.xml", + "template": "app/j2cl/basic/.idea/runConfigurations/tomcat.xml", + "type": "VELOCITY" + }, + { + "name": "j2cl_watch.xml", + "template": "app/j2cl/basic/.idea/runConfigurations/j2cl_watch.xml", + "type": "VELOCITY" + } + ] + } + ], + "files": [] } ], "files": [ diff --git a/src/main/resources/template/project/j2cl/domino-mvp.json b/src/main/resources/template/project/j2cl/domino-mvp.json index 87384b3..d47fd11 100644 --- a/src/main/resources/template/project/j2cl/domino-mvp.json +++ b/src/main/resources/template/project/j2cl/domino-mvp.json @@ -179,6 +179,114 @@ } ] }, + { + "name": "${name}-api", + "condition": "true", + "folders": [ + { + "name": "src", + "condition": "true", + "folders": [ + { + "name": "main", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [ + { + "name": "META-INF", + "condition": "true", + "folders": [ + { + "name": "resources", + "condition": "true", + "folders": [], + "files": [ + { + "name": "index.html", + "template": "app/j2cl/mvp/__name__-api/src/main/resources/META-INF/resources/index.html", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [ + { + "name": "application.properties", + "template": "app/j2cl/mvp/__name__-api/src/main/resources/application.properties", + "type": "VELOCITY" + } + ] + }, + { + "name": "java.${rootPackage}", + "condition": "true", + "folders": [], + "files": [ + { + "name": "GreetingResource.java", + "template": "app/j2cl/mvp/__name__-api/src/main/java.__rootPackage__/GreetingResource.java", + "type": "VELOCITY" + } + ] + }, + { + "name": "docker", + "condition": "true", + "folders": [], + "files": [ + { + "name": "Dockerfile.jvm", + "template": "app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.jvm", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native-distroless", + "template": "app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native-distroless", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.native", + "template": "app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.native", + "type": "VELOCITY" + }, + { + "name": "Dockerfile.legacy-jar", + "template": "app/j2cl/mvp/__name__-api/src/main/docker/Dockerfile.legacy-jar", + "type": "VELOCITY" + } + ] + } + ], + "files": [] + } + ], + "files": [] + } + ], + "files": [ + { + "name": ".dockerignore", + "template": "app/j2cl/mvp/__name__-api/.dockerignore", + "type": "VELOCITY" + }, + { + "name": "pom.xml", + "template": "app/j2cl/mvp/__name__-api/pom.xml", + "type": "VELOCITY" + }, + { + "name": "README.md", + "template": "app/j2cl/mvp/__name__-api/README.md", + "type": "VELOCITY" + } + ] + }, { "name": ".idea", "condition": "true", @@ -193,6 +301,11 @@ "template": "app/j2cl/mvp/.idea/runConfigurations/process_sources.xml", "type": "VELOCITY" }, + { + "name": "${name}api.xml", + "template": "app/j2cl/mvp/.idea/runConfigurations/__name__api.xml", + "type": "VELOCITY" + }, { "name": "${name}-dev.xml", "template": "app/j2cl/mvp/.idea/runConfigurations/__name__-dev.xml",