forked from spring-attic/spring-xd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-maven.gradle
166 lines (157 loc) · 4.25 KB
/
publish-maven.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
apply plugin: 'maven'
ext.optionalDeps = []
ext.providedDeps = []
ext.optional = { optionalDeps << it }
ext.provided = { providedDeps << it }
// exclude hadoop install sub projects
def hadoopInstalls=['cdh5','hadoop22','hadoop24','hdp21','phd1','phd20']
if (hadoopInstalls.contains(project.name)) {
// Disable installing hadoop distro artifacts
install.enabled = false
// Disable publishing hadoop distro artifacts
project.tasks.findByPath("artifactoryPublish")?.enabled = false
}
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// respect 'optional' and 'provided' dependencies
gradleProject.optionalDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true
}
gradleProject.providedDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
}
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = linkHomepage
organization {
name = 'Spring by Pivotal'
url = 'https://spring.io'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = linkScmUrl
connection = linkScmConnection
developerConnection = linkScmDevConnection
}
dependencyManagement {
dependencies {
dependency {
groupId = 'io.spring.platform'
artifactId = 'platform-bom'
version = platformVersion
scope = 'import'
type = 'pom'
}
}
}
developers {
developer {
id = 'markfisher'
name = 'Mark Fisher'
email = '[email protected]'
}
developer {
id = 'markpollack'
name = 'Mark Pollack'
email = '[email protected]'
}
developer {
id = 'garyrussell'
name = 'Gary Russell'
email = '[email protected]'
}
developer {
id = 'ghillert'
name = 'Gunnar Hillert'
email = '[email protected]'
}
developer {
id = 'pperalta'
name = 'Patrick Peralta'
email = '[email protected]'
}
developer {
id = 'dturanski'
name = 'David Turanski'
email = '[email protected]'
}
developer {
id = 'ebottard'
name = 'Eric Bottard'
email = '[email protected]'
}
developer {
id = 'grenfro'
name = 'Glenn Renfro'
email = '[email protected]'
}
developer {
id = 'igopinathan'
name = 'Ilayaperumal Gopinathan'
email = '[email protected]'
}
developer {
id = 'trisberg'
name = 'Thomas Risberg'
email = '[email protected]'
}
developer {
id = 'jhickey'
name = 'Jennifer Hickey'
}
developer {
id = 'mminella'
name = 'Michael Minella'
email = '[email protected]'
}
developer {
id = 'ltaylor'
name = 'Luke Taylor'
email = '[email protected]'
}
developer {
id = 'aclement'
name = 'Andy Clement'
email = '[email protected]'
}
developer {
id = 'dsyer'
name = 'Dave Syer'
email = '[email protected]'
}
developer {
id = 'jvalkealahti'
name = 'Janne Valkealahti'
email = '[email protected]'
}
developer {
id = 'jbrisbin'
name = 'Jon Brisbin'
email = '[email protected]'
}
developer {
id = 'tdarimont'
name = 'Thomas Darimont'
email = '[email protected]'
}
}
}
}
}