Skip to content

Commit d582448

Browse files
author
Fnraçois-Xavier Robin
committed
initial commit
1 parent 4799ecb commit d582448

32 files changed

+2897
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
/target/
25+
/.classpath

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>api-impl-demo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding//src/main/resources=UTF-8
4+
encoding//src/test/java=UTF-8
5+
encoding/<project>=UTF-8
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
3+
org.eclipse.jdt.core.compiler.compliance=1.8
4+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7+
org.eclipse.jdt.core.compiler.release=disabled
8+
org.eclipse.jdt.core.compiler.source=1.8

pom.xml

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>fr.fxjavadevblog</groupId>
4+
<artifactId>api-implm-demo</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>API Implementation Demo</name>
7+
8+
<properties>
9+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
11+
<maven.compiler.target>1.8</maven.compiler.target>
12+
<maven.compiler.source>1.8</maven.compiler.source>
13+
14+
<quarkus-plugin.version>1.8.3.Final</quarkus-plugin.version>
15+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
16+
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
17+
<quarkus.platform.version>1.8.3.Final</quarkus.platform.version>
18+
19+
<lombok.version>1.18.14</lombok.version>
20+
<commons-lang.version>3.11</commons-lang.version>
21+
22+
<surefire-plugin.version>2.22.2</surefire-plugin.version>
23+
</properties>
24+
25+
<reporting>
26+
<plugins>
27+
<plugin>
28+
<groupId>org.apache.maven.plugins</groupId>
29+
<artifactId>maven-pmd-plugin</artifactId>
30+
<version>3.13.0</version>
31+
</plugin>
32+
</plugins>
33+
</reporting>
34+
35+
36+
<dependencyManagement>
37+
<dependencies>
38+
<dependency>
39+
<groupId>${quarkus.platform.group-id}</groupId>
40+
<artifactId>${quarkus.platform.artifact-id}</artifactId>
41+
<version>${quarkus.platform.version}</version>
42+
<scope>import</scope>
43+
<type>pom</type>
44+
</dependency>
45+
</dependencies>
46+
</dependencyManagement>
47+
48+
<dependencies>
49+
<dependency>
50+
<groupId>org.projectlombok</groupId>
51+
<artifactId>lombok</artifactId>
52+
<version>${lombok.version}</version>
53+
<scope>provided</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.apache.commons</groupId>
58+
<artifactId>commons-lang3</artifactId>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>io.quarkus</groupId>
63+
<artifactId>quarkus-hibernate-orm-panache</artifactId>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>io.quarkus</groupId>
68+
<artifactId>quarkus-hibernate-orm-rest-data-panache</artifactId>
69+
</dependency>
70+
71+
<dependency>
72+
<groupId>io.quarkus</groupId>
73+
<artifactId>quarkus-jackson</artifactId>
74+
</dependency>
75+
76+
<dependency>
77+
<groupId>com.fasterxml.jackson.jaxrs</groupId>
78+
<artifactId>jackson-jaxrs-yaml-provider</artifactId>
79+
</dependency>
80+
81+
<dependency>
82+
<groupId>io.quarkus</groupId>
83+
<artifactId>quarkus-resteasy-jackson</artifactId>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>io.quarkus</groupId>
88+
<artifactId>quarkus-hibernate-validator</artifactId>
89+
</dependency>
90+
<dependency>
91+
<groupId>io.quarkus</groupId>
92+
<artifactId>quarkus-jdbc-h2</artifactId>
93+
</dependency>
94+
95+
<!-- OpenAPI -->
96+
<dependency>
97+
<groupId>io.quarkus</groupId>
98+
<artifactId>quarkus-smallrye-openapi</artifactId>
99+
</dependency>
100+
101+
<!-- Health Check -->
102+
<dependency>
103+
<groupId>io.quarkus</groupId>
104+
<artifactId>quarkus-smallrye-health</artifactId>
105+
</dependency>
106+
107+
<!-- Metrics -->
108+
<dependency>
109+
<groupId>io.quarkus</groupId>
110+
<artifactId>quarkus-smallrye-metrics</artifactId>
111+
</dependency>
112+
113+
<!-- TEST DEPS -->
114+
<!-- quarkus et JUnit 5 -->
115+
<dependency>
116+
<groupId>io.quarkus</groupId>
117+
<artifactId>quarkus-junit5</artifactId>
118+
<scope>test</scope>
119+
</dependency>
120+
121+
<!-- Rest Assured -->
122+
<dependency>
123+
<groupId>io.rest-assured</groupId>
124+
<artifactId>rest-assured</artifactId>
125+
<scope>test</scope>
126+
</dependency>
127+
128+
</dependencies>
129+
130+
<build>
131+
<plugins>
132+
133+
<!-- compilation classique avec MAVEN -->
134+
<plugin>
135+
<artifactId>maven-compiler-plugin</artifactId>
136+
<version>3.8.1</version>
137+
</plugin>
138+
139+
<!-- plugin Quarkus -->
140+
<plugin>
141+
<groupId>io.quarkus</groupId>
142+
<artifactId>quarkus-maven-plugin</artifactId>
143+
<version>${quarkus-plugin.version}</version>
144+
<executions>
145+
<execution>
146+
<goals>
147+
<goal>build</goal>
148+
</goals>
149+
</execution>
150+
</executions>
151+
</plugin>
152+
153+
<!-- tests unitaires -->
154+
<plugin>
155+
<artifactId>maven-surefire-plugin</artifactId>
156+
<version>${surefire-plugin.version}</version>
157+
<configuration>
158+
<excludes>
159+
<exclude>**/IT_*.java</exclude>
160+
</excludes>
161+
<systemProperties>
162+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
163+
</systemProperties>
164+
<skipTests>${skip.surefire.tests}</skipTests>
165+
</configuration>
166+
</plugin>
167+
168+
</plugins>
169+
</build>
170+
171+
<!-- profile pour builder l'application native avec GraalVM -->
172+
<profiles>
173+
<profile>
174+
<id>native</id>
175+
<activation>
176+
<property>
177+
<name>native</name>
178+
</property>
179+
</activation>
180+
<build>
181+
<plugins>
182+
<plugin>
183+
<groupId>io.quarkus</groupId>
184+
<artifactId>quarkus-maven-plugin</artifactId>
185+
<version>${quarkus-plugin.version}</version>
186+
<executions>
187+
<execution>
188+
<goals>
189+
<goal>native-image</goal>
190+
</goals>
191+
<configuration>
192+
<enableHttpUrlHandler>true</enableHttpUrlHandler>
193+
</configuration>
194+
</execution>
195+
</executions>
196+
</plugin>
197+
<plugin>
198+
<groupId>org.apache.maven.plugins</groupId>
199+
<artifactId>maven-failsafe-plugin</artifactId>
200+
<version>${surefire-plugin.version}</version>
201+
<executions>
202+
<execution>
203+
<goals>
204+
<goal>integration-test</goal>
205+
<goal>verify</goal>
206+
</goals>
207+
<configuration>
208+
<systemProperties>
209+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
210+
</systemProperties>
211+
</configuration>
212+
</execution>
213+
</executions>
214+
</plugin>
215+
</plugins>
216+
</build>
217+
</profile>
218+
</profiles>
219+
220+
<distributionManagement>
221+
<repository>
222+
<id>github</id>
223+
<name>GitHub Packages</name>
224+
<url>https://maven.pkg.github.com/fxrobin/quarkus-h2</url>
225+
</repository>
226+
</distributionManagement>
227+
228+
</project>

src/main/docker/Dockerfile.jvm

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
####
2+
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
3+
#
4+
# Before building the docker image run:
5+
#
6+
# mvn package
7+
#
8+
# Then, build the image with:
9+
#
10+
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/artemis-jms-jvm .
11+
#
12+
# Then run the container using:
13+
#
14+
# docker run -i --rm -p 8080:8080 quarkus/artemis-jms-jvm
15+
#
16+
###
17+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1
18+
19+
ARG JAVA_PACKAGE=java-1.8.0-openjdk-headless
20+
ARG RUN_JAVA_VERSION=1.3.5
21+
22+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
23+
24+
# Install java and the run-java script
25+
# Also set up permissions for user `1001`
26+
RUN microdnf install openssl curl ca-certificates ${JAVA_PACKAGE} \
27+
&& microdnf update \
28+
&& microdnf clean all \
29+
&& mkdir /deployments \
30+
&& chown 1001 /deployments \
31+
&& chmod "g+rwX" /deployments \
32+
&& chown 1001:root /deployments \
33+
&& 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 \
34+
&& chown 1001 /deployments/run-java.sh \
35+
&& chmod 540 /deployments/run-java.sh \
36+
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
37+
38+
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
39+
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
40+
41+
COPY target/lib/* /deployments/lib/
42+
COPY target/*-runner.jar /deployments/app.jar
43+
44+
EXPOSE 8080
45+
USER 1001
46+
47+
ENTRYPOINT [ "/deployments/run-java.sh" ]

src/main/docker/Dockerfile.native

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
####
2+
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
3+
#
4+
# Before building the docker image run:
5+
#
6+
# mvn package -Pnative -Dquarkus.native.container-build=true
7+
#
8+
# Then, build the image with:
9+
#
10+
# docker build -f src/main/docker/Dockerfile.native -t quarkus/artemis-jms .
11+
#
12+
# Then run the container using:
13+
#
14+
# docker run -i --rm -p 8080:8080 quarkus/artemis-jms
15+
#
16+
###
17+
FROM registry.access.redhat.com/ubi8/ubi-minimal
18+
WORKDIR /work/
19+
COPY target/*-runner /work/application
20+
RUN chmod 775 /work
21+
EXPOSE 8080
22+
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package fr.fxjavadevblog.aid;
2+
3+
import javax.ws.rs.core.Application;
4+
5+
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
6+
import org.eclipse.microprofile.openapi.annotations.info.Contact;
7+
import org.eclipse.microprofile.openapi.annotations.info.Info;
8+
import org.eclipse.microprofile.openapi.annotations.info.License;
9+
10+
@OpenAPIDefinition(
11+
info = @Info(
12+
title = "Simple API over video games catalog of ATARI ST",
13+
version = "1.0.0",
14+
description = "Give read access to every video games for the ATARI ST",
15+
license = @License(name = "Apache 2.0", url = "https://www.fxjavadevblog.fr"),
16+
contact = @Contact(url = "https://www.fxjavadevblog.fr", name = "François-Xavier Robin", email = "[email protected]")
17+
)
18+
)
19+
public class ApiDefinition extends Application
20+
{
21+
22+
}

0 commit comments

Comments
 (0)