[英]What exactly happens when you run mvn install?
I know that when you run mvn install
it will compile, package, and copy the binaries in the local .m2 repository. 我知道,当您运行
mvn install
,它将编译,打包和复制本地.m2存储库中的二进制文件。
I recently created a maven project in intelliJ and ran mvn install
. 我最近在intelliJ中创建了一个maven项目,并运行了
mvn install
。 I then checked the .m2 repository and the generated binaries were there. 然后,我检查了.m2存储库,并且生成的二进制文件在那里。 When I tried to add a dependency to that newly created snapshot from another intelliJ project, they aren't being picked up.
当我尝试从另一个intelliJ项目向该新创建的快照添加依赖项时,它们没有被拾取。
mvn install
besides copying the new snapshot into .m2? mvn install
是否发生任何事情? mvn dependency:tree
is usually the best tool for figuring out what's going on with dependencies. mvn dependency:tree
通常是弄清楚依赖关系到底是什么的最佳工具。
Sometimes with IDE's they use their own repo or don't pick things up. 有时,使用IDE时,他们使用自己的存储库或不收拾东西。 I'd generally do a sanity check mvn clean install from the command line to make sure things are working correctly.
我通常会从命令行执行健全性检查mvn clean install以确保一切正常。
Here is the default lifecycle of maven. 这是Maven的默认生命周期。 When you execute one phase - all previous phases are executed before it.
当执行一个阶段时,所有先前的阶段都将在该阶段之前执行。 So if you call
mvn install
previous 21 actions will run before install
phase which is 22. 因此,如果您致电
mvn install
先前的21个操作将在install
阶段22之前运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.