What is the difference between “mvn deploy” to a local repo and “mvn install”?

前端 未结 3 514
無奈伤痛
無奈伤痛 2020-11-30 19:06

My team uses an internal team maven repo that is shared from a development server using Apache. We also run the Continuum CI server on the same machine. Maven builds in Cont

3条回答
  •  有刺的猬
    2020-11-30 19:39

    Ken, good question. I should be more explicit in the The Definitive Guide about the difference. "install" and "deploy" serve two different purposes in a build. "install" refers to the process of installing an artifact in your local repository. "deploy" refers to the process of deploying an artifact to a remote repository.

    Example:

    1. When I run a large multi-module project on a my machine, I'm going to usually run "mvn install". This is going to install all of the generated binary software artifacts (usually JARs) in my local repository. Then when I build individual modules in the build, Maven is going to retrieve the dependencies from the local repository.

    2. When it comes time to deploy snapshots or releases, I'm going to run "mvn deploy". Running this is going to attempt to deploy the files to a remote repository or server. Usually I'm going to be deploying to a repository manager such as Nexus

    It is true that running "deploy" is going to require some extra configuration, you are going to have to supply a distributionManagement section in your POM.

提交回复
热议问题