0
votes

From documentation Customizing the Restart Classloader, you can add devtools dependency and exclude unneeded jars from restart classloader with META-INF/spring-devtools.properties.

Problem

I came to multimodule maven project. About 50 modules. Don't ask me why, I don't know too. As I understand to exclude module49.jar from restart classloader I have to create module49/src/main/resources/META-INF/spring-devtools.properties file. To exclude 47 modules' jars I have to create 47 spring-devtools.properties files, right?

Question

I know, 50 maven modules is totally wrong approach, but Is there any way to create one spring-devtools.properties file?

P.S.

For my case it would be better to exclude everything from restart classloader and create a small whitelist of modules that support hot reload.

1

1 Answers

0
votes

You can put spring-devtools.properties file to the main module of your application (from where SpringBootApplication starts) and write all modules in this one file. For example:

restart.exclude.first=/modules/first/
restart.exclude.second=/modules/second/

etc...

In my case, modules contained inside larger groups. If the same for you, it is possible just place groups there:

restart.exclude.group1=/modules/group1/
...