其他分享
首页 > 其他分享> > Gradle build.gradle

Gradle build.gradle

作者:互联网

Summary

buildscript 区域

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "org.grails.plugins:hibernate5:${gormVersion - ".RELEASE"}"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
    }
}

基本属性

version "0.1"
group "com.next"

plugin 插件

apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "asset-pipeline"
apply plugin: "org.grails.grails-gsp"

repositories 区域

dependencies 区域

dependencies {
    // compile 阶段需要使用的依赖,如下两种写法都可以。
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'

    // runtime 阶段需要使用到的依赖。
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.+"
    testCompile "org.grails:grails-web-testing-support"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.+"
    // 第三方jar包的一种添加方式
    compile fileTree(dir: 'libs', include: '*.jar')
}

bootRun 区域

bootRun {
    jvmArgs('-Dspring.output.ansi.enabled=always')
    jvmArgs('-Xmx4096m')
    addResources = true
    String springProfilesActive = 'spring.profiles.active'
    systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}

grails 区域?

grails {
    pathingJar = true
}

assets 区域?

assets {
    minifyJs = true
    minifyCss = true
}

标签:plugin,grails,Gradle,区域,build,apply,org,gradle
来源: https://www.cnblogs.com/duchaoqun/p/13130435.html