[英]build using gradle instead of eclipse
我对整个tomcat / spring / eclipse世界非常陌生。
我为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'
}
现在我运行> gradle build
,我看到很多错误,上面写着“ org.springframework。***不存在”
我想我需要以某种方式告诉gradle在WebContent/WEB-INF/lib
目录下包括* .jar文件,但不知道如何。
请让我知道是否需要提供更多信息。
要从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")
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.