Java 使用gradle而不是eclipse构建
我对整个tomcat/spring/eclipse世界都很陌生。Java 使用gradle而不是eclipse构建,java,eclipse,spring,gradle,Java,Eclipse,Spring,Gradle,我对整个tomcat/spring/eclipse世界都很陌生。 我在android项目中使用了gradle 这是一个带有tomcat/spring/eclipse的项目,我想用gradle来构建它 我从网上的一个教程复制了build.gradle文件 buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframewo
我在android项目中使用了gradle 这是一个带有tomcat/spring/eclipse的项目,我想用gradle来构建它 我从网上的一个教程复制了build.gradle文件
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-serving-web-content'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
testCompile("junit:junit")
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
现在我运行了>gradlebuild
,看到大量错误,上面写着“org.springframework.**不存在”
我想我需要告诉gradle在下面包含*.jar文件
WebContent/WEB-INF/lib
目录,但不知道如何操作
如果需要提供更多信息,请告诉我。要从
WebContent/WEB-INF/lib
和子文件夹添加所有jar文件,您必须包括第一行:
dependencies {
compile(fileTree(dir: "WebContent/WEB-INF/lib", include: "**/*.jar"))
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
testCompile("junit:junit")
}