Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

A Gradle or Maven build must be reproducible byte for byte. What do you do?

AdvancedScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Timestamps and ordering make artifacts differ.

What I'd do →

  1. Set project.build.outputTimestamp in Maven (or preserveFileTimestamps = false and reproducibleFileOrder = true in Gradle archive tasks).
  2. Pin the JDK and tool versions, build in a pinned container, and lock dependencies.
  3. Verify by building twice and comparing digests (sha256sum) or using diffoscope.

Why → Reproducible builds let third parties verify that binaries match the source.

Interview tip → Mention SLSA and the verification step.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing