spring boot工程使用gradle打包

2017-07-22  本文已影响0人  sweetMemories
buildscript {
    ext {
        springBootVersion = '1.5.4.RELEASE'
    }
    repositories {
        mavenLocal()
        maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'idea'
//apply plugin: 'war'
apply plugin: 'org.springframework.boot'

version = '1.0.0'
sourceCompatibility = 1.8

repositories {
    mavenLocal()
    maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
    mavenCentral()
}

dependencies {
    compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.0')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-aop')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('com.github.pagehelper:pagehelper-spring-boot-starter:1.1.1')
    compile('com.alibaba:druid:1.0.31')
    runtime('mysql:mysql-connector-java')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

jar {
    manifest {
        attributes 'Main-Class': 'net.mrpotato.CouponApplication'
    }
}
gradle bootRepackage
java -jar xxx.jar
上一篇下一篇

猜你喜欢

热点阅读