With the tip of @cbley I found the problematic class:
BuildInfo.scala
from the sbt-buldinfo Plugin. By default on every compile
it creates a new timestamp, which then causes a recompile of BuildInfo.scala
.
I actually had a similar problem with scoverage - see here: scoverage: Combine Coverage from test and it:test
Adding the accepted answer from there fixed the problem:
lazy val buildTime: SettingKey[String] = SettingKey[String]
("buildTime", "time of build")
ThisBuild / buildTime := ZonedDateTime.now(ZoneOffset.UTC).toString
buildInfoKeys :=
Seq[BuildInfoKey](
name,
version,
scalaVersion,
sbtVersion,
buildTime
)