gpt4 book ai didi

java - 与Eclipse的Gradle集成

转载 作者:行者123 更新时间:2023-12-03 06:20:13 26 4
gpt4 key购买 nike

我已经在Ubuntu 14.04上安装了gradle 2.0,并且希望使用Gradle运行一个Web应用程序,但是当我在Eclipse Luna上构建Gradle项目时(我已经为Eclipse 4.4安装了Gradle集成插件),然后键入“gradle task”在终端上,它不会显示运行servlet的任务“jettyEclipse”。

这是我的 build.gradle :

buildscript {
repositories {
jcenter()
}

dependencies {
classpath (group: 'com.sahlbach.gradle', name: 'gradle-jetty-eclipse-plugin', version: '1.9.2')
}
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jettyEclipse'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'


repositories {
mavenCentral()
}

dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
}

这里是编译输出:
[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] :cleanEclipse
[sts] :eclipse
[sts] -----------------------------------------------------
:cleanEclipseClasspath
:cleanEclipseJdt
:cleanEclipseProject
:cleanEclipseWtpComponent
:cleanEclipseWtpFacet
:cleanEclipseWtp
:cleanEclipse
:eclipseClasspath
:eclipseJdt
:eclipseProject
:eclipseWtpComponent
:eclipseWtpFacet
:eclipseWtp
:eclipse

BUILD SUCCESSFUL

Total time: 1.14 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 1 sec
[sts] -----------------------------------------------------

这是我的“渐变任务”输出:
:tasks

------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Build Setup tasks
-----------------
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]

Help tasks
----------
dependencies - Displays all dependencies declared in root project 'me'.
dependencyInsight - Displays the insight into a specific dependency in root project 'me'.
help - Displays a help message
projects - Displays the sub-projects of root project 'me'.
properties - Displays the properties of root project 'me'.
tasks - Displays the tasks runnable from root project 'me'.

To see all tasks and more detail, run with --all.

BUILD SUCCESSFUL

Total time: 3.35 secs

我也尝试过1.9和2.1 gradle版本。

谁能帮我?

最佳答案

我在我的主目录中执行gradle tasks,而不是在项目目录中(我在其中执行build.gradle。彼得感谢您的帮助。

关于java - 与Eclipse的Gradle集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26299424/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com