1

我刚开始使用 gae 插件。问题是当我运行 gradle gaeRun 时出现异常:

com.google.apphosting.utils.config.AppEngineConfigException:找不到../myapp/build/exploded-war/WEB-INF/appengine-web.xml

到目前为止,我设法通过在我的 gradle.build 脚本中添加以下内容来解决这个问题:

gaeRun.doFirst{
copy {
    from('war/WEB-INF/') {
        include '**/*'
    }

    into 'build/exploded-war/WEB-INF/'
 }
}

这是正确的方法吗?下面是整个脚本:

apply plugin: 'gae'
apply plugin: 'eclipse'
apply plugin: 'scala'

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

buildscript {
repositories { mavenCentral() }
dependencies { 
    classpath 'org.gradle.api.plugins:gradle-gae-plugin:0.7.6' 
}
}

repositories {
mavenCentral()
}

dependencies {
scalaTools 'org.scala-lang:scala-compiler:2.9.1'
scalaTools 'org.scala-lang:scala-library:2.9.1'

compile 'org.scala-lang:scala-library:2.9.1'
testCompile group: 'junit', name: 'junit', version: '4.8.2'
}

gae {
httpPort = 8085
optimizeWar = true

appcfg {
    email = 'email@gmail.com'
    passIn = true

    logs {
        severity = 1
        outputFile = file('mylogs.txt')
    }

    app { id = 'sample-app' }
}
}

gaeRun.doFirst{
    copy {
        from('war/WEB-INF/') {
        include '**/*'
    }

        into 'build/exploded-war/WEB-INF/'
 }
}
4

0 回答 0