|
66 | 66 | <jreleaser-maven-plugin.version>1.24.0</jreleaser-maven-plugin.version> |
67 | 67 | <versions-maven-plugin.version>2.21.0</versions-maven-plugin.version> |
68 | 68 | <spotless-maven-plugin.version>3.7.0</spotless-maven-plugin.version> |
| 69 | + <git-commit-id-maven-plugin.version>10.0.0</git-commit-id-maven-plugin.version> |
69 | 70 |
|
70 | 71 | <!-- Dependency versions --> |
71 | 72 | <spring-boot.version>3.5.14</spring-boot.version> |
|
172 | 173 | <artifactId>spotless-maven-plugin</artifactId> |
173 | 174 | <version>${spotless-maven-plugin.version}</version> |
174 | 175 | </plugin> |
| 176 | + <plugin> |
| 177 | + <groupId>io.github.git-commit-id</groupId> |
| 178 | + <artifactId>git-commit-id-maven-plugin</artifactId> |
| 179 | + <version>${git-commit-id-maven-plugin.version}</version> |
| 180 | + </plugin> |
175 | 181 | </plugins> |
176 | 182 | </pluginManagement> |
177 | 183 |
|
|
242 | 248 | <build> |
243 | 249 | <defaultGoal>package</defaultGoal> |
244 | 250 | <plugins> |
| 251 | + <plugin> |
| 252 | + <groupId>io.github.git-commit-id</groupId> |
| 253 | + <artifactId>git-commit-id-maven-plugin</artifactId> |
| 254 | + <executions> |
| 255 | + <execution> |
| 256 | + <id>get-the-git-infos</id> |
| 257 | + <goals> |
| 258 | + <goal>revision</goal> |
| 259 | + </goals> |
| 260 | + <phase>initialize</phase> |
| 261 | + </execution> |
| 262 | + </executions> |
| 263 | + <configuration> |
| 264 | + <!-- No git.properties file: a shared /git.properties collides on a |
| 265 | + consumer's classpath (only the first jar's copy is ever read). |
| 266 | + The git infos are written into each jar's own MANIFEST.MF below. --> |
| 267 | + <generateGitPropertiesFile>false</generateGitPropertiesFile> |
| 268 | + <commitIdGenerationMode>full</commitIdGenerationMode> |
| 269 | + <!-- Reproducible builds: format the commit time in a fixed format and |
| 270 | + in UTC, so the rendered string does not depend on the build |
| 271 | + machine's locale or timezone. --> |
| 272 | + <dateFormat>yyyy-MM-dd'T'HH:mm:ss'Z'</dateFormat> |
| 273 | + <dateFormatTimeZone>UTC</dateFormatTimeZone> |
| 274 | + <!-- A build from a published source archive (no .git) must not fail; |
| 275 | + this also lets third parties verify reproducibility from sources. --> |
| 276 | + <failOnNoGitDirectory>false</failOnNoGitDirectory> |
| 277 | + <!-- Reproducible builds: exclude every property that varies between |
| 278 | + builds of the same commit (build time, host, the build machine's |
| 279 | + git user, and remote-tracking state). Only commit-/repo-derived |
| 280 | + values that are deterministic for a given commit are kept. --> |
| 281 | + <excludeProperties> |
| 282 | + <excludeProperty>git.build.time</excludeProperty> |
| 283 | + <excludeProperty>git.build.host</excludeProperty> |
| 284 | + <excludeProperty>git.build.user.name</excludeProperty> |
| 285 | + <excludeProperty>git.build.user.email</excludeProperty> |
| 286 | + <excludeProperty>git.local.branch.ahead</excludeProperty> |
| 287 | + <excludeProperty>git.local.branch.behind</excludeProperty> |
| 288 | + </excludeProperties> |
| 289 | + </configuration> |
| 290 | + </plugin> |
| 291 | + <plugin> |
| 292 | + <groupId>org.apache.maven.plugins</groupId> |
| 293 | + <artifactId>maven-jar-plugin</artifactId> |
| 294 | + <configuration> |
| 295 | + <archive> |
| 296 | + <!-- Git metadata lives in the per-jar manifest (no classpath |
| 297 | + collision). All values are commit-/repo-derived and thus |
| 298 | + deterministic for a given commit, keeping builds reproducible. --> |
| 299 | + <manifestEntries> |
| 300 | + <Git-Commit>${git.commit.id.abbrev}</Git-Commit> |
| 301 | + <Git-Commit-Time>${git.commit.time}</Git-Commit-Time> |
| 302 | + <Git-Branch>${git.branch}</Git-Branch> |
| 303 | + <Git-Tag>${git.tags}</Git-Tag> |
| 304 | + <Git-Dirty>${git.dirty}</Git-Dirty> |
| 305 | + </manifestEntries> |
| 306 | + </archive> |
| 307 | + </configuration> |
| 308 | + </plugin> |
245 | 309 | <plugin> |
246 | 310 | <groupId>org.apache.maven.plugins</groupId> |
247 | 311 | <artifactId>maven-javadoc-plugin</artifactId> |
|
0 commit comments