I have a multi-module, a lot of modules, Maven project. Each module has it's own set of unit-tests. I want to use the same log4j.properties
file for all tests. Do I have to copy and paste the same file in each module's /src/test/resources
or there is a smartest way? I'm looking for the smartest way but no luck for now.
Asked
Active
Viewed 192 times
3

Francesco
- 1,742
- 5
- 44
- 78
-
Check this answer https://stackoverflow.com/a/17405828/1901067 or https://stackoverflow.com/a/3571292/1901067 – David Feb 23 '19 at 17:57
1 Answers
1
I think there are a couple of possible ways:
- add the directory with
log4j.properties
to the classpath used when running unit tests - add the directory with
log4j.properties
as an additional resources directory, files from this directory will be copied to the target/classes directory for every module

Adam Siemion
- 15,569
- 7
- 58
- 92