Java mvn install 和 mvn verify 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50260921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Differences Between mvn install and mvn verify
提问by Nicholas
What are the differences between Maven's mvn install
and mvn verify
commands?
Mavenmvn install
和mvn verify
命令之间有什么区别?
How does the keyword clean
modify these commands?
关键字如何clean
修改这些命令?
采纳答案by vatbub
mvn verify
- as said before - performs any integration tests that maven finds in the project.
mvn verify
- 如前所述 - 执行 maven 在项目中找到的任何集成测试。
mvn install
implicitly runs mvn verify
and then copies the resulting artifact into your local maven repository which you usually can find under C:\Users\username\.m2\repository
if you are using windows.
mvn install
隐式运行mvn verify
,然后将生成的工件复制到本地 Maven 存储库中,C:\Users\username\.m2\repository
如果您使用的是 Windows ,通常可以在该存储库下找到。
If you run maven multiple times without the clean
command and without changing any source code, you may notice that it says Nothing to compile - all classes are up to date
during the compile phase. If you add the clean
command before any other command, maven will simply delete the entire target
directory resulting in all classes being recompiled.
如果你在没有clean
命令的情况下多次运行 maven并且没有更改任何源代码,你可能会注意到它Nothing to compile - all classes are up to date
在编译阶段说。如果在任何其他clean
命令之前添加该命令,maven 将简单地删除整个target
目录,从而导致重新编译所有类。
回答by ????g?ň?c????
From https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html:
从https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html:
mvn install
- install the package into the local repository, for use as a dependency in other projects locally
mvn install
- 将包安装到本地存储库中,作为本地其他项目的依赖项
mvn verify
- run any checks on results of integration tests to ensure quality criteria are met
mvn verify
- 对集成测试的结果进行任何检查,以确保满足质量标准
clean
is a lifecycle that handles project cleaning. Commands involving clean
before it will clear the entire directory, meaning that all the classes have to be recompiled.
clean
是处理项目清理的生命周期。clean
之前涉及的命令会清空整个目录,意味着所有的类都必须重新编译。