重新加载多模块maven项目更改
Setting
想象一个多模块 Maven 项目。项目结构是:
pom.xml //parentpom
|
pom.xml //submodule_1
|
pom.xml //submodule_2
.
.
.
pom.xml //submodule_7
例如,submodule_5 具有 submodule_6 和 submodule_7 作为依赖项。可以构建 submodule_5 以构建可以部署的 War 文件。Spring-Boot-Devtools每当 submodule_5 的类路径发生更改时,提供自动重新启动的功能。
每当应用程序运行时使用:
mvn spring-boot:run
And changes are made to submodule_5 (depending on which IDE you use the classpath get changed. (for Eclipse automaticaly / for InteliJ when pressing Ctrl+F9)) spring-boot automaticaly restarts the application and changes are added. Changes which happen to submodule_6 or submodule_7 don't trigger the automatic restart.
问题
- 有没有办法做到这一点,以便每当您在子模块 6 或子模块 7 中进行更改时,它们都会强制重新启动并应用更改?
- Spring-boot-devtools 使用两个类加载器:“基础类加载器”和“重新启动类加载器”。是否在应用程序初始启动时 submodule_6 和 submodule_7 添加到“基本类加载器”,而 submodule_5 保留在“重新启动类加载器”中?使得每当 submodule_5 强制重新启动时,它都会使用“基本类加载器”中的 submodule_6 和 submodule_7 的版本?
您可以指定 spring-boot-devtools 监视的其他文件夹,在应用程序属性:
spring.devtools.restart.additional-paths=../submodule_6,../submodule_7
请参阅 Spring 的文档使用-boot-devtools-restart-additional-paths http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#using-boot-devtools-restart-additional-paths.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)