java - command "mvn spring-boot:run" does not take changes at run in other modules than main module?
问题描述
i have a multi-modules maven, which is configured like that :
sub-module maven : modul-main : contains the Main class and config folder with an application.properties file
sub-module maven : modul-common : an another sub-module
if i update my code in modul-main, so the command
mvn spring-boot:run
see my changes at run but IF i update my code in modul-common, so the command
mvn spring-boot:run
does not see my changes!
- how explain that ? (what the command does in background ?) want to understand !
- is there an option with this line command to solve this ?
解决方案
这就是 Maven 的工作方式,这与 Spring Boot 无关。当您进入module-main
并运行命令时,它只会影响该模块,而 Maven 不知道该模块是一个更大的项目的一部分,如果需要,应该对其进行更新。
当您在特定模块中时,依赖项是通过本地 maven 存储库(而不是target/classes
每个模块的单独位置)获取的。
与 Gradle 的工作方式相比,这是一个显着的区别(在模块中运行命令将在需要时自动更新同级模块)。
推荐阅读
- ios - “线程 1:致命错误:索引超出范围”错误无法解决
- c++ - 有没有办法根据命令行参数定义数组大小?运行时与编译时实例化?
- postgresql - 函数中的参数导致问题
- r - 在 R 3.4.3 和 R 3.6.0 之间更改存储在 data.table 中的闭包行为
- sql-server - Speed up comparison of Integer dates in Access front end to SQL Server back end
- reactjs - react-window-infinite-loader 材质-ui 自动完成
- excel - 使用 VBA 将 Excel 3D 图表导出到图像
- powershell - 自签名证书仅限于主机?
- javascript - case 显示“预期的声明或声明”。错误
- java - 我无法弄清楚如何将 Jbutton 返回到之前调用它的方法