gradle:“无法确定要执行哪些任务。”

发布于 2024-09-14 22:40:07 字数 1871 浏览 6 评论 0原文

我收到了以下 gradle 构建文件 (gae.gradle) 以及来自 SpringSource 的示例项目,但是当我尝试使用 gradle 运行它时:

gradle gae

它会生成错误:

FAILURE: Could not determine which tasks to execute.

这是一个格式正确的 gradle 文件还是 am我做错了什么吗?

我是否应该用 Maven 来运行它?

apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'gae'

gaeVersion="1.3.5"

repositories {
    // Hibernate Validator
    mavenRepo name: 'JBoss', urls: 'https://repository.jboss.org/nexus/content/repositories/releases'
    // GAE Jars
    mavenRepo name: 'GAE', urls:'http://maven-gae-plugin.googlecode.com/svn/repository'
}

// Remove logback as it causes security issues with GAE.
configurations.runtime.exclude(group: 'ch.qos.logback')

dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5@jar',
                    "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion"

    compile project(':spring-security-core'),
            project(':spring-security-web'),
            "org.springframework:spring-beans:$springVersion",
            "org.springframework:spring-web:$springVersion",
            "org.springframework:spring-webmvc:$springVersion",
            "org.springframework:spring-context:$springVersion",
            "org.springframework:spring-context-support:$springVersion",
            'javax.validation:validation-api:1.0.0.GA',
            'org.hibernate:hibernate-validator:4.1.0.Final',
            "org.slf4j:slf4j-api:$slf4jVersion"

    runtime project(':spring-security-config'),
            "org.slf4j:jcl-over-slf4j:$slf4jVersion",
            "org.slf4j:slf4j-jdk14:$slf4jVersion"
    testCompile "com.google.appengine:appengine-testing:$gaeVersion"

    testRuntime "com.google.appengine:appengine-api-labs:$gaeVersion",
                "com.google.appengine:appengine-api-stubs:$gaeVersion"

}

I received the following gradle build file (gae.gradle) with a sample project from SpringSource but when I attempt to run it with gradle as:

gradle gae

it generates the error:

FAILURE: Could not determine which tasks to execute.

Is this a properly formatted gradle file or am I doing something wrong?

Is it possible I should be running this with maven instead?

apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'gae'

gaeVersion="1.3.5"

repositories {
    // Hibernate Validator
    mavenRepo name: 'JBoss', urls: 'https://repository.jboss.org/nexus/content/repositories/releases'
    // GAE Jars
    mavenRepo name: 'GAE', urls:'http://maven-gae-plugin.googlecode.com/svn/repository'
}

// Remove logback as it causes security issues with GAE.
configurations.runtime.exclude(group: 'ch.qos.logback')

dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5@jar',
                    "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion"

    compile project(':spring-security-core'),
            project(':spring-security-web'),
            "org.springframework:spring-beans:$springVersion",
            "org.springframework:spring-web:$springVersion",
            "org.springframework:spring-webmvc:$springVersion",
            "org.springframework:spring-context:$springVersion",
            "org.springframework:spring-context-support:$springVersion",
            'javax.validation:validation-api:1.0.0.GA',
            'org.hibernate:hibernate-validator:4.1.0.Final',
            "org.slf4j:slf4j-api:$slf4jVersion"

    runtime project(':spring-security-config'),
            "org.slf4j:jcl-over-slf4j:$slf4jVersion",
            "org.slf4j:slf4j-jdk14:$slf4jVersion"
    testCompile "com.google.appengine:appengine-testing:$gaeVersion"

    testRuntime "com.google.appengine:appengine-api-labs:$gaeVersion",
                "com.google.appengine:appengine-api-stubs:$gaeVersion"

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好听的两个字的网名 2024-09-21 22:40:07

您可以尝试运行: gradle -b gae.gradle -t

这将为您提供此构建文件中可用的任务列表。然后,您可以使用以下命令运行其中一项任务: gradle -b gae.gradle task-name

You might try running: gradle -b gae.gradle -t

This will give you a list of the tasks which are available in this build file. Then you can run one of the tasks using: gradle -b gae.gradle task-name

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文