【发布时间】:2016-04-28 17:19:17
【问题描述】:
我在 Spring Tool Suite 中使用 Spring Boot 和 Gradle 创建了一个项目,但我真的不知道如何导出以使其工作。
我对 gradle 了解不多,只是从 maven 存储库添加依赖项的基础知识。所以在一些文章中说应用应用程序插件来完成任务,但我不知道如何设置配置文件以及如何创建可执行文件。
如果有人可以编写或链接一步一步的详细说明,将不胜感激。
这是我的 build.gradle 文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
springBoot {
mainClass = "com.rodamientosbulnes.objetivosventa.Application"
executable = true
}
jar {
baseName = 'objetivosventa'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework:spring-jdbc')
compile('net.sourceforge.jtds:jtds:1.3.1')
compile('org.apache.poi:poi-ooxml:3.13')
compile('com.miglayout:miglayout-swing:4.2')
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
【问题讨论】:
标签: java spring gradle spring-boot