|
7 | 7 | <version>1.0.0-SNAPSHOT</version> |
8 | 8 |
|
9 | 9 | <properties> |
10 | | - <compiler-plugin.version>3.15.0</compiler-plugin.version> |
| 10 | + <!-- Java release level for the compiler (source/target) --> |
11 | 11 | <maven.compiler.release>21</maven.compiler.release> |
| 12 | + |
| 13 | + <!-- Maven Compiler Plugin: plugin version used to compile the project --> |
| 14 | + <compiler-plugin.version>3.15.0</compiler-plugin.version> |
| 15 | + <!-- Versions plugin: used for dependency/version updates --> |
| 16 | + <versions-plugin.version>2.21.0</versions-plugin.version> |
| 17 | + |
| 18 | + <!-- Encoding properties: ensure consistent encoding across all plugins and reports --> |
12 | 19 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
13 | 20 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| 21 | + |
| 22 | + <!-- Quarkus platform BOM coordinates --> |
14 | 23 | <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> |
15 | 24 | <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> |
16 | 25 | <quarkus.platform.version>3.31.2</quarkus.platform.version> |
| 26 | + |
| 27 | + <!-- Testing dependencies versions --> |
17 | 28 | <surefire-plugin.version>3.5.4</surefire-plugin.version> |
18 | 29 | <testcontainers.version>1.21.4</testcontainers.version> |
19 | | - <versions-plugin.version>2.21.0</versions-plugin.version> |
20 | | - <quarkus-cucumber.version>1.3.0</quarkus-cucumber.version> |
21 | 30 | <cucumber.version>7.34.2</cucumber.version> |
| 31 | + <quarkus-cucumber.version>1.3.0</quarkus-cucumber.version> |
22 | 32 |
|
| 33 | + <!-- For reproducible builds --> |
23 | 34 | <project.build.outputTimestamp>2026-02-07T15:00:00Z</project.build.outputTimestamp> |
24 | 35 | </properties> |
25 | 36 |
|
| 37 | + <!-- Import Quarkus platform BOM for dependency version management --> |
| 38 | + <!-- This ensures that all Quarkus dependencies use compatible versions as defined by the platform BOM --> |
| 39 | + <!-- Not loaded as a regular dependency, but used to manage versions of Quarkus dependencies in the project --> |
26 | 40 | <dependencyManagement> |
27 | 41 | <dependencies> |
28 | 42 | <dependency> |
|
36 | 50 | </dependencyManagement> |
37 | 51 |
|
38 | 52 | <dependencies> |
| 53 | + <!-- Quarkus dependencies: these are the libraries that provide the functionality for the application, such as REST endpoints, database access, JSON handling, etc. --> |
| 54 | + |
| 55 | + <!-- Database and ORM --> |
39 | 56 | <dependency> |
40 | 57 | <groupId>io.quarkus</groupId> |
41 | | - <artifactId>quarkus-rest-jackson</artifactId> |
| 58 | + <artifactId>quarkus-jdbc-postgresql</artifactId> |
42 | 59 | </dependency> |
43 | 60 | <dependency> |
44 | 61 | <groupId>io.quarkus</groupId> |
45 | | - <artifactId>quarkus-rest-client-jackson</artifactId> |
| 62 | + <artifactId>quarkus-hibernate-orm-rest-data-panache</artifactId> |
46 | 63 | </dependency> |
| 64 | + |
| 65 | + <!-- Rest and JSON handling --> |
47 | 66 | <dependency> |
48 | 67 | <groupId>io.quarkus</groupId> |
49 | | - <artifactId>quarkus-jdbc-postgresql</artifactId> |
| 68 | + <artifactId>quarkus-rest-jackson</artifactId> |
50 | 69 | </dependency> |
51 | 70 | <dependency> |
52 | 71 | <groupId>io.quarkus</groupId> |
53 | | - <artifactId>quarkus-hibernate-orm-rest-data-panache</artifactId> |
| 72 | + <artifactId>quarkus-rest-client-jackson</artifactId> |
54 | 73 | </dependency> |
| 74 | + |
| 75 | + <!-- OpenAPI and Health --> |
55 | 76 | <dependency> |
56 | 77 | <groupId>io.quarkus</groupId> |
57 | 78 | <artifactId>quarkus-smallrye-openapi</artifactId> |
|
60 | 81 | <groupId>io.quarkus</groupId> |
61 | 82 | <artifactId>quarkus-smallrye-health</artifactId> |
62 | 83 | </dependency> |
| 84 | + |
| 85 | + <!-- Dependency injection --> |
63 | 86 | <dependency> |
64 | 87 | <groupId>io.quarkus</groupId> |
65 | 88 | <artifactId>quarkus-arc</artifactId> |
66 | 89 | </dependency> |
| 90 | + |
| 91 | + <!-- Container image building --> |
67 | 92 | <dependency> |
68 | 93 | <groupId>io.quarkus</groupId> |
69 | 94 | <artifactId>quarkus-container-image-jib</artifactId> |
70 | 95 | </dependency> |
| 96 | + |
| 97 | + <!-- Testing dependencies: these are used for writing and running tests, |
| 98 | + including unit tests, integration tests, and end-to-end tests. |
| 99 | + They include libraries for testing frameworks, mocking, test containers, a |
| 100 | + nd Cucumber for BDD testing. --> |
| 101 | + <!-- Quarkus testing support --> |
71 | 102 | <dependency> |
72 | 103 | <groupId>io.quarkus</groupId> |
73 | 104 | <artifactId>quarkus-junit</artifactId> |
74 | 105 | <scope>test</scope> |
75 | 106 | </dependency> |
| 107 | + <!-- REST-assured for testing REST endpoints --> |
76 | 108 | <dependency> |
77 | 109 | <groupId>io.rest-assured</groupId> |
78 | 110 | <artifactId>rest-assured</artifactId> |
79 | 111 | <scope>test</scope> |
80 | 112 | </dependency> |
| 113 | + <!-- Mockito for mocking dependencies in tests --> |
| 114 | + <dependency> |
| 115 | + <groupId>org.mockito</groupId> |
| 116 | + <artifactId>mockito-core</artifactId> |
| 117 | + <scope>test</scope> |
| 118 | + </dependency> |
81 | 119 | <dependency> |
82 | 120 | <groupId>io.quarkus</groupId> |
83 | 121 | <artifactId>quarkus-junit-mockito</artifactId> |
84 | 122 | <scope>test</scope> |
85 | 123 | </dependency> |
| 124 | + <!-- Testcontainers for integration testing with containers --> |
86 | 125 | <dependency> |
87 | 126 | <groupId>org.testcontainers</groupId> |
88 | 127 | <artifactId>testcontainers</artifactId> |
|
95 | 134 | <version>${testcontainers.version}</version> |
96 | 135 | <scope>test</scope> |
97 | 136 | </dependency> |
98 | | - <dependency> |
99 | | - <groupId>org.mockito</groupId> |
100 | | - <artifactId>mockito-core</artifactId> |
101 | | - <scope>test</scope> |
102 | | - </dependency> |
| 137 | + <!-- Cucumber for Behavior Driven Development (BDD) testing --> |
| 138 | + <!-- quarkus-cucumber provides integration between Cucumber and Quarkus, |
| 139 | + allowing you to write BDD tests that can leverage Quarkus features |
| 140 | + and run in the same environment as your application --> |
103 | 141 | <dependency> |
104 | 142 | <groupId>io.quarkiverse.cucumber</groupId> |
105 | 143 | <artifactId>quarkus-cucumber</artifactId> |
|
122 | 160 | </dependencies> |
123 | 161 |
|
124 | 162 | <build> |
| 163 | + <!-- Plugin management: defines versions and configuration for plugins |
| 164 | + used in the build, such as the Quarkus Maven plugin for building the |
| 165 | + application, the Surefire plugin for running tests, and plugins for |
| 166 | + code quality and coverage analysis. --> |
125 | 167 | <plugins> |
126 | 168 | <plugin> |
| 169 | + <!-- Quarkus Maven plugin: used to build the Quarkus application, |
| 170 | + generate code, and create native images. It is configured to |
| 171 | + execute goals for building the application, generating code, |
| 172 | + and running the native image agent. --> |
127 | 173 | <groupId>${quarkus.platform.group-id}</groupId> |
128 | 174 | <artifactId>quarkus-maven-plugin</artifactId> |
129 | 175 | <version>${quarkus.platform.version}</version> |
|
139 | 185 | </execution> |
140 | 186 | </executions> |
141 | 187 | </plugin> |
| 188 | + <!-- Compiler plugin: used to compile the Java source code. |
| 189 | + It is configured to include parameter names in the compiled bytecode, |
| 190 | + which can be useful for reflection and testing. --> |
142 | 191 | <plugin> |
143 | 192 | <artifactId>maven-compiler-plugin</artifactId> |
144 | 193 | <version>${compiler-plugin.version}</version> |
|
165 | 214 | </configuration> |
166 | 215 | </plugin> |
167 | 216 |
|
168 | | - |
169 | 217 | <!-- Failsafe / Integration Tests --> |
170 | 218 | <plugin> |
171 | 219 | <artifactId>maven-failsafe-plugin</artifactId> |
|
193 | 241 | </configuration> |
194 | 242 | </plugin> |
195 | 243 |
|
196 | | - <!-- Versions plugin: use organization rules.xml for dependency update rules --> |
| 244 | + <!-- Plugin to manage versions of dependencies and plugins, using organization-specific rules for updates |
| 245 | + can be used to check for outdated dependencies and suggest updates based on the rules defined in the provided rules.xml file |
| 246 | +
|
| 247 | + ./mvn versions:display-property-updates --> |
197 | 248 | <plugin> |
198 | 249 | <groupId>org.codehaus.mojo</groupId> |
199 | 250 | <artifactId>versions-maven-plugin</artifactId> |
|
207 | 258 | </build> |
208 | 259 |
|
209 | 260 |
|
| 261 | + <!-- Profiles: these are different build configurations that can be activated based on certain conditions, |
| 262 | + such as the presence of specific properties. --> |
210 | 263 | <profiles> |
211 | | - <!-- Profil JVM --> |
| 264 | + <!-- Profile JVM: this profile is activated when the "jvm" property is set. It configures the build to create |
| 265 | + a JVM-based application package, build a container image using Jib, and load it into the local Docker registry. --> |
| 266 | + |
212 | 267 | <profile> |
213 | 268 | <id>jvm</id> |
214 | 269 | <properties> |
|
219 | 274 | <quarkus.container-image.name>product-catalog</quarkus.container-image.name> |
220 | 275 | <quarkus.container-image.tag>1.0.0-jvm</quarkus.container-image.tag> |
221 | 276 | <quarkus.docker.dockerfile-jvm-path>src/main/docker/Dockerfile.jvm</quarkus.docker.dockerfile-jvm-path> |
| 277 | + <quarkus.jib.base-jvm-image>registry.access.redhat.com/ubi9/openjdk-21-runtime@sha256:20252d0fd32221be2c6ffa91c19f0344c80c8ce3f054a26a2d7492a172516e53</quarkus.jib.base-jvm-image> |
| 278 | + |
222 | 279 | </properties> |
223 | 280 | </profile> |
224 | 281 |
|
225 | | - <!-- Profil Natif --> |
| 282 | + <!-- Profile Native: this profile is activated when the "native" property is set. It configures the build |
| 283 | + to create a native executable using GraalVM, build a container image using Jib, and load it into the local |
| 284 | + Docker registry. It also specifies the builder image to use for building the native executable. --> |
226 | 285 | <profile> |
227 | 286 | <id>native</id> |
228 | 287 | <properties> |
|
234 | 293 | <quarkus.container-image.group>brunoe</quarkus.container-image.group> |
235 | 294 | <quarkus.container-image.name>product-catalog</quarkus.container-image.name> |
236 | 295 | <quarkus.container-image.tag>1.0.0-native</quarkus.container-image.tag> |
237 | | - |
238 | | - <quarkus.native.builder-image>quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-21</quarkus.native.builder-image> |
| 296 | + <quarkus.jib.base-native-image>quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-21</quarkus.jib.base-native-image> |
239 | 297 | </properties> |
240 | 298 | </profile> |
241 | 299 |
|
|
0 commit comments