如何为带有模块的gradle项目设置log4j?
我有一个类似以下项目的项目:
project root
build.gradle
gradle.properties
settings.gradle
// this root project does:
// include CommonModule
// includeBuild <all composite modules within module folder>
---CommonModule
------build.gradle
------gradle.properties
------settings.gradle
------src/main/groovy/...<common-code>
------src/main/resources/log4j2.xml
Modules
---OtherModule-1
// this is a gradle composite module
// it also includes the common module
------build.gradle
------gradle.properties
------settings.gradle
------src/main/groovy/...module1-code
------src/main/resources/log4j2.xml
---OtherModule-2
// this is a gradle composite module
// it also includes the common module
------build.gradle
------gradle.properties
------settings.gradle
------src/main/groovy/...module2-code
------src/main/resources/log4j2.xml
如上所示,我们有一个公共gradle模块和一个模块文件夹,其中包含与模块相关的复合模块,每个模块都取决于所包含的CommonModule (核心通用代码是通用的,复合模块每个都包含扩展通用内容的代码
我的问题很简单:
答案 0 :(得分:0)
我去了gradle论坛https://discuss.gradle.org/t/how-do-you-set-up-log4j-for-a-gradle-project-with-modules/28262并问了同样的问题,得到了答案-