如何“mvn clean package”和“mvn clean install”不同? [英] How are "mvn clean package" and "mvn clean install" different?

查看:635
本文介绍了如何“mvn clean package”和“mvn clean install”不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mvn clean package mvn clean install 之间究竟有什么区别?当我运行这两个命令时,它们似乎都做同样的事情。

What exactly are the differences between mvn clean package and mvn clean install? When I run both of these commands, they both seem to do the same thing.

推荐答案

嗯,两者都会清理干净。这意味着他们将删除目标文件夹。真正的问题是包和安装之间的区别是什么?

Well, both will clean. That means they'll remove the target folder. The real question is what's the difference between package and install?

package 将编译您的代码并将其打包。例如,如果您的pom说该项目是一个jar,它将在您打包并将其放在目标目录中的某个位置时创建一个jar(默认情况下)。

package will compile your code and also package it. For example, if your pom says the project is a jar, it will create a jar for you when you package it and put it somewhere in the target directory (by default).

install 将编译和打包,但它也会将包放在本地存储库中。这将使其他项目可以引用它并从本地存储库中获取它。

install will compile and package, but it will also put the package in your local repository. This will make it so other projects can refer to it and grab it from your local repository.

文档

这篇关于如何“mvn clean package”和“mvn clean install”不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆