0
我已经在Ubuntu 14.04上安装了Gradle 2.0,并且我想用Gradle运行一个小的Web应用程序,但是当我在Eclipse Luna上构建Gradle项目时(我已经安装了用于Eclipse 4.4的Gradle集成插件),我在终端上输入“gradle tasks”,它不会显示任务“jettyEclipse”来运行servlet。Gradle与Eclipse的集成
这里我的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] -----------------------------------------------------
在这里,我的 “gradle这个任务” 输出:
: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'的目录运行'gradle tasks'一样,甚至没有显示Java插件的任务,这个问题不太可能与'jettyEclipse'插件相关。 – 2014-10-10 12:37:02
非常感谢。从我的主目录运行gradle ... – 2014-10-10 15:12:35