-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
pom.xml
202 lines (189 loc) · 10 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
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.1</version>
</parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>3.4.1</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
<module>spring-petclinic-admin-server</module>
<module>spring-petclinic-customers-service</module>
<module>spring-petclinic-vets-service</module>
<module>spring-petclinic-visits-service</module>
<module>spring-petclinic-genai-service</module>
<module>spring-petclinic-config-server</module>
<module>spring-petclinic-discovery-server</module>
<module>spring-petclinic-api-gateway</module>
</modules>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2024.0.0</spring-cloud.version>
<chaos-monkey-spring-boot.version>3.1.0</chaos-monkey-spring-boot.version>
<jolokia-core.version>1.7.1</jolokia-core.version>
<docker.image.prefix>springcommunity</docker.image.prefix>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}</docker.image.dockerfile.dir>
<!-- podman is also supported -->
<container.executable>docker</container.executable>
<!-- By default, the OCI image is build for the linux/amd64 platform -->
<!-- For Apple Silicon M2 Chip you have to change it to the linux/arm64 -->
<container.platform>linux/amd64</container.platform>
<!-- The -load option is a shortcut for or -output=type=docker -->
<!-- Could be changed by the -push option !-->
<container.build.extraarg>--load</container.build.extraarg>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>chaos-monkey-spring-boot</artifactId>
<version>${chaos-monkey-spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
<version>${jolokia-core.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>springboot</id>
<activation>
<file>
<!-- Just a way to identify a Spring Boot application -->
<exists>src/main/resources/application.yml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
<java.version>${java.version}</java.version>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<message>
🚫 Java version error: This project requires Java ${java.version} or higher.
Your current Java version is ${java.version}
To fix this:
1. Download and install Java 17 or higher from your preferred vendor
2. Make sure JAVA_HOME points to the new Java installation
3. Verify with 'java -version' command
4. Run the build again
For more information, check the project documentation.
</message>
<version>${java.version})</version>
</requireJavaVersion>
</rules>
<failFast>true</failFast>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>buildDocker</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>docker-build</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${container.executable}</executable>
<workingDirectory>${docker.image.dockerfile.dir}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-f</argument>
<argument>Dockerfile</argument>
<argument>--build-arg</argument>
<argument>ARTIFACT_NAME=${project.build.finalName}</argument>
<argument>--build-arg</argument>
<argument>EXPOSED_PORT=${docker.image.exposed.port}</argument>
<argument>--platform</argument>
<argument>${container.platform}</argument>
<argument>${container.build.extraarg}</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}</argument>
<argument>${project.build.directory}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>