Skip to content

Build info timestamp is truncated to seconds #43581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joshiste opened this issue Dec 19, 2024 · 2 comments
Closed

Build info timestamp is truncated to seconds #43581

joshiste opened this issue Dec 19, 2024 · 2 comments
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@joshiste
Copy link
Contributor

joshiste commented Dec 19, 2024

We use a custom timestamp for the build-info maven goal like this:

...
<properties>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</maven.build.timestamp.format>
....

<plugins>
...
                        <configuration>
                            <time>${maven.build.timestamp}</time>
                        </configuration>
                        <goals>
                            <goal>repackage</goal>
                            <goal>build-info</goal>
                        </goals>
...

As you can see, the timestamp has sub-second precision and was also printed to the build properties like this:

build.time=2024-12-19T19\:59\:39.040Z

Since Spring Boot 3.3.6 (with this commit), this is effectively truncated to seconds:

build.time=2024-12-19T19\:59\:39Z

This turns out to be a breaking change for us. We can fix our problem by reconfiguring maven.build.timestamp.format
to second precision.

So, I don't really expect a fix here, but you may want to add these to the release notes, as this might cause problems when updating.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 19, 2024
@mhalbritter
Copy link
Contributor

mhalbritter commented Dec 20, 2024

We call .truncatedTo(ChronoUnit.SECONDS) in org.springframework.boot.maven.MavenBuildOutputTimestamp#toInstant. I wonder if this is necessary.

You also get a timestamp with millis when not setting the time explicitly:

build.time=2024-12-20T09\:51\:23.009Z

Looks like a bug to me.

@mhalbritter mhalbritter added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 20, 2024
@mhalbritter mhalbritter added this to the 3.3.x milestone Dec 20, 2024
@mhalbritter mhalbritter changed the title Custom build info timestamp truncated to seconds since 3.3.6 Build info timestamp is truncated to seconds Dec 20, 2024
@snicoll
Copy link
Member

snicoll commented Dec 26, 2024

Sorry we broke you, closing in favor of PR #43612

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
@snicoll snicoll modified the milestones: 3.3.x, 3.3.8 Dec 27, 2024
@snicoll snicoll added the status: superseded An issue that has been superseded by another label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants