diff --git a/buildSrc/src/main/groovy/groowt/gradle/logging/GroowtLoggingPlugin.groovy b/buildSrc/src/main/groovy/groowt/gradle/logging/GroowtLoggingPlugin.groovy index cffc787..220324d 100644 --- a/buildSrc/src/main/groovy/groowt/gradle/logging/GroowtLoggingPlugin.groovy +++ b/buildSrc/src/main/groovy/groowt/gradle/logging/GroowtLoggingPlugin.groovy @@ -25,9 +25,10 @@ class GroowtLoggingPlugin implements Plugin { javaExtension.sourceSets.each { sourceSet -> project.tasks.register( - sourceSet.getTaskName('copy', 'LoggingConfig'), + sourceSet.getTaskName('copyLoggingConfigTo', 'Resources'), GroowtCopyLoggerConfigTask ) { task -> + task.group = 'logging' task.from(tmpLog4j2Xml) task.rename { 'log4j2.xml' } task.into(['src', sourceSet.name, 'resources'].join(File.separator)) @@ -45,10 +46,6 @@ class GroowtLoggingPlugin implements Plugin { project.dependencies.addProvider( 'runtimeOnly', libs.findLibrary('log4j-slf4jBinding').orElseThrow() ) - - project.tasks.named('build') { - it.dependsOn project.tasks.withType(GroowtCopyLoggerConfigTask) - } } } diff --git a/cli/src/main/resources/log4j2.xml b/cli/src/main/resources/log4j2.xml new file mode 100644 index 0000000..5081d05 --- /dev/null +++ b/cli/src/main/resources/log4j2.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +