Polish "Complete support for project.build.outputTimestamp"
See gh-42922
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ package org.springframework.boot.maven;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -85,12 +86,12 @@ class BuildInfoIntegrationTests {
|
||||
|
||||
@TestTemplate
|
||||
void generatedBuildInfoReproducibleEpochSeconds(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("build-info-reproducible-epochseconds")
|
||||
mavenBuild.project("build-info-reproducible-epoch-seconds")
|
||||
.execute(buildInfo((buildInfo) -> assertThat(buildInfo).hasBuildGroup("org.springframework.boot.maven.it")
|
||||
.hasBuildArtifact("build-reproducible-epochseconds")
|
||||
.hasBuildArtifact("build-reproducible-epoch-seconds")
|
||||
.hasBuildName("Generate build info with build time from project.build.outputTimestamp")
|
||||
.hasBuildVersion("0.0.1.BUILD-SNAPSHOT")
|
||||
.hasBuildTime("1976-01-09T12:00:00Z")));
|
||||
.hasBuildTime(Instant.ofEpochSecond(1619004153).toString())));
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.boot.maven.it</groupId>
|
||||
<artifactId>build-reproducible-epochseconds</artifactId>
|
||||
<artifactId>build-reproducible-epoch-seconds</artifactId>
|
||||
<version>0.0.1.BUILD-SNAPSHOT</version>
|
||||
<name>Generate build info with build time from project.build.outputTimestamp</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>@java.version@</maven.compiler.source>
|
||||
<maven.compiler.target>@java.version@</maven.compiler.target>
|
||||
<!-- Epoch seconds should be support bey build-info plugin too -->
|
||||
<project.build.outputTimestamp>190036800</project.build.outputTimestamp>
|
||||
<project.build.outputTimestamp>1619004153</project.build.outputTimestamp>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in New Issue
Block a user