mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
CORDA-3578 add corda prefix to conf file names as original issue was … (#6322)
* CORDA-3578 add corda prefix to conf file names as original issue was having non-corda reference.conf files on classpath causes DriverDSLImp failure it is better to have this naming convention and avoid further conflicts of conf files. * fixed weird duplicates * revert renaming changes for web-reference.conf and loadtest-reference.conf
This commit is contained in:
parent
2a2f04e568
commit
26d4bfb89f
@ -51,7 +51,7 @@ class ConfigExporter {
|
||||
}
|
||||
|
||||
fun Config.parseAsNodeConfigWithFallback(): Validated<NodeConfiguration, Configuration.Validation.Error> {
|
||||
val referenceConfig = ConfigFactory.parseResources("reference.conf")
|
||||
val referenceConfig = ConfigFactory.parseResources("corda-reference.conf")
|
||||
val nodeConfig = this
|
||||
.withValue("baseDirectory", ConfigValueFactory.fromAnyRef("/opt/corda"))
|
||||
.withFallback(referenceConfig)
|
||||
|
@ -51,7 +51,7 @@ task buildCordaJAR(type: FatCapsule, dependsOn: [
|
||||
applicationSource = files(
|
||||
nodeProject.configurations.runtimeClasspath,
|
||||
nodeProject.tasks.jar,
|
||||
nodeProject.buildDir.toString() + '/resources/main/reference.conf',
|
||||
nodeProject.buildDir.toString() + '/resources/main/corda-reference.conf',
|
||||
"$rootDir/config/dev/log4j2.xml",
|
||||
'NOTICE' // Copy CDDL notice
|
||||
)
|
||||
|
@ -37,7 +37,7 @@ public class CordaCaplet extends Capsule {
|
||||
File configFile = (config == null) ? new File(baseDir, "node.conf") : new File(config);
|
||||
try {
|
||||
ConfigParseOptions parseOptions = ConfigParseOptions.defaults().setAllowMissing(false);
|
||||
Config defaultConfig = ConfigFactory.parseResources("reference.conf", parseOptions);
|
||||
Config defaultConfig = ConfigFactory.parseResources("corda-reference.conf", parseOptions);
|
||||
Config baseDirectoryConfig = ConfigFactory.parseMap(Collections.singletonMap("baseDirectory", baseDir));
|
||||
Config nodeConfig = ConfigFactory.parseFile(configFile, parseOptions);
|
||||
return baseDirectoryConfig.withFallback(nodeConfig).withFallback(defaultConfig).resolve();
|
||||
|
@ -42,7 +42,7 @@ object ConfigHelper {
|
||||
allowMissingConfig: Boolean = false,
|
||||
configOverrides: Config = ConfigFactory.empty()): Config {
|
||||
val parseOptions = ConfigParseOptions.defaults()
|
||||
val defaultConfig = ConfigFactory.parseResources("reference.conf", parseOptions.setAllowMissing(false))
|
||||
val defaultConfig = ConfigFactory.parseResources("corda-reference.conf", parseOptions.setAllowMissing(false))
|
||||
val appConfig = ConfigFactory.parseFile(configFile.toFile(), parseOptions.setAllowMissing(allowMissingConfig))
|
||||
|
||||
// Detect the underlying OS. If mac or windows non-server then we assume we're running in devMode. Unless specified otherwise.
|
||||
|
@ -27,7 +27,7 @@ public class CordaWebserverCaplet extends Capsule {
|
||||
File configFile = (config == null) ? new File(baseDir, "node.conf") : new File(config);
|
||||
try {
|
||||
ConfigParseOptions parseOptions = ConfigParseOptions.defaults().setAllowMissing(false);
|
||||
Config defaultConfig = ConfigFactory.parseResources("reference.conf", parseOptions);
|
||||
Config defaultConfig = ConfigFactory.parseResources("corda-reference.conf", parseOptions);
|
||||
Config baseDirectoryConfig = ConfigFactory.parseMap(Collections.singletonMap("baseDirectory", baseDir));
|
||||
Config nodeConfig = ConfigFactory.parseFile(configFile, parseOptions);
|
||||
return baseDirectoryConfig.withFallback(nodeConfig).withFallback(defaultConfig).resolve();
|
||||
|
@ -35,7 +35,7 @@ task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').tasks.jar)
|
||||
project(':testing:testserver').tasks.jar,
|
||||
project(':testing:testserver').sourceSets.main.java.outputDir.toString() + '/CordaWebserverCaplet.class',
|
||||
project(':testing:testserver').sourceSets.main.java.outputDir.toString() + '/CordaWebserverCaplet$1.class',
|
||||
project(':node').buildDir.toString() + '/resources/main/reference.conf',
|
||||
project(':node').buildDir.toString() + '/resources/main/corda-reference.conf',
|
||||
"$rootDir/config/dev/log4j2.xml",
|
||||
project(':node:capsule').projectDir.toString() + '/NOTICE' // Copy CDDL notice
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ import java.nio.file.StandardCopyOption
|
||||
import java.util.Properties
|
||||
|
||||
/**
|
||||
* This is a subset of FullNodeConfiguration, containing only those configs which we need. The node uses reference.conf
|
||||
* This is a subset of FullNodeConfiguration, containing only those configs which we need. The node uses corda-reference.conf
|
||||
* to fill in the defaults so we're not required to specify them here.
|
||||
*/
|
||||
data class NodeConfig(
|
||||
|
@ -37,7 +37,7 @@ class NodeConfigTest {
|
||||
|
||||
val nodeConfig = config.nodeConf()
|
||||
.withValue("baseDirectory", valueFor(baseDir.toString()))
|
||||
.withFallback(ConfigFactory.parseResources("reference.conf"))
|
||||
.withFallback(ConfigFactory.parseResources("corda-reference.conf"))
|
||||
.withFallback(ConfigFactory.parseMap(mapOf("devMode" to true)))
|
||||
.resolve()
|
||||
val fullConfig = nodeConfig.parseAsNodeConfiguration().value()
|
||||
@ -70,7 +70,7 @@ class NodeConfigTest {
|
||||
.withValue("systemProperties", valueFor(mapOf("property.name" to "value")))
|
||||
.withValue("custom.jvmArgs", valueFor("-Xmx1000G"))
|
||||
.withValue("baseDirectory", valueFor(baseDir.toString()))
|
||||
.withFallback(ConfigFactory.parseResources("reference.conf"))
|
||||
.withFallback(ConfigFactory.parseResources("corda-reference.conf"))
|
||||
.withFallback(ConfigFactory.parseMap(mapOf("devMode" to true)))
|
||||
.resolve()
|
||||
val fullConfig = nodeConfig.parseAsNodeConfiguration().value()
|
||||
|
@ -63,7 +63,7 @@ open class NodeBuilder {
|
||||
fun Config.parseAsNodeConfigWithFallback(preCopyConfig: Config): Validated<NodeConfiguration, Configuration.Validation.Error> {
|
||||
val nodeConfig = this
|
||||
.withValue("baseDirectory", ConfigValueFactory.fromAnyRef(""))
|
||||
.withFallback(ConfigFactory.parseResources("reference.conf"))
|
||||
.withFallback(ConfigFactory.parseResources("corda-reference.conf"))
|
||||
.withFallback(preCopyConfig)
|
||||
.resolve()
|
||||
return nodeConfig.parseAsNodeConfiguration()
|
||||
|
Loading…
Reference in New Issue
Block a user