Skip to content

Commit d9a47e4

Browse files
committed
Preserve Maven project information for new maven-publish artifacts. (#473)
1 parent 1ae4213 commit d9a47e4

File tree

1 file changed

+63
-66
lines changed

1 file changed

+63
-66
lines changed

build.gradle

Lines changed: 63 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,66 @@ editorconfig {
5252
]
5353
}
5454

55+
def mavenProjectDescription = { proj ->
56+
{ it ->
57+
name = proj.mavenName ?: proj.name
58+
if (proj.description) {
59+
description = proj.description
60+
}
61+
url = 'https://github.com/metafacture/metafacture-core'
62+
inceptionYear = '2011'
63+
developers {
64+
developer {
65+
id = 'mgeipel'
66+
name = 'Markus M. Geipel'
67+
68+
url = 'https://github.com/mgeipel'
69+
roles = ['architect', 'developer']
70+
}
71+
developer {
72+
id = 'cboehme'
73+
name = 'Christoph Böhme'
74+
75+
url = 'https://github.com/cboehme'
76+
roles = ['architect', 'developer']
77+
}
78+
}
79+
organization {
80+
name = 'Metafacture'
81+
url = 'https://github.com/metafacture'
82+
}
83+
licenses {
84+
license {
85+
name = 'The Apache License, Version 2.0'
86+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
87+
}
88+
}
89+
mailingLists {
90+
mailingList {
91+
name = 'Metafacture Mailing List'
92+
93+
subscribe = '[email protected]'
94+
unsubscribe = '[email protected]'
95+
archive = 'http://lists.dnb.de/pipermail/metafacture/'
96+
}
97+
}
98+
scm {
99+
connection = 'scm:git:https://github.com/metafacture/metafacture-core.git'
100+
developerConnection = 'scm:git:https://github.com/metafacture/metafacture-core.git'
101+
url = 'https://github.com/metafacture/metafacture-core'
102+
tag = rootProject.scmInfo.tag ?: 'HEAD'
103+
}
104+
issueManagement {
105+
system = 'Github'
106+
url = 'https://github.com/metafacture/metafacture-core/issues'
107+
}
108+
ciManagement {
109+
system = 'Github Actions'
110+
url = 'https://github.com/metafacture/metafacture-core/actions'
111+
}
112+
}
113+
}
114+
55115
subprojects {
56116
apply plugin: 'signing'
57117
apply plugin: 'maven'
@@ -134,6 +194,7 @@ subprojects {
134194
mavenArtifacts(MavenPublication) {
135195
from components.java
136196
afterEvaluate {
197+
pom mavenProjectDescription(project)
137198
groupId = project.group
138199
artifactId = project.name
139200
}
@@ -169,74 +230,10 @@ gradle.projectsEvaluated {
169230
mavenDeploySupport "org.apache.maven.wagon:wagon-http:2.2"
170231
}
171232

172-
def mavenProjectDescription = {
173-
name = project.mavenName ?: project.name
174-
if (project.description) {
175-
description project.description
176-
}
177-
url 'https://github.com/metafacture/metafacture-core'
178-
inceptionYear '2011'
179-
developers {
180-
developer {
181-
id 'mgeipel'
182-
name = 'Markus M. Geipel'
183-
184-
url 'https://github.com/mgeipel'
185-
roles {
186-
role 'architect'
187-
role 'developer'
188-
}
189-
}
190-
developer {
191-
id 'cboehme'
192-
name = 'Christoph Böhme'
193-
194-
url 'https://github.com/cboehme'
195-
roles {
196-
role 'architect'
197-
role 'developer'
198-
}
199-
}
200-
}
201-
organization {
202-
name = 'Metafacture'
203-
url 'https://github.com/metafacture'
204-
}
205-
licenses {
206-
license {
207-
name = 'The Apache License, Version 2.0'
208-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
209-
}
210-
}
211-
mailingLists {
212-
mailingList {
213-
name = 'Metafacture Mailing List'
214-
215-
subscribe '[email protected]'
216-
unsubscribe '[email protected]'
217-
archive 'http://lists.dnb.de/pipermail/metafacture/'
218-
}
219-
}
220-
scm {
221-
connection 'scm:git:https://github.com/metafacture/metafacture-core.git'
222-
developerConnection 'scm:git:https://github.com/metafacture/metafacture-core.git'
223-
url 'https://github.com/metafacture/metafacture-core'
224-
tag rootProject.scmInfo.tag ?: 'HEAD'
225-
}
226-
issueManagement {
227-
system 'Github'
228-
url 'https://github.com/metafacture/metafacture-core/issues'
229-
}
230-
ciManagement {
231-
system 'Github Actions'
232-
url 'https://github.com/metafacture/metafacture-core/actions'
233-
}
234-
}
235-
236233
install {
237234
repositories {
238235
mavenInstaller {
239-
pom.project mavenProjectDescription
236+
pom.project mavenProjectDescription(project)
240237
beforeDeployment {
241238
MavenDeployment deployment -> signing.signPom(deployment)
242239
}
@@ -264,7 +261,7 @@ gradle.projectsEvaluated {
264261
}
265262
}
266263
}
267-
pom.project mavenProjectDescription
264+
pom.project mavenProjectDescription(project)
268265
beforeDeployment {
269266
MavenDeployment deployment -> signing.signPom(deployment)
270267
}

0 commit comments

Comments
 (0)