forked from apache/ofbiz-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external.gradle
67 lines (58 loc) · 1.6 KB
/
external.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
project.group = 'com.toto'
project.version = 'trunk-20180611'
ext.gradleVersion = '3.2.1'
//为增加模块版本号,全部覆盖build文件中的定义,不支持分散定义后合并的方式。
subprojects {
version = '1.0.0'
configurations {
// compile-time plugin libraries
pluginLibsCompile
// runtime plugin libraries
pluginLibsRuntime
//compile-only libraries
pluginLibsCompileOnly
}
}
task war {
}
def buildAttributes = [ 'Built-By': "gradle $gradleVersion",
'Built-date': new Date().format('yyyy-MM-dd HH:mm:ss'),
'Implementation-Title': project.name,
'Implementation-Version': project.version
]
task sourceJar(type:Jar, dependsOn: classes, description: '源代码打包生成JAR.') {
classifier 'sources'
from sourceSets.main.java
from sourceSets.main.resources.each {//resources里重复包含了.java文件
it.listFiles.each {
if (it.name.endWith('.java')) { exclude "${it.name}" }
}
}
archiveName = project.name + "-${project.version}-sources.jar"
destinationDir file("$buildDir/libs")
manifest {
attributes buildAttributes
}
}
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version project.version
//上传war文件
//from components.web
//上传jar文件
from components.java
//上传源码
artifact sourceJar {
classifier 'sources'
}
}
}
repositories {
maven {
mavenLocal()
}
}
}