Interview Prep/CI/CD/Build Tools and Artifact Repositories

What is the difference between `mvn package`, `install` and `deploy`?

BeginnerConceptBuild Tools and Artifact Repositories
Answer

package creates the artifact (JAR/WAR) in target/. install also copies it to the local repository ~/.m2/repository so other local projects can depend on it. deploy uploads to the remote repository configured in distributionManagement (Nexus/Artifactory). In CI you normally run verify for PRs and deploy only from release builds.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Build Tools and Artifact Repositories