-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
268 lines (246 loc) · 10.6 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>esmf-sdk-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<!-- General settings -->
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<generated-sources>${project.basedir}/src-gen</generated-sources>
<!-- Regular dependencies -->
<esmf-sdk.version>2.9.7</esmf-sdk.version>
<!-- Test dependencies -->
<assertj-core.version>3.26.3</assertj-core.version>
<junit-jupiter.version>5.11.3</junit-jupiter.version>
<jackson.version>2.18.1</jackson.version>
<wiremock.version>3.9.2</wiremock.version>
<!-- Plugin versions -->
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
<maven-scm-plugin.version>2.1.0</maven-scm-plugin.version>
<openapi-generator-maven-plugin.version>7.9.0</openapi-generator-maven-plugin.version>
<versions-maven-plugin.version>2.17.1</versions-maven-plugin.version>
</properties>
<dependencies>
<!-- Regular dependencies -->
<dependency>
<groupId>org.eclipse.esmf</groupId>
<artifactId>esmf-aspect-model-starter</artifactId>
<version>${esmf-sdk.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.esmf</groupId>
<artifactId>esmf-aspect-meta-model-java</artifactId>
<version>${esmf-sdk.version}</version>
</dependency>
<!-- Runtime dependencies needed for the code generated by the openapi-generator with java-wiremock template -->
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>${wiremock.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- This plugin will clone the CatenaX Aspect Models -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>${maven-scm-plugin.version}</version>
<executions>
<execution>
<id>clone-sldt-semantic-models</id>
<phase>initialize</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<connectionUrl>scm:git:https://github.com/eclipse-tractusx/sldt-semantic-models.git</connectionUrl>
<checkoutDirectory>${project.basedir}/sldt-semantic-models</checkoutDirectory>
<scmVersionType>tag</scmVersionType>
<scmVersion>v24.05</scmVersion>
<skipCheckoutIfExists>true</skipCheckoutIfExists>
</configuration>
</execution>
</executions>
</plugin>
<!-- Configures versions plugin to ignore alpha/beta/milestone versions when running mvn versions:display-property-updates -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<ignoredVersions>.*[\.-](?i)(alpha|beta|(rc[0-9]+)|(m\d+)).*</ignoredVersions>
</configuration>
</plugin>
<!-- Generates artifacts for Aspect Models -->
<plugin>
<groupId>org.eclipse.esmf</groupId>
<artifactId>esmf-aspect-model-maven-plugin</artifactId>
<version>${esmf-sdk.version}</version>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
<configuration>
<modelsRootDirectory>${project.basedir}/sldt-semantic-models</modelsRootDirectory>
<outputDirectory>${generated-sources}/main/java</outputDirectory>
<detailedValidationMessages>true</detailedValidationMessages>
<includes>
<include>urn:samm:io.catenax.part_as_planned:2.0.0#PartAsPlanned</include>
</includes>
</configuration>
<executions>
<!-- Generate regular Java classes (POJO) -->
<execution>
<id>generate-java-classes</id>
<phase>generate-sources</phase>
<goals>
<goal>generateJavaClasses</goal>
</goals>
<configuration>
<packageName>io.catenax.part_as_planned</packageName>
</configuration>
</execution>
<!-- Generate Static (meta) classes -->
<execution>
<id>generate-static-java-classes</id>
<phase>generate-sources</phase>
<goals>
<goal>generateStaticJavaClasses</goal>
</goals>
<configuration>
<packageName>io.catenax.part_as_planned</packageName>
</configuration>
</execution>
<execution>
<id>generate-openapi-spec</id>
<!-- Run it at generate-sources so that it happens before execution of the openapi-generator-maven-plugin -->
<phase>generate-sources</phase>
<goals>
<goal>generateOpenApiSpec</goal>
</goals>
<configuration>
<aspectApiBaseUrl>http://example.com</aspectApiBaseUrl>
<aspectResourcePath>/part-as-planned</aspectResourcePath>
<outputDirectory>${generated-sources}/main/resources</outputDirectory>
<outputFormat>yaml</outputFormat>
<excludePaging>true</excludePaging>
</configuration>
</execution>
<execution>
<id>generate-json-schema</id>
<phase>generate-resources</phase>
<goals>
<goal>generateJsonSchema</goal>
</goals>
<configuration>
<outputDirectory>${generated-sources}/main/resources</outputDirectory>
<language>en</language>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-maven-plugin.version}</version>
<configuration>
<output>${generated-sources}</output>
</configuration>
<executions>
<execution>
<id>generate-implementation-from-openapi</id>
<!-- Run it at generate-sources so that it happens after execution of the OpenAPI spec generation -->
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${generated-sources}/main/resources/PartAsPlanned.oai.yaml</inputSpec>
<!-- Change this to whatever you need -->
<generatorName>java-wiremock</generatorName>
<configOptions>
<sourceFolder>main/java</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<!-- Adds the src-gen folder (where generated Java Code will end up) as part of the sources -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<execution>
<id>add-source</id>
<phase>initialize</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${generated-sources}/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>initialize</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${generated-sources}/main/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Configures mvn clean to also clean up generated sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<configuration>
<filesets>
<fileset>
<directory>${generated-sources}</directory>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>