Skip to content

Commit 1a3f1a4

Browse files
committed
Polish "Complete support for project.build.outputTimestamp"
See gh-42922
1 parent 491515e commit 1a3f1a4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.File;
2020
import java.io.FileReader;
2121
import java.io.IOException;
22+
import java.time.Instant;
2223
import java.util.Properties;
2324
import java.util.function.Consumer;
2425

@@ -85,12 +86,12 @@ void generatedBuildInfoReproducible(MavenBuild mavenBuild) {
8586

8687
@TestTemplate
8788
void generatedBuildInfoReproducibleEpochSeconds(MavenBuild mavenBuild) {
88-
mavenBuild.project("build-info-reproducible-epochseconds")
89+
mavenBuild.project("build-info-reproducible-epoch-seconds")
8990
.execute(buildInfo((buildInfo) -> assertThat(buildInfo).hasBuildGroup("org.springframework.boot.maven.it")
90-
.hasBuildArtifact("build-reproducible-epochseconds")
91+
.hasBuildArtifact("build-reproducible-epoch-seconds")
9192
.hasBuildName("Generate build info with build time from project.build.outputTimestamp")
9293
.hasBuildVersion("0.0.1.BUILD-SNAPSHOT")
93-
.hasBuildTime("1976-01-09T12:00:00Z")));
94+
.hasBuildTime(Instant.ofEpochSecond(1619004153).toString())));
9495
}
9596

9697
@TestTemplate
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>org.springframework.boot.maven.it</groupId>
6-
<artifactId>build-reproducible-epochseconds</artifactId>
6+
<artifactId>build-reproducible-epoch-seconds</artifactId>
77
<version>0.0.1.BUILD-SNAPSHOT</version>
88
<name>Generate build info with build time from project.build.outputTimestamp</name>
99
<properties>
1010
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1111
<maven.compiler.source>@java.version@</maven.compiler.source>
1212
<maven.compiler.target>@java.version@</maven.compiler.target>
13-
<!-- Epoch seconds should be support bey build-info plugin too -->
14-
<project.build.outputTimestamp>190036800</project.build.outputTimestamp>
13+
<project.build.outputTimestamp>1619004153</project.build.outputTimestamp>
1514
</properties>
1615
<build>
1716
<plugins>

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)