簡體   English   中英

使用gradle而不是Eclipse構建

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM