Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自定义Gradle War任务可以';我找不到拉链_Gradle - Fatal编程技术网

自定义Gradle War任务可以';我找不到拉链

自定义Gradle War任务可以';我找不到拉链,gradle,Gradle,内部工具.gradle :internal-tools:reWar FAILED FAILURE: Build failed with an exception. * What went wrong: Cannot expand ZIP '/Users/XXXXXX/Documents/XXXX/XXXX/internal-tools/internal-tools-195.0-SNAPSHOT.war' as it does not exist. 有人能帮我完成reWar任务吗?我认为这是

内部工具.gradle

:internal-tools:reWar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Cannot expand ZIP '/Users/XXXXXX/Documents/XXXX/XXXX/internal-tools/internal-tools-195.0-SNAPSHOT.war' as it does not exist.

有人能帮我完成reWar任务吗?我认为这是一项定制任务。我需要它改为看这里“/Users/XXXXXX/Documents/XXXX/XXXX/internal tools/build/internal-tools-195.0-SNAPSHOT.war”。它似乎在这里查看“/Users/XXXXXX/Documents/XXXX/XXXX/internal-tools/internal-tools-195.0-SNAPSHOT.war”

您可能应该使用
war.archiveFile
而不是
war.archiveName
。原因:groovy.lang.MissingPropertyException:无法获取任务的未知属性“archiveFile”:类型的内部工具:warorg.gradle.api.tasks.bundling.War。我正在使用gradle 3.5Oh,它看起来像是从{zipTree(war.archivePath)}将我推向了正确的方向。
description = 'Internal Tools'

ext {
    grailsVersion = "3.3.3"
}
apply plugin: "org.grails.grails-web"
apply plugin: "war"
apply plugin:"org.grails.grails-gsp"

grails {
    grailsVersion = "3.3.3"
    //springLoadedVersion = '1.2.4.RELEASE'
}

configurations.all {
    // already provided by the JVM, Grails complains if classes show up twice in the classpath
    exclude group: 'xml-apis', module: 'xml-apis'

    exclude module: 'grails-plugin-log4j'

    //provided servlet container
    exclude group: 'javax.el', module: 'el-api'
    exclude group: 'org.glassfish.web', module: 'el-impl'
}

dependencies {
    compile project(':business-logic')
    //test(project(path: ':business-logic', configuration: 'testArtifacts'))

    def slf4jVersion = '1.7.2'
    compile "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
    compile "org.slf4j:jul-to-slf4j:${slf4jVersion}"
    compile "org.slf4j:slf4j-api:${slf4jVersion}"


    // We force a newer version of Ant to work around a bug in the Oracle JRE.  This can be removed when Grails upgrades Ant
    // See Ant 'Bug 54641' for more details
    runtime "org.apache.ant:ant:1.9.2"
    runtime "org.apache.ant:ant-junit:1.9.2"

    // Grails
    runtime "org.grails:grails-dependencies:$grailsVersion"

    compile "org.grails:grails-plugin-validation:3.3.3"
    compile 'org.grails.plugins:converters:4.0.0'

    compile 'org.grails.plugins:gorm-tools:6.1.11-v.12'

    compile "org.grails:grails-plugin-databinding"



    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-web-boot"





    compile "org.grails:grails-core"

    // Grails plugins
    compile "org.grails.plugins:hibernate4:4.3.6.1"
    compile "org.grails.plugins:tomcat:7.0.55"
    compile "org.grails.plugins:export:1.6"
    compile "org.grails.plugins:webflow:2.1.0"
    compile 'org.grails.plugins:logback:0.3.1'
    runtime "org.grails:grails-plugin-validation:$grailsVersion"

    //test "org.grails:grails-test:$grailsVersion"
   // test "org.grails:grails-plugin-testing:$grailsVersion"
   // test 'org.hamcrest:hamcrest-all:1.1'
    //test 'org.mockito:mockito-all:1.8.0'
   // test 'nekohtml:nekohtml:1.9.6.2'

   // bootstrap 'ch.qos.logback:logback-classic:1.1.3'
}

test {
    doFirst {
        tasks.getByPath(':dbTestCreate').ext.testDatabase.create()
    }

    dependsOn(':configProperties')
    jvmArgs '-XX:MaxMetaspaceSize=256m'
    systemProperty 'XXXX.conf.file', "$configOutputDir/XXXX_test.properties"
    String protocol = "file:"
    systemProperty 'logback.configurationFile', protocol + new File(rootProject.projectDir,"dev/log/logback.xml").getAbsolutePath()
}

bootRun {
    dependsOn(':configProperties', ':dbValidate')
    jvmArgs '-XX:MaxMetaspaceSize=256m'
    systemProperty 'XXXX.conf.file', "$configOutputDir/XXXX_dev.properties"
    String protocol = "file:"
    systemProperty 'logback.configurationFile', protocol + new File(rootProject.projectDir,"dev/log/logback.xml").getAbsolutePath()
}

war {
    String protocol = "file:"
    //systemProperty 'logback.configurationFile', protocol + new File(rootProject.projectDir,"dev/log/logback.xml").getAbsolutePath()
}

// We re-package the war so it will include the extra GradleCM meta-info.
// We use a zip task rather than a war task because the war task adds extra files such as a second web.xml
task reWar(type: Zip, dependsOn: ['war']) {
    destinationDir = file("$buildDir/libs")

    extension = 'war'
    // HACK: the input needs to be wrapped in a closure so it is evaluated lazily. This is because the 'war' task output
    // file changes once the version is set
    from { zipTree(war.archiveName) }

    //
    // Build info file
    //
    from (rootProject.buildinfo.filedir) {
        include rootProject.buildinfo.filename
        into 'META-INF'
    }
}

artifacts {
    archives reWar
}

// Ensure tests are run for uploadArchives
uploadArchives.dependsOn('check')

buildscript {
    repositories {
        maven { url "https://repo1.maven.org/maven2/" }
        maven { url "https://dl.bintray.com/jfrog/jfrog-jars/" }
        maven { url "https://repo.gradle.org/gradle/libs-releases-local/" }
        //maven { url "https://repo.spring.io/plugins-release/" }
        maven { url "https://repo.maven.apache.org/maven2/" }
        maven { url "https://repo.grails.org/grails/core" }
        mavenCentral()
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:3.3.3"
        classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
        classpath "org.gradle:gradle-tooling-api:5.+"
        classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.+"
        //classpath "org.grails.plugins:hibernate4:${gormVersion-".RELEASE"}"
    }
}