Skip to content

configHomeDir is giving errors #214

@fangupta

Description

@fangupta

I am trying to start the jetty and tomcat server by using below code blocks

plugins {
id 'buildlogic.java-conventions'
id 'com.bmuschko.cargo' version '2.9.0'
}

cargo {
def useTomcat = project.hasProperty('container') && project.container == 'tomcat'

containerId = useTomcat ? 'tomcat9x' : 'jetty9x'
port = useTomcat ? nodePort : 9999

deployable {
    file = useTomcat
    ? configurations.runtimeClasspath.find { it.name.startsWith('wfmws') && it.name.endsWith('.war') }
            : file("$rootDir/.../build/libs/dbloader.war")
    context = useTomcat ? nodeContext : 'dbloader'
}

local {
    installer {
        installUrl = useTomcat
                ? 'http://.../org/apache/tomcat/apache-tomcat/9.0.108/apache-tomcat-9.0.108.zip'
                : 'http://...l/org/eclipse/jetty/jetty-home/9.4.50.v20221201/jetty-home-9.4.50.v20221201.tar.gz'
        downloadDir = new File(buildDir, "cargo/install")
        extractDir = new File(buildDir, "cargo/install")
    }
    homeDir = useTomcat ? file("$buildDir/tomcat9x") : file("$buildDir/dbloader")
    configHomeDir = useTomcat ? file("$buildDir/tomcat9x_conf") : file("$buildDir/dbloader_conf")

// homeDir = cargoHome
startStopTimeout = 1800000
jvmArgs = useTomcat
? "$cargoContainerJvmArgs $commonJvmArgs $debugTestJvmArgs"
: '-Xms128m -Xmx1024m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dcom.mchange.v2.log.MLog=fallback ' + commonJvmArgs
containerProperties {
if (useTomcat) {
property 'cargo.servlet.port', nodePort
property 'cargo.rmi.port', nodeShutdownPort
property 'cargo.start.jvmargs', "$cargoContainerJvmArgs $commonJvmArgs $debugTestJvmArgs"
} else {
property 'cargo.servlet.port', 9999
property 'cargo.rmi.port', 9099
property 'cargo.start.jvmargs', '-Xms128m -Xmx1024m -XX:MaxMetaspaceSize=2048m -XX:MetaspaceSize=128m ' + commonJvmArgs
}
}
systemProperties {
property 'wfm.node.name', nodeName
property 'dev.network.port', devNetworkPort
property 'rta.client.port', rtaClientPort
property 'rta.activemq.port', rtaActiveMqPort
property 'rtu.client.port', rtuClientPort
property 'rtu.activemq.port', rtuActiveMqPort
property 'node_id_property', 'my_node_id'
property 'my_node_id', nodeName
}
}
}

So whenever I am adding configHomeDir to this getting error as below

Task :app.parent.test:cargoStartLocal FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app.parent.test:cargoStartLocal'.

Error while evaluating property 'configurationAttributes' of task ':app.parent.test:cargoStartLocal'.
The type doesn't support nested text data ("C:\wfm\G...der_conf").

How to remove the above error

Idea of implementation to get the container/path of war deployed should be build directory and not the default path 'C:\Users...\AppData\Local\Temp\cargo\conf' and also this default path is overriding the paths i.e first when I have run for Jetty the file and folders are created here but when again I am running for Tomcat, earlier things are getting lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions