gradle

1 篇文章 0 订阅

build.gradle

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'eclipse-wtp'

ext {
    springVersion = '3.2.0.RELEASE'
    strutsVersion = '2.3.16.1'
    hibernateVersion = '3.6.10.Final'
}


// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'jcenter' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

// In this section you declare the dependencies for your production and test code
dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5'
    providedCompile 'javax.servlet.jsp:jsp-api:2.2'
    runtime 'javax.servlet:jstl:1.1.2'
    runtime 'mysql:mysql-connector-java:5.1.33'

    // The production code uses the SLF4J logging API at compile time
    compile 'org.slf4j:slf4j-api:1.7.13'
    compile 'org.slf4j:slf4j-nop:1.7.13'
    compile 'log4j:log4j:1.2.17'
    compile 'net.sourceforge.jexcelapi:jxl:2.6.12'
    compile 'p6spy:p6spy:2.1.2'
    compile 'commons-dbcp:commons-dbcp:1.4'


    testCompile 'junit:junit:4.11'
    testCompile 'org.hamcrest:hamcrest-core:1.3'
    testCompile 'org.hamcrest:hamcrest-library:1.3'

    // struts
    compile group: 'org.apache.struts', name: 'struts2-core', version: strutsVersion
    compile group: 'org.apache.struts', name: 'struts2-spring-plugin', version: strutsVersion
    compile group: 'org.apache.struts', name: 'struts2-json-plugin', version: strutsVersion
    compile group: 'org.apache.struts', name: 'struts2-junit-plugin', version: strutsVersion

    // hibernate
    compile group: 'org.hibernate', name: 'hibernate-core', version: hibernateVersion

    // spring
    compile group: 'org.springframework', name: 'spring-core', version: springVersion
    compile group: 'org.springframework', name: 'spring-web', version: springVersion
    compile group: 'org.springframework', name: 'spring-orm', version: springVersion
    compile group: 'org.springframework', name: 'spring-aop', version: springVersion
    compile group: 'org.springframework', name: 'spring-aspects', version: springVersion
    compile group: 'org.springframework', name: 'spring-jdbc', version: springVersion
    compile group: 'org.springframework', name: 'spring-beans', version: springVersion
    compile group: 'org.springframework', name: 'spring-test', version: springVersion

    // spring-security
    compile group: 'org.springframework.security', name: 'spring-security-web', version: springVersion
    compile group: 'org.springframework.security', name: 'spring-security-config', version: springVersion
    compile group: 'org.springframework.security', name: 'spring-security-taglibs', version: springVersion
}

jettyRun {
//    webAppSourceDirectory = file("src/main/webapp/")
//    contextPath = 'myTMS'
    httpPort = 8080
    stopPort = 9999
}

gradle.properties

// 设置代理
systemProp.http.proxyHost=example.com
systemProp.http.proxyPort=1234
systemProp.https.proxyHost=example.com
systemProp.https.proxyPort=1234

gradle 命令

gradle clean
gradle build
gradle jar
gradle jettyRun
gradle properties

jar 包存储

~/.gradle/caches/modules-2/files-2.1

打可执行jar包

jar {
    manifest {
        attributes 'Main-Class': 'xxx.xx.MainClass'
    }
}
gradle jar

以上方式是不包含依赖包

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值