Gradle 1.0-milestone-7 hangs when copying files


(Steven Dick) #1

I’m using Gradle to create a ZIP file and then copy that and a WAR file to our network drive for a downstream build job. Gradle always hangs when copying the files.

The Gradle script:

apply from: "${hsmtBuildDir}/hsserv-repos.gradle"
apply from: "${hsmtBuildDir}/third-party-repos.gradle"
apply from: "${hsmtBuildDir}/version.gradle"
  project.version = globalVersion
  configurations {
    publish
    publishWar
    all*.exclude group: 'net.sourceforge.jtds', module: 'jtds'
    all*.exclude group: 'log4j', module: 'log4j'
    all*.exclude group: 'bcel', module: 'bcel'
    all*.exclude group: 'com.thoughtworks.qdox', module: 'qdox'
    all*.exclude group: 'xpp3', module: 'xpp3'
    all*.exclude group: 'org.springframework', module: 'spring-test'
    all*.exclude group: 'junit', module: 'junit'
    all*.exclude group: 'ch.hedgesphere', module: 'HSMtTestCore'
    all*.exclude group: 'org.jibx', module: 'jibx-extras'
    all*.exclude group: 'org.jibx', module: 'jibx-schema'
    all*.exclude group: 'org.jibx', module: 'jibx-tools'
    all*.exclude group: 'javax.mail', module: 'mail'
}
  configurations.all {
    resolutionStrategy.cacheDynamicVersionsFor 1, 'minutes'
}
  dependencies {
    publish group: 'ch.hedgesphere', name: 'HSMtDealingTermModule', version: hsmtVersion
     publish group: 'ch.hedgesphere', name: 'HSMtDealingTermTransactionCore', version: hsmtVersion
     publish group: 'ch.hedgesphere', name: 'HSMtFundPortfolioModule', version: hsmtVersion
    publish group: 'ch.hedgesphere', name: 'HSMtFrontEndIntegrationModule', version: hsmtVersion
    publish group: 'ch.hedgesphere', name: 'HSMtLiquidityModule', version: hsmtVersion
     publish group: 'ch.hedgesphere', name: 'HSMtTradeTermModule', version: hsmtVersion
     publish group: 'ch.hedgesphere', name: 'HSMtMasterDataHSMOModule', version: hsmtVersion
       publishWar group: 'ch.hedgesphere', name: 'HSMtWebServer', version: hsmtVersion, ext: 'war', transitive: false
}
  task zipHsLibs(type: Zip) {
    archiveName = "${buildDir.name}/hs-middletier-${project.version}.zip"
        from(configurations.publish) {
            include '*.jar'
        }
}
  task deploy(type: Copy, dependsOn: zipHsLibs) {
    into '//infonicnas/hsdeploy/hslibs/'
    from zipHsLibs
    from configurations.publishWar
}
  task clean(type: Delete) {
    delete 'build'
}
  task wrapper(type: Wrapper) {
    gradleVersion = '1.0-milestone-7'
}

Looking at it with VisualVM, it appears to get stuck on:

org.gradle.util.HashUtil.createHash() |–java.io.FileInputStream.read()


(Steven Dick) #2

I left it running for 15 minutes and it eventually finished! Looks like it is very slow at creating a hash of the WAR file (around 35MB in size). Any ideas on what’s going wrong here?


(Luke Daley) #3

How long does it take you to manually copy the war file from the network share to your local machine?


(Steven Dick) #4

< 10 seconds.


(Steven Dick) #5

It’s worth noting I was testing on my workstation with an SSD to arrive at the 15 mins. On our Jenkins server it takes a whopping 40 mins to execute (running Windows 7 64-bit).