GRADLE快速获得Jar

来源:互联网 发布:mac上不显示u盘 编辑:程序博客网 时间:2024/04/30 10:56

最快速入门的莫过于通过一个例子了,请看下面

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
apply plugin: 'java'
apply plugin: 'war'
 
 
repositories{
    mavenCentral()
}
dependencies{
    //compile('org.springframework:spring-core:2.5.6')
    //runtime('junit:junit:4+')
     
    compile('org.springframework:spring-core:3.2+')
    compile('org.hibernate:hibernate-c3p0:3.6.10.Final')
    compile('org.springframework.security:spring-security-core:2.0.8.RELEASE')
    compile('org.apache.struts:struts2-tiles-plugin:2.3.8')
    compile('org.apache.struts:struts2-spring-plugin:2.3.8')
    compile('org.apache.cxf:cxf:2.7.3')
    compile('org.springframework:spring-core:3.2+')
    compile('org.apache.cxf:cxf-rt-core:2.7.3')
    compile('org.apache.cxf:cxf-api:2.7.3')
     
    runtime('junit:junit:4+')
}

将其保存为build.gradle 
在当前目录下打开命令行 $ gradle build
然后你在build 目录下面就会发现一个war文件,你要的jar文件应该全部在里面

0 0