Skip to content

Commit 2722ef6

Browse files
committed
Add services
1 parent 2037126 commit 2722ef6

116 files changed

Lines changed: 19103 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Online Shop
2+
on:
3+
push:
4+
branches: [ "**" ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Set up JDK
13+
uses: actions/setup-java@v3
14+
with:
15+
java-version: '17'
16+
distribution: 'temurin'
17+
cache: maven
18+
19+
- name: Build customer-care-service
20+
run: mvn clean package -f customer-care-service/pom.xml
21+
22+
- name: Build checkout-service
23+
run: mvn clean package -f checkout-service/pom.xml
24+
25+
- name: Build with Docker
26+
run: docker compose build
27+
28+
- name: Start with Docker
29+
run: docker compose up -d
30+
31+
- name: Stop Docker Containers
32+
run: docker compose down

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
!.github/
3+
!.gitignore
4+
/target/

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Workshop Migration
2+
3+
Willkommen zum Workshop Migration.
4+
5+
## Bauen und starten der Anwendung
6+
7+
Die Anwendung wird mit Docker Compose gebaut und gestartet:
8+
9+
```
10+
docker compose up --build
11+
```
12+
13+
## Aufrufen der Anwendung
14+
15+
Die Anwendung kann unter [Online Shop](http://localhost:4000/shopping-carts/0815) aufgerufen werden.

checkout-service/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
!.gitignore
3+
/src/gen/
4+
/target/

checkout-service/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM maven:3.9.9-eclipse-temurin-21 AS mvn
2+
3+
WORKDIR /usr/src/online-shop
4+
COPY pom.xml ./
5+
RUN mvn package dependency:go-offline # cache dependencies
6+
COPY src ./src
7+
RUN mvn clean package -Dservice.name=checkout-service -DskipTests
8+
9+
FROM eclipse-temurin:21-jre
10+
11+
EXPOSE 8080
12+
COPY --from=mvn /usr/src/online-shop/target/runner/meecrowave-core-runner.jar /opt/meecrowave-runner.jar
13+
COPY --from=mvn /usr/src/online-shop/target/checkout-service.war /opt/checkout-service.war
14+
COPY src/main/resources/log4j2.xml /opt/log4j2.xml
15+
ENTRYPOINT ["java", "--illegal-access=permit", "-Djava.net.preferIPv4Stack=true", "-Dlog4j2.configurationFile=/opt/log4j2.xml", "-jar", "/opt/meecrowave-runner.jar", "--webapp", "/opt/checkout-service.war"]

checkout-service/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# JAX-RS server with OpenAPI
2+
3+
## Overview
4+
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
5+
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
6+
7+
This is an example of building a OpenAPI-enabled JAX-RS server.
8+
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
9+
10+
11+
The JAX-RS implementation needs to be provided by the application server you are deploying on.
12+
13+
To run the server from the command line, you can use maven to provision and start a TomEE Server.
14+
Please execute the following:
15+
16+
```
17+
mvn -Dtomee-embedded-plugin.http=9081 package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run
18+
```
19+
20+
You can then call your server endpoints under:
21+
22+
```
23+
http://localhost:9081/checkout-service/
24+
```
25+
26+
Note that if you have configured the `host` to be something other than localhost, the calls through
27+
swagger-ui will be directed to that host and not localhost!

checkout-service/pom.xml

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- ~ Copyright (C) open knowledge GmbH. ~ ~ Licensed under the Apache License,
3+
Version 2.0 (the "License"); you may not use this file except in compliance
4+
with ~ the License. You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
5+
~ ~ Unless required by applicable law or agreed to in writing, software distributed
6+
under the License is distributed on ~ an "AS IS" BASIS, WITHOUT WARRANTIES
7+
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
8+
the ~ specific language governing permissions and limitations under the License. -->
9+
10+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12+
<modelVersion>4.0.0</modelVersion>
13+
14+
<groupId>de.openkonwledge.sample.shop</groupId>
15+
<artifactId>checkout-service</artifactId>
16+
<version>1.0.0-SNAPSHOT</version>
17+
<packaging>war</packaging>
18+
19+
<properties>
20+
<service.name>online-shop</service.name>
21+
<maven.compiler.source>17</maven.compiler.source>
22+
<maven.compiler.target>17</maven.compiler.target>
23+
<failOnMissingWebXml>false</failOnMissingWebXml>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<meecrowave.version>1.2.13</meecrowave.version>
26+
<junit.version>5.8.2</junit.version>
27+
</properties>
28+
29+
<dependencies>
30+
31+
<dependency>
32+
<groupId>org.apache.meecrowave</groupId>
33+
<artifactId>meecrowave-specs-api</artifactId>
34+
<version>${meecrowave.version}</version>
35+
<scope>provided</scope>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.apache.meecrowave</groupId>
39+
<artifactId>meecrowave-core</artifactId>
40+
<version>${meecrowave.version}</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.thymeleaf</groupId>
45+
<artifactId>thymeleaf</artifactId>
46+
<version>3.0.14.RELEASE</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.geronimo.specs</groupId>
50+
<artifactId>geronimo-validation_2.0_spec</artifactId>
51+
<version>1.0</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.apache.bval</groupId>
55+
<artifactId>bval-jsr</artifactId>
56+
<version>2.0.6</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.eclipse.microprofile.config</groupId>
60+
<artifactId>microprofile-config-api</artifactId>
61+
<version>1.3</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.apache.geronimo.config</groupId>
65+
<artifactId>geronimo-config-impl</artifactId>
66+
<version>1.2.2</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.eclipse.microprofile.openapi</groupId>
70+
<artifactId>microprofile-openapi-api</artifactId>
71+
<version>1.1.2</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>org.apache.geronimo</groupId>
75+
<artifactId>geronimo-openapi-impl</artifactId>
76+
<version>1.0.12</version>
77+
<scope>runtime</scope>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.webjars</groupId>
81+
<artifactId>swagger-ui</artifactId>
82+
<version>5.4.2</version>
83+
<scope>runtime</scope>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>org.apache.commons</groupId>
88+
<artifactId>commons-lang3</artifactId>
89+
<version>3.9</version>
90+
</dependency>
91+
<dependency>
92+
<groupId>org.apache.commons</groupId>
93+
<artifactId>commons-io</artifactId>
94+
<version>1.3.2</version>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.hibernate.orm</groupId>
98+
<artifactId>hibernate-core</artifactId>
99+
<version>6.4.0.Final</version>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.slf4j</groupId>
103+
<artifactId>slf4j-simple</artifactId>
104+
<version>1.7.25</version>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.postgresql</groupId>
108+
<artifactId>postgresql</artifactId>
109+
<version>42.7.0</version>
110+
</dependency>
111+
112+
<dependency>
113+
<groupId>org.junit.jupiter</groupId>
114+
<artifactId>junit-jupiter-api</artifactId>
115+
<version>${junit.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.junit.jupiter</groupId>
120+
<artifactId>junit-jupiter-engine</artifactId>
121+
<version>${junit.version}</version>
122+
<scope>test</scope>
123+
</dependency>
124+
<dependency>
125+
<groupId>org.assertj</groupId>
126+
<artifactId>assertj-core</artifactId>
127+
<version>3.22.0</version>
128+
<scope>test</scope>
129+
</dependency>
130+
<dependency>
131+
<groupId>org.apache.meecrowave</groupId>
132+
<artifactId>meecrowave-junit</artifactId>
133+
<version>${meecrowave.version}</version>
134+
<scope>test</scope>
135+
</dependency>
136+
<dependency>
137+
<groupId>org.testcontainers</groupId>
138+
<artifactId>junit-jupiter</artifactId>
139+
<version>1.19.3</version>
140+
<scope>test</scope>
141+
</dependency>
142+
<dependency>
143+
<groupId>org.testcontainers</groupId>
144+
<artifactId>postgresql</artifactId>
145+
<version>1.19.3</version>
146+
<scope>test</scope>
147+
</dependency>
148+
<dependency>
149+
<groupId>au.com.dius.pact.consumer</groupId>
150+
<artifactId>junit5</artifactId>
151+
<version>4.3.15</version>
152+
<scope>test</scope>
153+
</dependency>
154+
<dependency>
155+
<groupId>au.com.dius.pact.provider</groupId>
156+
<artifactId>junit5</artifactId>
157+
<version>4.3.15</version>
158+
<scope>test</scope>
159+
</dependency>
160+
</dependencies>
161+
<build>
162+
<finalName>${project.artifactId}</finalName>
163+
<plugins>
164+
<plugin>
165+
<groupId>org.apache.maven.plugins</groupId>
166+
<artifactId>maven-surefire-plugin</artifactId>
167+
<version>3.1.2</version>
168+
<configuration>
169+
<systemPropertyVariables>
170+
<org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy>false</org.apache.geronimo.config.configsource.SystemPropertyConfigSource.copy>
171+
</systemPropertyVariables>
172+
</configuration>
173+
</plugin>
174+
<plugin>
175+
<groupId>org.apache.maven.plugins</groupId>
176+
<artifactId>maven-war-plugin</artifactId>
177+
<version>3.4.0</version>
178+
</plugin>
179+
<plugin>
180+
<groupId>org.apache.maven.plugins</groupId>
181+
<artifactId>maven-dependency-plugin</artifactId>
182+
<version>3.6.1</version>
183+
<executions>
184+
<execution>
185+
<id>copy-runner</id>
186+
<phase>package</phase>
187+
<goals>
188+
<goal>copy</goal>
189+
</goals>
190+
<configuration>
191+
<artifactItems>
192+
<artifactItem>
193+
<groupId>org.apache.meecrowave</groupId>
194+
<artifactId>meecrowave-core</artifactId>
195+
<version>${meecrowave-version}</version>
196+
<classifier>runner</classifier>
197+
</artifactItem>
198+
</artifactItems>
199+
<outputDirectory>${project.build.directory}/runner</outputDirectory>
200+
<stripVersion>true</stripVersion>
201+
</configuration>
202+
</execution>
203+
</executions>
204+
</plugin>
205+
</plugins>
206+
</build>
207+
</project>

0 commit comments

Comments
 (0)