|
5 | 5 | <parent> |
6 | 6 | <groupId>org.springframework.boot</groupId> |
7 | 7 | <artifactId>spring-boot-starter-parent</artifactId> |
8 | | - <version>3.4.4</version> |
| 8 | + <version>3.5.6</version> |
9 | 9 | <relativePath/> <!-- lookup parent from repository --> |
10 | 10 | </parent> |
11 | 11 | <groupId>com.capgemini.training</groupId> |
12 | | - <artifactId>appointment-booking-app</artifactId> |
| 12 | + <artifactId>appointment-booking</artifactId> |
13 | 13 | <version>0.0.1-SNAPSHOT</version> |
14 | | - <name>appointment-booking-app</name> |
| 14 | + <name>appointment-booking</name> |
15 | 15 | <description>Demo project for Spring Boot</description> |
16 | | - <url/> |
17 | | - <licenses> |
18 | | - <license/> |
19 | | - </licenses> |
20 | | - <developers> |
21 | | - <developer/> |
22 | | - </developers> |
23 | | - <scm> |
24 | | - <connection/> |
25 | | - <developerConnection/> |
26 | | - <tag/> |
27 | | - <url/> |
28 | | - </scm> |
| 16 | + |
29 | 17 | <properties> |
30 | 18 | <java.version>21</java.version> |
31 | | - <org.mapstruct.version>1.5.5.Final</org.mapstruct.version> |
| 19 | + <org.mapstruct.version>1.6.3</org.mapstruct.version> |
| 20 | + <querydsl.version>5.1.0</querydsl.version> |
| 21 | + <maven-surefire-report-plugin.version>3.5.4</maven-surefire-report-plugin.version> |
| 22 | + <spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version> |
32 | 23 | </properties> |
33 | 24 | <dependencies> |
| 25 | + <!-- 1) Dependencies to run the application on web-server + features to help monitor and manage a Spring Boot application: --> |
| 26 | + <dependency> |
| 27 | + <groupId>org.springframework.boot</groupId> |
| 28 | + <artifactId>spring-boot-starter-test</artifactId> |
| 29 | + <scope>test</scope> |
| 30 | + </dependency> |
34 | 31 | <dependency> |
35 | 32 | <groupId>org.springframework.boot</groupId> |
36 | 33 | <artifactId>spring-boot-starter-actuator</artifactId> |
37 | 34 | </dependency> |
38 | | - <dependency> |
39 | | - <groupId>org.springframework.boot</groupId> |
40 | | - <artifactId>spring-boot-starter-data-jpa</artifactId> |
41 | | - </dependency> |
42 | 35 | <dependency> |
43 | 36 | <groupId>org.springframework.boot</groupId> |
44 | 37 | <artifactId>spring-boot-starter-web</artifactId> |
45 | 38 | </dependency> |
| 39 | + |
| 40 | + <!-- 2) Dependencies to provide data access layer and H2 in-memory database: --> |
| 41 | + <dependency> |
| 42 | + <groupId>org.springframework.boot</groupId> |
| 43 | + <artifactId>spring-boot-starter-data-jpa</artifactId> |
| 44 | + </dependency> |
| 45 | + <dependency> |
| 46 | + <groupId>com.h2database</groupId> |
| 47 | + <artifactId>h2</artifactId> |
| 48 | + <scope>runtime</scope> |
| 49 | + </dependency> |
46 | 50 | <dependency> |
47 | 51 | <groupId>org.flywaydb</groupId> |
48 | 52 | <artifactId>flyway-core</artifactId> |
49 | 53 | </dependency> |
50 | | - <dependency> |
51 | | - <groupId>com.h2database</groupId> |
52 | | - <artifactId>h2</artifactId> |
53 | | - <version>2.2.224</version> |
54 | | - <scope>runtime</scope> |
55 | | - </dependency> |
56 | 54 | <dependency> |
57 | 55 | <groupId>org.projectlombok</groupId> |
58 | 56 | <artifactId>lombok</artifactId> |
59 | 57 | <scope>provided</scope> |
60 | 58 | </dependency> |
61 | | - <dependency> |
62 | | - <groupId>org.springframework.boot</groupId> |
63 | | - <artifactId>spring-boot-starter-test</artifactId> |
64 | | - <scope>test</scope> |
65 | | - </dependency> |
| 59 | + |
| 60 | + <!-- 3) Query DSL advanced queries --> |
66 | 61 | <dependency> |
67 | 62 | <groupId>com.querydsl</groupId> |
68 | | - <artifactId>querydsl-apt</artifactId> |
69 | | - <version>5.1.0</version> |
| 63 | + <artifactId>querydsl-jpa</artifactId> |
| 64 | + <version>${querydsl.version}</version> |
70 | 65 | <classifier>jakarta</classifier> |
71 | | - <scope>provided</scope> |
72 | 66 | </dependency> |
73 | 67 | <dependency> |
74 | 68 | <groupId>com.querydsl</groupId> |
75 | | - <artifactId>querydsl-jpa</artifactId> |
| 69 | + <artifactId>querydsl-apt</artifactId> |
| 70 | + <version>${querydsl.version}</version> |
76 | 71 | <classifier>jakarta</classifier> |
77 | | - <version>5.1.0</version> |
| 72 | + <scope>provided</scope> |
78 | 73 | </dependency> |
| 74 | + |
| 75 | + <!-- 4) Mapstruct --> |
79 | 76 | <dependency> |
80 | 77 | <groupId>org.mapstruct</groupId> |
81 | 78 | <artifactId>mapstruct</artifactId> |
|
87 | 84 | <version>${org.mapstruct.version}</version> |
88 | 85 | <scope>provided</scope> |
89 | 86 | </dependency> |
| 87 | + |
| 88 | + <!-- 5) spring-boot-starter-validation --> |
90 | 89 | <dependency> |
91 | 90 | <groupId>org.springframework.boot</groupId> |
92 | 91 | <artifactId>spring-boot-starter-validation</artifactId> |
|
114 | 113 |
|
115 | 114 | <build> |
116 | 115 | <plugins> |
117 | | - <plugin> |
118 | | - <groupId>org.apache.maven.plugins</groupId> |
119 | | - <artifactId>maven-compiler-plugin</artifactId> |
120 | | - <configuration> |
121 | | - <release>${java.version}</release> |
122 | | - </configuration> |
123 | | - </plugin> |
| 116 | + <!-- |
| 117 | + Not strictly mandatory, but in most Maven-based Spring Boot projects, it's highly recommended, |
| 118 | + because it simplifies packaging and deployment. |
| 119 | + The spring-boot-maven-plugin enables packaging the application as an executable JAR, |
| 120 | + which includes all dependencies and a manifest pointing to the main class. |
| 121 | + It simplifies running the app via `java -jar` and integrates with Maven's lifecycle. |
| 122 | + This plugin is essential for deploying Spring Boot applications and supports features |
| 123 | + like layered JARs for Docker and custom packaging. |
| 124 | + --> |
124 | 125 | <plugin> |
125 | 126 | <groupId>org.springframework.boot</groupId> |
126 | 127 | <artifactId>spring-boot-maven-plugin</artifactId> |
|
133 | 134 | </excludes> |
134 | 135 | </configuration> |
135 | 136 | </plugin> |
| 137 | + |
| 138 | + <!-- Optional, may be omitted: --> |
136 | 139 | <plugin> |
137 | 140 | <groupId>org.flywaydb</groupId> |
138 | 141 | <artifactId>flyway-maven-plugin</artifactId> |
|
143 | 146 | <cleanDisabled>false</cleanDisabled> |
144 | 147 | </configuration> |
145 | 148 | </plugin> |
| 149 | + |
| 150 | + <!-- Unit tests --> |
146 | 151 | <plugin> |
147 | 152 | <groupId>org.apache.maven.plugins</groupId> |
148 | 153 | <artifactId>maven-surefire-plugin</artifactId> |
149 | | - <version>3.5.3</version> |
| 154 | + <configuration> |
| 155 | + <includes> |
| 156 | + <include>**/*Test.java</include> |
| 157 | + <include>**/*Tests.java</include> |
| 158 | + </includes> |
| 159 | + </configuration> |
150 | 160 | </plugin> |
| 161 | + |
| 162 | + <!-- Integration tests --> |
151 | 163 | <plugin> |
152 | 164 | <groupId>org.apache.maven.plugins</groupId> |
153 | 165 | <artifactId>maven-failsafe-plugin</artifactId> |
154 | | - <version>3.5.3</version> |
| 166 | + <configuration> |
| 167 | + <includes> |
| 168 | + <include>**/*IT.java</include> |
| 169 | + </includes> |
| 170 | + </configuration> |
155 | 171 | <executions> |
156 | 172 | <execution> |
157 | 173 | <goals> |
|
161 | 177 | </execution> |
162 | 178 | </executions> |
163 | 179 | </plugin> |
| 180 | + |
| 181 | + <!-- Test reports (for CI pipeline) --> |
164 | 182 | <plugin> |
165 | 183 | <groupId>org.apache.maven.plugins</groupId> |
166 | 184 | <artifactId>maven-surefire-report-plugin</artifactId> |
167 | | - <version>3.5.3</version> |
| 185 | + <version>${maven-surefire-report-plugin.version}</version> |
168 | 186 | <executions> |
169 | 187 | <execution> |
170 | 188 | <phase>verify</phase> |
|
177 | 195 | <aggregate>true</aggregate> |
178 | 196 | </configuration> |
179 | 197 | </plugin> |
180 | | - <plugin> |
181 | | - <groupId>com.mysema.maven</groupId> |
182 | | - <artifactId>apt-maven-plugin</artifactId> |
183 | | - <version>1.1.3</version> |
184 | | - <executions> |
185 | | - <execution> |
186 | | - <goals> |
187 | | - <goal>process</goal> |
188 | | - </goals> |
189 | | - <configuration> |
190 | | - <outputDirectory>target/generated-sources/java</outputDirectory> |
191 | | - <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor> |
192 | | - </configuration> |
193 | | - </execution> |
194 | | - </executions> |
195 | | - </plugin> |
| 198 | + |
| 199 | + <!-- Spotless --> |
196 | 200 | <plugin> |
197 | 201 | <groupId>org.openapitools</groupId> |
198 | 202 | <artifactId>openapi-generator-maven-plugin</artifactId> |
|
239 | 243 | <plugin> |
240 | 244 | <groupId>com.diffplug.spotless</groupId> |
241 | 245 | <artifactId>spotless-maven-plugin</artifactId> |
242 | | - <version>2.43.0</version> |
| 246 | + <version>${spotless-maven-plugin.version}</version> |
243 | 247 | <configuration> |
244 | 248 | <java> |
245 | 249 | <removeUnusedImports/> |
|
254 | 258 | </execution> |
255 | 259 | </executions> |
256 | 260 | </plugin> |
| 261 | + |
| 262 | + <!-- Maven Compiler Plugin with QueryDSL --> |
| 263 | + <plugin> |
| 264 | + <groupId>org.apache.maven.plugins</groupId> |
| 265 | + <artifactId>maven-compiler-plugin</artifactId> |
| 266 | + <configuration> |
| 267 | + <annotationProcessorPaths> |
| 268 | + <path> |
| 269 | + <groupId>org.projectlombok</groupId> |
| 270 | + <artifactId>lombok</artifactId> |
| 271 | + <version>${lombok.version}</version> |
| 272 | + </path> |
| 273 | + <path> |
| 274 | + <groupId>org.mapstruct</groupId> |
| 275 | + <artifactId>mapstruct-processor</artifactId> |
| 276 | + <version>${org.mapstruct.version}</version> |
| 277 | + </path> |
| 278 | + <path> |
| 279 | + <groupId>com.querydsl</groupId> |
| 280 | + <artifactId>querydsl-apt</artifactId> |
| 281 | + <version>${querydsl.version}</version> |
| 282 | + <classifier>jakarta</classifier> |
| 283 | + </path> |
| 284 | + <path> |
| 285 | + <groupId>jakarta.persistence</groupId> |
| 286 | + <artifactId>jakarta.persistence-api</artifactId> |
| 287 | + <version>${jakarta-persistence.version}</version> |
| 288 | + </path> |
| 289 | + </annotationProcessorPaths> |
| 290 | + <generatedSourcesDirectory>target/generated-sources/annotations</generatedSourcesDirectory> |
| 291 | + </configuration> |
| 292 | + </plugin> |
257 | 293 | </plugins> |
258 | 294 | </build> |
259 | 295 | </project> |
0 commit comments