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

You must publish snapshot and release artifacts without overwriting a released version.

IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Release immutability.

What I'd do →

  1. Create separate Nexus hosted repos: maven-snapshots (version policy Snapshot) and maven-releases (Release, deployment policy "Disable redeploy").
  2. Configure distributionManagement in the POM for both and use mvn deploy.
  3. Use CI credentials with deploy rights only on those repos.

Why → A released version that can change breaks reproducibility and trust.

Interview tip → "Released artifacts are immutable; snapshots are not."

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing