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.
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?IntermediateWhat is the difference between `npm install` and `npm ci`?Beginner