I think there should be some difference, but can anyone tell me the details?
-
[this](http://stackoverflow.com/questions/207281/what-is-the-difference-between-mvn-deploy-to-a-local-repo-and-mvn-install) may be what you are looking for. – kdabir Sep 23 '11 at 15:08
4 Answers
mvn:install
copies your packaged Maven module to your local repository (by default, in ~/.m2/repository
), to be accessed by other local Maven builds.
mvn:deploy
uploads your packaged Maven module to another (usually remote) repository, to be accessed by other, not necessarily local, Maven builds.
See the documentation for the build lifecycle for more info.

- 10,115
- 3
- 44
- 62
The install
phase is responsible for the installation of artifacts into local caching repositories. This basically applies to the Maven repository, but a well-known example is also the OSGi Bundle Repository supported by maven-bundle-plugin.
The deploy
phase is responsible for the installation of artifacts into published repositories. This usually applies to remote repositories, but is could perfectly be a local repository exposed to the outside world.
As all Maven phases, you can do with them anything you want. You can shuffle plugin phases as you see fit, but the above semantics is the conventional one and you should stick to it in order to be consistent with the default phases of other plugins' goals.

- 10,206
- 7
- 48
- 58
mvn:deploy
performs deployment to remote reposiory/environment, mvn:install
installs all compiled packages to a local repository making them available to other builds performed on the local machine.

- 20,285
- 14
- 94
- 132
-
-
@Daniel, pom, jar, war, javadoc jar, source jar anything compiled/assembled by previous build phases. – Andrey Adamovich Sep 23 '11 at 17:48
In one sentence: mvn:install
compiles and installs your component in your 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 to a remote repository.

- 15,345
- 7
- 55
- 92
-
-
I think the default life cycle of Maven contains that. And if you do only deploy it, what should be deployed then? See the documentation at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html. there is stated: That is because if you call a build phase, it will execute not only that build phase, but also every build phase prior to the called build phase. – mliebelt Sep 23 '11 at 15:21
-
1