What is the difference between the mvn: deploy and mvn: install commands?

I think there must be some other way, but can someone tell me the details?

+9
source share
5 answers

mvn:install copies your packaged Maven module to your local repository (by default, in ~/.m2/repository ), to which other local Maven assemblies will be available.

mvn:deploy downloads your packaged Maven module to another (usually remote) repository that can be accessed by other, not necessarily local, Maven assemblies.

See the documentation for the assembly life cycle for more information.

+23
source

The install phase is responsible for installing artifacts into local cache stores. This mainly refers to the Maven repository, but a well-known example is also the OSGi Bundle repository, supported by the maven-bundle-plugin.

The deploy phase is responsible for installing artifacts in published repositories . This usually refers to remote repositories, but it may well be a local repository open to the outside world.

Like all Maven phases, you can do whatever you want with them. You can shuffle the phases of the plugins as you see fit, but the semantics above are common and you must stick to them to match the default phases for other purposes of the plugins.

+2
source

mvn:deploy performs the deployment for the remote repository / environment, mvn:install installs all the compiled packages in the local repository, making them available for other assemblies running on the local machine.

+1
source

In one sentence: mvn:install compiles and installs your component in the local Maven repository so that you can use it when other components used and developed locally depend on it. mvn:deploy deploys your (previously installed) component in a remote repository.

0
source

Are mvn install and mvn deploy different?

0
source

Source: https://habr.com/ru/post/897907/


All Articles