Skip to content

Commit 29008d7

Browse files
authored
Merge pull request #36 from vitruv-tools/31-add-new-attributes-in-meta-model
2 parents 1de0e8f + 9546bd1 commit 29008d7

File tree

152 files changed

+10660
-986
lines changed

Some content is hidden

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

152 files changed

+10660
-986
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
branches:
1010
- main
11+
- develop
1112
# nightly
1213
schedule:
1314
- cron: "0 3 * * *"
@@ -40,6 +41,7 @@ jobs:
4041
--batch-mode
4142
--update-snapshots
4243
--no-transfer-progress
44+
4345
- name: Stage build results (Unix)
4446
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
4547
run: mkdir staging-${{ matrix.os }} && find . -path '*/target/*.jar' -exec cp {} staging-${{ matrix.os }}/ \;
@@ -81,4 +83,22 @@ jobs:
8183
--update-snapshots
8284
--no-transfer-progress
8385
env:
84-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
86+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87+
88+
run-checkstyle:
89+
name: checkstyle check
90+
runs-on: ubuntu-latest
91+
needs: [ verify ]
92+
if: (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
93+
strategy:
94+
fail-fast: true
95+
steps:
96+
- name: Checkout repository
97+
uses: actions/checkout@v5
98+
- name: Run checkstyle
99+
uses: dbelyaev/[email protected]
100+
with:
101+
github_token: ${{ secrets.github_token }}
102+
reporter: github-pr-review
103+
checkstyle_config: checkstyle.xml
104+
checkstyle_version: "10.21.4"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ replay_pid*
2525
/target/
2626
/.idea/
2727
/log/
28+
/docker/keycloak/hsperfdata_keycloak/
29+
/builder/target/
30+
/app/target/

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"java.configuration.updateBuildConfiguration": "automatic"
2+
"java.configuration.updateBuildConfiguration": "automatic",
3+
"java.compile.nullAnalysis.mode": "automatic"
34
}

Methodologist.iml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module version="4">
3+
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
4+
<option name="activeLocationsIds" />
5+
</component>
6+
</module>

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
###Building the application
2+
3+
1. If you don't have mvn, install it at first!
4+
2. Use this commands to build the application:
5+
1. If you work on IntelliJ IDEA, `./mvnw clean install -DskipTests`
6+
2. If installed the maven on your system, `mvn clean install -DskipTests`
7+
8+
###Running the application with your custom configuration file:
9+
10+
1. Use `java -jar target/methadologist.jar --spring.config.location=file:////your/custom/config/path/`
11+
2. Your path should contain an application.properties file
12+
3. Use the application-dev.properties content in your application.properties
13+
14+
###Test containers:
15+
16+
1. Use this command if you have 404 error status code on getting the docker
17+
image `docker pull testcontainers/ryuk:0.3.0`
18+
19+
###Docker commands
20+
21+
1. To remove all containers: `docker rm -f $(docker ps -aqs)`
22+
2. To remove all volumes: `docker volume prune`
23+
3. To rebuild the containers: `docker-compose up --build cryptocurrency`
24+
4. To just up the containers(using cache): `docker-compose up cryptocurrency`
25+
26+
### JPA
27+
28+
1. Add `@Version` annotation in all the entities to let the JPA handles concurrent updates!
29+
For more details you can see [this](https://stackoverflow.com/questions/2572566/java-jpa-version-annotation).
30+
```
31+
@Version
32+
@NotNull
33+
@Builder.Default
34+
private Long version = 0L;
35+
```
36+
- It throws `OptimisticLockException` in the last concurrent update! So, the frontend applications should receive
37+
proper error and take care of the error properly!
38+
- If you have some native update queries you should add take care of versioning yourself.
39+
40+
### Mock Server
41+
42+
1.
43+
44+
Use [this](https://www.mock-server.com/mock_server/creating_expectations.html#button_match_request_by_negative_priority)
45+
link to see more details on the expectations

app/app.iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module version="4">
3+
<component name="AdditionalModuleElements">
4+
<content url="file://$MODULE_DIR$/../app" dumb="true">
5+
<sourceFolder url="file://$MODULE_DIR$/../app/main/java" isTestSource="false" />
6+
<sourceFolder url="file://$MODULE_DIR$/../app/main/resources" type="java-resource" />
7+
<sourceFolder url="file://$MODULE_DIR$/../app/src/test" isTestSource="true" />
8+
</content>
9+
</component>
10+
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
11+
<option name="activeLocationsIds" />
12+
</component>
13+
</module>

app/pom.xml

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>tools.vitruv.methodologist</groupId>
9+
<artifactId>Methodologist</artifactId>
10+
<version>0.0.1-SNAPSHOT</version>
11+
<relativePath>..</relativePath>
12+
</parent>
13+
14+
<artifactId>src</artifactId>
15+
<name>Methodologist - App</name>
16+
<packaging>jar</packaging>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-web</artifactId>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-starter-webflux</artifactId>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-validation</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-security</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-oauth2-client</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springdoc</groupId>
45+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
46+
<version>2.7.0</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-data-jpa</artifactId>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.springframework.data</groupId>
54+
<artifactId>spring-data-jpa</artifactId>
55+
<version>3.4.2</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.hibernate</groupId>
59+
<artifactId>hibernate-core</artifactId>
60+
<version>6.6.5.Final</version>
61+
<type>pom</type>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.postgresql</groupId>
65+
<artifactId>postgresql</artifactId>
66+
<version>42.6.0</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.flywaydb</groupId>
70+
<artifactId>flyway-core</artifactId>
71+
<version>11.2.0</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>org.flywaydb</groupId>
75+
<artifactId>flyway-database-postgresql</artifactId>
76+
</dependency>
77+
<dependency>
78+
<groupId>ch.qos.logback</groupId>
79+
<artifactId>logback-classic</artifactId>
80+
<version>1.4.14</version>
81+
<scope>runtime</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>net.logstash.logback</groupId>
85+
<artifactId>logstash-logback-encoder</artifactId>
86+
<version>8.0</version>
87+
</dependency>
88+
89+
<!-- MapStruct + Lombok -->
90+
<dependency>
91+
<groupId>org.mapstruct</groupId>
92+
<artifactId>mapstruct</artifactId>
93+
<version>1.6.2</version>
94+
</dependency>
95+
<dependency>
96+
<groupId>org.projectlombok</groupId>
97+
<artifactId>lombok</artifactId>
98+
<version>1.18.36</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.keycloak</groupId>
103+
<artifactId>keycloak-spring-boot-starter</artifactId>
104+
<version>25.0.3</version>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.keycloak</groupId>
108+
<artifactId>keycloak-admin-client</artifactId>
109+
<version>25.0.3</version>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.keycloak</groupId>
113+
<artifactId>keycloak-spring-security-adapter</artifactId>
114+
<version>25.0.3</version>
115+
</dependency>
116+
117+
<!-- Dev / Test -->
118+
<dependency>
119+
<groupId>org.springframework.boot</groupId>
120+
<artifactId>spring-boot-devtools</artifactId>
121+
<version>3.4.1</version>
122+
<scope>runtime</scope>
123+
</dependency>
124+
<dependency>
125+
<groupId>com.h2database</groupId>
126+
<artifactId>h2</artifactId>
127+
<scope>test</scope>
128+
</dependency>
129+
<dependency>
130+
<groupId>org.springframework.security</groupId>
131+
<artifactId>spring-security-test</artifactId>
132+
<scope>test</scope>
133+
</dependency>
134+
<dependency>
135+
<groupId>com.squareup.okhttp3</groupId>
136+
<artifactId>mockwebserver</artifactId>
137+
<version>4.12.0</version>
138+
<scope>test</scope>
139+
</dependency>
140+
<dependency>
141+
<groupId>com.squareup.okhttp3</groupId>
142+
<artifactId>okhttp</artifactId>
143+
<version>4.12.0</version>
144+
<scope>test</scope>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.junit.jupiter</groupId>
148+
<artifactId>junit-jupiter-api</artifactId>
149+
<version>5.13.4</version>
150+
<scope>test</scope>
151+
</dependency>
152+
<dependency>
153+
<groupId>org.springframework.boot</groupId>
154+
<artifactId>spring-boot-test-autoconfigure</artifactId>
155+
<version>3.5.5</version>
156+
<scope>test</scope>
157+
</dependency>
158+
<dependency>
159+
<groupId>org.assertj</groupId>
160+
<artifactId>assertj-core</artifactId>
161+
<version>3.27.3</version>
162+
<scope>test</scope>
163+
</dependency>
164+
<dependency>
165+
<groupId>org.springframework.boot</groupId>
166+
<artifactId>spring-boot-starter-oauth2-client</artifactId>
167+
<scope>test</scope>
168+
</dependency>
169+
<dependency>
170+
<groupId>org.springframework.security.oauth.boot</groupId>
171+
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
172+
<version>2.6.8</version>
173+
</dependency>
174+
<dependency>
175+
<groupId>org.junit.jupiter</groupId>
176+
<artifactId>junit-jupiter</artifactId>
177+
<scope>test</scope>
178+
</dependency>
179+
<dependency>
180+
<groupId>org.springframework.boot</groupId>
181+
<artifactId>spring-boot-starter-test</artifactId>
182+
<scope>test</scope>
183+
<exclusions>
184+
<exclusion>
185+
<groupId>org.junit.vintage</groupId>
186+
<artifactId>junit-vintage-engine</artifactId>
187+
</exclusion>
188+
</exclusions>
189+
</dependency>
190+
</dependencies>
191+
192+
<build>
193+
<plugins>
194+
<plugin>
195+
<groupId>org.springframework.boot</groupId>
196+
<artifactId>spring-boot-maven-plugin</artifactId>
197+
<configuration>
198+
<mainClass>tools.vitruv.methodologist.MethodologistApplication</mainClass>
199+
</configuration>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.apache.maven.plugins</groupId>
203+
<artifactId>maven-compiler-plugin</artifactId>
204+
<version>3.13.0</version>
205+
<configuration>
206+
<source>17</source>
207+
<target>17</target>
208+
<annotationProcessorPaths>
209+
<path>
210+
<groupId>org.projectlombok</groupId>
211+
<artifactId>lombok</artifactId>
212+
<version>1.18.36</version>
213+
</path>
214+
<path>
215+
<groupId>org.projectlombok</groupId>
216+
<artifactId>lombok-mapstruct-binding</artifactId>
217+
<version>0.2.0</version>
218+
</path>
219+
<path>
220+
<groupId>org.mapstruct</groupId>
221+
<artifactId>mapstruct-processor</artifactId>
222+
<version>1.6.2</version>
223+
</path>
224+
</annotationProcessorPaths>
225+
</configuration>
226+
</plugin>
227+
<plugin>
228+
<groupId>org.apache.maven.plugins</groupId>
229+
<artifactId>maven-surefire-plugin</artifactId>
230+
<version>3.2.5</version>
231+
<configuration>
232+
<useModulePath>false</useModulePath>
233+
<systemPropertyVariables>
234+
<spring.profiles.active>test</spring.profiles.active>
235+
</systemPropertyVariables>
236+
</configuration>
237+
</plugin>
238+
<plugin>
239+
<groupId>com.diffplug.spotless</groupId>
240+
<artifactId>spotless-maven-plugin</artifactId>
241+
<version>2.43.0</version>
242+
<configuration>
243+
<java>
244+
<googleJavaFormat/>
245+
</java>
246+
</configuration>
247+
<executions>
248+
<execution>
249+
<goals>
250+
<goal>apply</goal>
251+
<goal>check</goal>
252+
</goals>
253+
</execution>
254+
</executions>
255+
</plugin>
256+
<plugin>
257+
<groupId>org.apache.maven.plugins</groupId>
258+
<artifactId>maven-checkstyle-plugin</artifactId>
259+
<configuration>
260+
<configLocation>${basedir}/src/conf/checkstyle.xml</configLocation>
261+
<suppressionsLocation>${basedir}/src/conf/checkstyle-suppressions.xml</suppressionsLocation>
262+
<enableRulesSummary>false</enableRulesSummary>
263+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
264+
</configuration>
265+
</plugin>
266+
</plugins>
267+
268+
<finalName>${project.artifactId}</finalName>
269+
</build>
270+
</project>

0 commit comments

Comments
 (0)