Interview Prep/Jenkins/Integrations & delivery

You need to publish Java artifacts: snapshots on every `main` build, releases on tags. Design with Nexus.

IntermediateScenarioIntegrations & delivery
Answer

Situation read → Two repositories with different policies.

What I'd do →

  1. pom.xml distributionManagement with maven-snapshots and maven-releases URLs.
  2. Pipeline: on main, mvn -B deploy with -SNAPSHOT version; on tag v1.4.0, set version from TAG_NAME (mvn versions:set -DnewVersion=1.4.0) and deploy to releases.
  3. Nexus: releases disallow redeploy, snapshots have cleanup policies.
  4. Credentials via settings.xml from Config File Provider with credential substitution.

Why → Immutable releases plus disposable snapshots is the standard Maven model.

Interview tip → Mention that redeploying a release returning 400 is a feature.

All Jenkins questions Roadmap: Jenkins

More on Integrations & delivery