[英]is it required to mvn clean install before mvn spring-boot:run
Pulled an existing project form Git Repo从 Git 回购中提取现有项目
I tried running it using mvn spring-boot:run
, but it gave error我尝试使用
mvn spring-boot:run
运行它,但它给出了错误
Then performed a mvn clean install
then did mvn spring-boot:run
, and it got running !!!然后执行
mvn clean install
然后执行mvn spring-boot:run
,它开始运行了!!!
Earlier I was supposing mvn spring-boot:run
performs the task of mvn clean install
also !之前我假设
mvn spring-boot:run
也执行mvn clean install
的任务!
But then, How does mvn spring-boot:run
considers latest code at compilation (I mean if it is not doing install
it should not be compiling, so it should be running the stale JAR, but it takes the new code changes and refreshes the JAR)但是,然后,如何
mvn spring-boot:run
在编译时考虑最新代码(我的意思是,如果它没有进行install
,它不应该编译,所以它应该运行过时的 JAR,但它需要新的代码更改并刷新 JAR)
Can somebody through some light on the confusion !有人可以通过一些了解混乱!
mvn clean install
is used to resolve dependencies that are listed on your pom.xml
. mvn clean install
用于解决pom.xml
上列出的依赖项。 You don't need to run it if there are no changes to your pom.xml
.如果您的
pom.xml
没有更改,则不需要运行它。 The error was most likely due to your local not having all the dependencies required.该错误很可能是由于您的本地没有所需的所有依赖项。
The only difference between mvn spring-boot:run
and mvn clean install
is the later phases after testCompile
phase. mvn spring-boot:run
和mvn clean install
之间的唯一区别是testCompile
阶段之后的后期阶段。 Please refer to attached screenshots.请参阅随附的屏幕截图。
mvn spring-boot:run
mvn clean install
The later steps after running tests in mvn clean install are -在 mvn clean install 中运行测试后的后续步骤是 -
Building jar, repackage, install (default-install)
构建 jar,重新打包,安装(默认安装)
However as compilation is done, so any changes in source code must be reflected in either case.但是,随着编译完成,源代码中的任何更改都必须反映在任何一种情况下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.