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 145 times
3
Francesco
- 1,628
- 4
- 43
- 70
-
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.propertiesto the classpath used when running unit tests - add the directory with
log4j.propertiesas an additional resources directory, files from this directory will be copied to the target/classes directory for every module
Adam Siemion
- 15,064
- 6
- 51
- 88