Include log4j2.xml into application jars only. This allows applications to use their own log4j2.xml files, if required. (#635)

This commit is contained in:
Chris Rankin 2017-05-05 13:12:36 +01:00 committed by GitHub
parent de83866ebe
commit 0309426cb9
7 changed files with 26 additions and 6 deletions

View File

@ -97,10 +97,6 @@ allprojects {
// Use manual resource copying of log4j2.xml rather than source sets. // Use manual resource copying of log4j2.xml rather than source sets.
// This prevents problems in IntelliJ with regard to duplicate source roots. // This prevents problems in IntelliJ with regard to duplicate source roots.
processResources {
from file("$rootDir/config/dev/log4j2.xml")
}
processTestResources { processTestResources {
from file("$rootDir/config/test/log4j2.xml") from file("$rootDir/config/test/log4j2.xml")
} }

View File

@ -40,6 +40,12 @@ sourceSets {
} }
} }
// Use manual resource copying of log4j2.xml rather than source sets.
// This prevents problems in IntelliJ with regard to duplicate source roots.
processResources {
from file("$rootDir/config/dev/log4j2.xml")
}
// To find potential version conflicts, run "gradle htmlDependencyReport" and then look in // To find potential version conflicts, run "gradle htmlDependencyReport" and then look in
// build/reports/project/dependencies/index.html for green highlighted parts of the tree. // build/reports/project/dependencies/index.html for green highlighted parts of the tree.

View File

@ -26,7 +26,12 @@ dependencies {
task buildCordaJAR(type: FatCapsule) { task buildCordaJAR(type: FatCapsule) {
applicationClass 'net.corda.node.Corda' applicationClass 'net.corda.node.Corda'
archiveName "corda-${corda_release_version}.jar" archiveName "corda-${corda_release_version}.jar"
applicationSource = files(project.tasks.findByName('jar'), '../build/classes/main/CordaCaplet.class', '../build/classes/main/CordaCaplet$1.class', 'config/dev/log4j2.xml') applicationSource = files(
project.tasks.findByName('jar'),
'../build/classes/main/CordaCaplet.class',
'../build/classes/main/CordaCaplet$1.class',
"$rootDir/config/dev/log4j2.xml"
)
from 'NOTICE' // Copy CDDL notice from 'NOTICE' // Copy CDDL notice
capsuleManifest { capsuleManifest {

View File

@ -12,6 +12,12 @@ apply plugin: 'application'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
mainClassName = 'net.corda.explorer.Main' mainClassName = 'net.corda.explorer.Main'
// Use manual resource copying of log4j2.xml rather than source sets.
// This prevents problems in IntelliJ with regard to duplicate source roots.
processResources {
from file("$rootDir/config/dev/log4j2.xml")
}
dependencies { dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"

View File

@ -20,6 +20,12 @@ sourceSets {
} }
} }
// Use manual resource copying of log4j2.xml rather than source sets.
// This prevents problems in IntelliJ with regard to duplicate source roots.
processResources {
from file("$rootDir/config/dev/log4j2.xml")
}
dependencies { dependencies {
compile project(":node-api") compile project(":node-api")

View File

@ -20,6 +20,7 @@ sourceSets {
} }
processResources { processResources {
from file("$rootDir/config/dev/log4j2.xml")
from file("$rootDir/config/dev/jolokia-access.xml") from file("$rootDir/config/dev/jolokia-access.xml")
} }

View File

@ -30,7 +30,7 @@ task buildWebserverJar(type: FatCapsule) {
project.tasks.findByName('jar'), project.tasks.findByName('jar'),
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet.class'), new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet.class'),
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet$1.class'), new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet$1.class'),
'config/dev/log4j2.xml' "$rootDir/config/dev/log4j2.xml"
) )
from 'NOTICE' // Copy CDDL notice from 'NOTICE' // Copy CDDL notice