Change Helidon MP release in generated project from 1.x to 2.x (#11076)

* Support Helidon MP server using Helidon 2.4.1

Signed-off-by: tim.quinn@oracle.com <tim.quinn@oracle.com>

* Add unrelated changed sample file(s) after rebase

* Updated generated samples file after rebasing again

* Remove incorrectly 'git add'ed generated file
This commit is contained in:
Tim Quinn 2022-01-24 03:22:50 -06:00 committed by GitHub
parent d91a2e4221
commit 6ac8d9b123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 221 additions and 94 deletions

View File

@ -213,11 +213,12 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
supportingFiles.add(new SupportingFile("ibm-web-ext.xml.mustache", "src/main/webapp/WEB-INF", "ibm-web-ext.xml")
.doNotOverwrite());
} else if(HELIDON_LIBRARY.equals(library)) {
additionalProperties.computeIfAbsent("helidonVersion", key -> "2.4.1");
supportingFiles.add(new SupportingFile("logging.properties.mustache", "src/main/resources", "logging.properties")
.doNotOverwrite());
supportingFiles.add(new SupportingFile("microprofile-config.properties.mustache", "src/main/resources/META-INF", "microprofile-config.properties")
.doNotOverwrite());
supportingFiles.add(new SupportingFile("beans.xml.mustache", "src/main/webapp/META-INF", "beans.xml")
supportingFiles.add(new SupportingFile("beans.xml.mustache", "src/main/resources/META-INF", "beans.xml")
.doNotOverwrite());
} else if(KUMULUZEE_LIBRARY.equals(library)) {
supportingFiles.add(new SupportingFile("config.yaml.mustache", "src/main/resources", "config.yaml"));

View File

@ -16,7 +16,7 @@ The jar can be used in combination with an other project providing the implement
{{/interfaceOnly}}
{{^interfaceOnly}}
To build the server, run this maven command:
To build the server, run this maven command (with JDK 11+):
```bash
mvn package
@ -25,7 +25,7 @@ mvn package
To run the server, run this maven command:
```bash
mvn exec:java
java -jar target/{{artifactId}}.jar
```
You can then call your server endpoints under:

View File

@ -1,18 +1,19 @@
# Example Logging Configuration File
# For more information see $JAVA_HOME/jre/lib/logging.properties
# Send messages to the console
handlers=java.util.logging.ConsoleHandler
# Global default logging level. Can be overridden by specific handlers and loggers
## Send messages to the console
handlers=io.helidon.common.HelidonConsoleHandler
#
## HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread
java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
#
## Global logging level. Can be overridden by specific loggers
.level=INFO
# Helidon Web Server has a custom log formatter that extends SimpleFormatter.
# It replaces "!thread!" with the current thread name
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=io.helidon.webserver.WebServerLogFormatter
java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
# Quiet Weld
org.jboss.level=WARNING
#
# Component specific log levels
#io.helidon.webserver.level=INFO
#io.helidon.config.level=INFO

View File

@ -1,6 +1,11 @@
# Microprofile server properties
# Application properties. This is the default greeting
app.greeting=Hello
# Microprofile server properties
server.port=8080
server.host=0.0.0.0
# Microprofile OpenAPI properties
mp.openapi.scan.disable=true
# Enable the optional MicroProfile Metrics REST.request metrics
metrics.rest-request.enabled=true

View File

@ -16,32 +16,100 @@
{{/parentOverridden}}
<properties>
<mainClass>io.helidon.microprofile.server.Main</mainClass>
<version.lib.helidon>1.2.0</version.lib.helidon>
<!-- pom -->
<helidon.version>{{helidonVersion}}</helidon.version>
<mainClass>io.helidon.microprofile.cdi.Main</mainClass>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<maven.site.skip>true</maven.site.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- plugin versions -->
<version.plugin.compiler>3.8.1</version.plugin.compiler>
<version.plugin.dependency>3.0.0</version.plugin.dependency>
<version.plugin.eclipselink>2.7.5.1</version.plugin.eclipselink>
<version.plugin.exec>1.6.0</version.plugin.exec>
<version.plugin.failsafe>3.0.0-M5</version.plugin.failsafe>
<version.plugin.helidon>2.3.0</version.plugin.helidon>
<version.plugin.helidon-cli>2.3.0</version.plugin.helidon-cli>
<version.plugin.jandex>1.0.6</version.plugin.jandex>
<version.plugin.jar>3.0.2</version.plugin.jar>
<version.lib.microprofile-openapi-api>1.1.2</version.lib.microprofile-openapi-api>
<version.lib.jersey>2.29</version.lib.jersey>
<version.lib.activation-api>1.2.2</version.lib.activation-api>
<version.lib.junit>5.1.0</version.lib.junit>
<version.plugin.os>1.5.0.Final</version.plugin.os>
<version.plugin.protobuf>0.5.1</version.plugin.protobuf>
<version.plugin.resources>2.7</version.plugin.resources>
<version.plugin.surefire>3.0.0-M5</version.plugin.surefire>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.helidon</groupId>
<artifactId>helidon-dependencies</artifactId>
<version>${helidon.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
<artifactId>helidon-microprofile</artifactId>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>${version.plugin.jandex}</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.plugin.compiler}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.plugin.surefire}</version>
<configuration>
<useModulePath>false</useModulePath>
<systemPropertyVariables>
<java.util.logging.config.file>${project.build.outputDirectory}/logging.properties</java.util.logging.config.file>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.plugin.failsafe}</version>
<configuration>
<useModulePath>false</useModulePath>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${version.plugin.dependency}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.plugin.resources}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -51,22 +119,17 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>libs</classpathPrefix>
<mainClass>${mainClass}</mainClass>
<useUniqueVersions>false</useUniqueVersions>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.plugin.compiler}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>${version.plugin.jandex}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@ -76,43 +139,100 @@
<mainClass>${mainClass}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-maven-plugin</artifactId>
<version>${version.plugin.helidon}</version>
</plugin>
<plugin>
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-cli-maven-plugin</artifactId>
<version>${version.plugin.helidon-cli}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-libs</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
<excludeScope>test</excludeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image</id>
<build>
<plugins>
<plugin>
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-maven-plugin</artifactId>
<executions>
<execution>
<id>native-image</id>
<goals>
<goal>native-image</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
<artifactId>helidon-microprofile-2.2</artifactId>
<version>${version.lib.helidon}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.openapi</groupId>
<artifactId>microprofile-openapi-api</artifactId>
<version>${version.lib.microprofile-openapi-api}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>${version.lib.jersey}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>${version.lib.activation-api}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${version.lib.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${version.lib.junit}</version>
<scope>test</scope>
<groupId>io.helidon.integrations.graal</groupId>
<artifactId>helidon-mp-graal-native-image-extension</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>jlink-image</id>
<build>
<plugins>
<plugin>
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jlink-image</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>