bmuschko / gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Apache License 2.0
258 stars 63 forks source link

gradlew cargoRunLocal cmd is failing #166

Closed hymap closed 5 years ago

hymap commented 6 years ago

My build.gradle file content

//def availablePortFinder = AvailablePortFinder.createPrivate() buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } }

dependencies {
    classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5'        
    classpath 'com.bmuschko:gradle-cargo-plugin:2.2.3'
}

}

apply plugin: 'java' apply plugin: 'war' apply plugin: 'com.bmuschko.tomcat' apply plugin: 'com.bmuschko.cargo' apply plugin: 'com.bmuschko.cargo-base' apply plugin: 'eclipse'

// JDK version source compatibility sourceCompatibility = 1.8 // project version version = '1.0' // War file name war.baseName = 'cocoaowlCRM' // Web directory, this overrides the default value "webapp" //project.webAppDirName = 'WebContent'

repositories { mavenLocal() mavenCentral() }

// Set source directory sourceSets { main { java { srcDir 'src'
}
} }

task wrapper(type: Wrapper) { gradleVersion = '3.0' }

dependencies { compile 'org.springframework:spring-webmvc:4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-web', version: '4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-tx', version: '4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-expression', version: '4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-jms', version: '4.3.4.RELEASE' compile group: 'org.springframework', name: 'spring-oxm', version: '4.3.4.RELEASE'
compile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.0' compile group: 'javax.servlet.jsp.jstl', name: 'javax.servlet.jsp.jstl-api', version: '1.2.1' compile group: 'org.glassfish.web', name: 'jstl-impl', version: '1.2' compile 'org.springframework.security:spring-security-web:4.2.0.RELEASE' compile 'org.springframework.security:spring-security-config:4.2.0.RELEASE' compile 'org.springframework.security:spring-security-taglibs:4.2.0.RELEASE'

    compile group: 'org.springframework.social', name: 'spring-social-facebook', version: '2.0.3.RELEASE'
    compile group: 'org.springframework.social', name: 'spring-social-twitter', version: '1.1.2.RELEASE'
    compile 'javax.servlet:jstl:1.2'
    compile 'org.postgresql:postgresql:9.4-1204-jdbc42'

    compile 'net.sf.jasperreports:jasperreports:5.1.0'        
    compile 'commons-beanutils:commons-beanutils:1.9.2'
    compile 'commons-logging:commons-logging:1.2'
    compile 'commons-fileupload:commons-fileupload:1.3.2'
    compile 'org.apache.commons:commons-pool2:2.4.2'
    compile 'org.apache.commons:commons-digester3:3.2'
    compile 'org.apache.commons:commons-dbcp2:2.1.1'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile 'org.apache.commons:commons-collections4:4.1'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'org.aspectj:aspectjrt:1.8.9'
    compile 'org.aspectj:aspectjweaver:1.8.9'
    compile 'org.attoparser:attoparser:2.0.0.RELEASE'
    compile 'dom4j:dom4j:1.6.1'
    compile 'ar.com.fdvs:DynamicJasper:5.0.7'        
    compile 'org.hibernate:ejb3-persistence:1.0.2.GA'
    compile 'org.apache.httpcomponents:httpclient:4.5.2'
    compile 'org.apache.httpcomponents:httpcore:4.4.4'
    compile 'org.im4java:im4java:1.4.0'
    compile 'com.lowagie:itext:4.2.2'        
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.4'
    compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'
    compile 'com.fasterxml.jackson.core:jackson-core:2.7.4'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.4'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'org.javassist:javassist:3.20.0-GA'
    compile 'net.sourceforge.javacsv:javacsv:2.0'       
    compile 'org.codehaus.jettison:jettison:1.3.7'
    compile 'jgroups:jgroups:2.6.9.GA'

    compile 'org.glassfish.web:jstl-impl:1.2'
    compile 'javax.transaction:jta:1.1'
    compile 'junit:junit:4.12'
    compile 'javax.mail:mail:1.4.7'
    compile 'ognl:ognl:3.1.7'
    compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.13'
    compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.52'

    compile 'org.slf4j:slf4j-api:1.7.12'
    compile group: 'org.apache.tika', name: 'tika-app', version: '1.11'

    compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.5.0'
    compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.5.0'

    compile 'org.apache.logging.log4j:log4j-api:2.4.1'
    compile 'org.apache.logging.log4j:log4j-core:2.4.1'     
    compile 'org.tuckey:urlrewritefilter:4.0.3'
    compile 'org.apache.velocity:velocity:1.7' 
    compile 'org.unbescape:unbescape:1.1.1.RELEASE'
    compile 'org.apache.velocity:velocity-tools:2.0'
    compile 'org.apache.velocity:velocity-tools:2.0'
    compile 'org.springframework:spring-websocket:4.3.4.RELEASE'
    compile 'org.springframework:spring-orm:4.3.4.RELEASE'          
    testCompile group: 'junit', name: 'junit', version: '4.+'
    //include in compile only, exclude in the war
    providedCompile 'javax.servlet:servlet-api:2.5'
    compile group: 'org.apache.velocity', name: 'velocity', version: '1.7'
    compile group: 'org.apache.velocity', name: 'velocity-tools', version: '2.0'
    compile group: 'velocity-tools', name: 'velocity-tools-view', version: '1.4'
    compile group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'
    compile group: 'velocity-tools', name: 'velocity-tools-generic', version: '1.4'
    compile group: 'org.json', name: 'json', version: '20160212'  
    compile group: 'javax.inject', name: 'javax.inject', version: '1'             
    compile group: 'org.thymeleaf', name: 'thymeleaf', version: '3.0.0.RELEASE'

    compile group: 'javax.transaction', name: 'jta', version: '1.0.1B'
    compile group: 'commons-dbcp', name: 'commons-dbcp', version: '1.4'
    compile group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '2.6.0'
    compile group: 'edu.ucar', name: 'cdm', version: '4.5.5'

    compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.6.0'
    compile group: 'com.auth0', name: 'java-jwt', version: '2.1.0'      
    compile group: 'org.springframework.mobile', name: 'spring-mobile-device', version: '1.1.5.RELEASE'

}

ext.cargoVersion = '1.5.0' cargo { //def availablePortFinder = AvailablePortFinder.createPrivate() containerId = 'tomcat8x' port = 8080

local {
    installer {
        installUrl = "https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.2/bin/apache-tomcat-8.5.2.zip"
        //downloadDir = file("$buildDir/download")
        downloadDir = file("download")
        extractDir = file("extract")            
    }       
    deployable {
        file = file('build/libs/cocoaowlCRM-1.0.war')
        context = '/'
    }
     homeDir= file("extract/apache-tomcat-8.5.2/apache-tomcat-8.5.2")
    outputFile = new File('logs/apache-tomcat-8.5.2/server.log')       

    timeout = 6000000000

}

} // dependencies to run on tomcat, are mandatory for tomcat plugin dependencies { def tomcatVersion = '8.5.2' //def cargoVersion = '1.5.0' tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' cargo "org.codehaus.cargo:cargo-core-uberjar:${cargoVersion}", "org.codehaus.cargo:cargo-ant:${cargoVersion}" }

}

task tomcatRunLocal(type: com.bmuschko.gradle.cargo.tasks.local.CargoRunLocal) {

}

// context where tomcat is deployed, by defautl localhost:8080/ //tomcatRun.contextPath = '/' //tomcatRunWar.contextPath = '/'

ERROR baylogic@LENOVO /f/peopleCentralBackEnd/sourcecode/20171010/cocoaowl_crm (master ) $ gradlew cargoRunLocal :cargoRunLocal org.codehaus.cargo.container.ContainerException: Failed to create a Tomcat 8.x s tandalone configuration :cargoRunLocal FAILED

FAILURE: Build failed with an exception.

Tomcat installation directory : C:\apache-tomcat-8.5.20 Kindly help me .... Hyma P

hymap commented 6 years ago

Ran cargoRunLocal command with -s option 👍

$ gradlew cargoRunLocal -s :cargoRunLocal org.codehaus.cargo.container.ContainerException: Failed to create a Tomcat 8.x tandalone configuration :cargoRunLocal FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 1 mins 34.37 secs

bmuschko commented 6 years ago

org.codehaus.cargo.container.ContainerException: Invalid configuration dir [C:\Users\baylogic\AppData\Local\Temp\cargo\conf]. When using standalone configurations, the configuration dir must point to an empty directory. Note that everything in that dir will get deleted by Cargo.

This seems to be the root cause. Try to remove the contents of that directory.

bmuschko commented 5 years ago

I am going to close this issue as the conversation stopped after my suggestion.

hymap commented 5 years ago

Sure...thank you.

On Thu, Mar 7, 2019 at 3:55 AM Benjamin Muschko notifications@github.com wrote:

I am going to close this issue as the conversation stopped after my suggestion.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bmuschko/gradle-cargo-plugin/issues/166#issuecomment-470302069, or mute the thread https://github.com/notifications/unsubscribe-auth/AeJUMtfCgNJRChsa0fW7b0g6GNv4GDF2ks5vUEBngaJpZM4QSuKO .

-- Thank you, Hyma P bayLogic Technologies, Visakhapatnam.