Skip to content

Commit 5f1da08

Browse files
committed
Fix missing name and description in POM
The subprojects configuration in the `build.gradle` of the root project is executed before the build scripts of the subprojects are executed. Since the name and the description for the POM is set in the build scripts of the subprojects this information is not yet available at the time when the POM is configured in the root build script. This commit fixes this by postponing the POM configuration to the after-evaluation phase of the build.
1 parent 0260d44 commit 5f1da08

File tree

1 file changed

+82
-78
lines changed

1 file changed

+82
-78
lines changed

build.gradle

Lines changed: 82 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,6 @@ subprojects {
6767
group 'build'
6868
}
6969

70-
task publish {
71-
dependsOn tasks.uploadArchives
72-
}
73-
74-
configurations {
75-
mavenDeploySupport
76-
}
77-
78-
dependencies {
79-
mavenDeploySupport "org.apache.maven.wagon:wagon-http:2.2"
80-
}
81-
8270
artifacts {
8371
archives sourceJar
8472
archives javadocJar
@@ -91,90 +79,106 @@ subprojects {
9179
sign configurations.archives
9280
}
9381

94-
def mavenProjectDescription = {
95-
name project.mavenName ?: project.name
96-
if (project.description) {
97-
description project.description
82+
repositories {
83+
mavenLocal()
84+
mavenCentral()
85+
}
86+
}
87+
88+
gradle.projectsEvaluated {
89+
subprojects {
90+
configurations {
91+
mavenDeploySupport
9892
}
99-
url 'https://github.com/culturegraph/metafacture-core'
100-
inceptionYear '2011'
101-
organization {
102-
name 'Deutsche Nationalbibliothek'
103-
url 'http://dnb.de/'
93+
94+
dependencies {
95+
mavenDeploySupport "org.apache.maven.wagon:wagon-http:2.2"
10496
}
105-
licenses {
106-
license {
107-
name 'The Apache License, Version 2.0'
108-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
97+
98+
def mavenProjectDescription = {
99+
name project.mavenName ?: project.name
100+
if (project.description) {
101+
description project.description
109102
}
110-
}
111-
mailingLists {
112-
mailingList {
113-
name 'Metafacture Mailing List'
114-
115-
subscribe '[email protected]'
116-
unsubscribe '[email protected]'
117-
archive 'http://lists.dnb.de/pipermail/metafacture/'
103+
url 'https://github.com/culturegraph/metafacture-core'
104+
inceptionYear '2011'
105+
organization {
106+
name 'Deutsche Nationalbibliothek'
107+
url 'http://dnb.de/'
108+
}
109+
licenses {
110+
license {
111+
name 'The Apache License, Version 2.0'
112+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
113+
}
114+
}
115+
mailingLists {
116+
mailingList {
117+
name 'Metafacture Mailing List'
118+
119+
subscribe '[email protected]'
120+
unsubscribe '[email protected]'
121+
archive 'http://lists.dnb.de/pipermail/metafacture/'
122+
}
123+
}
124+
scm {
125+
connection 'scm:git:https://github.com/metafacture/metafacture-core.git'
126+
developerConnection 'scm:git:https://github.com/metafacture/metafacture-core.git'
127+
url 'https://github.com/metafacture/metafacture-core'
128+
tag rootProject.scmInfo.tag ?: 'HEAD'
129+
}
130+
issueManagement {
131+
system 'Github'
132+
url 'https://github.com/metafacture/metafacture-core/issues'
133+
}
134+
ciManagement {
135+
system 'Travis CI'
136+
url 'https://travis-ci.org/metafacture/metafacture-core'
118137
}
119138
}
120-
scm {
121-
connection 'scm:git:https://github.com/metafacture/metafacture-core.git'
122-
developerConnection 'scm:git:https://github.com/metafacture/metafacture-core.git'
123-
url 'https://github.com/metafacture/metafacture-core'
124-
tag project.scmInfo.tag ?: 'HEAD'
125-
}
126-
issueManagement {
127-
system 'Github'
128-
url 'https://github.com/metafacture/metafacture-core/issues'
129-
}
130-
ciManagement {
131-
system 'Travis CI'
132-
url 'https://travis-ci.org/metafacture/metafacture-core'
133-
}
134-
}
135139

136-
install {
137-
repositories {
138-
mavenInstaller {
139-
pom.project mavenProjectDescription
140-
beforeDeployment {
141-
MavenDeployment deployment -> signing.signPom(deployment)
140+
install {
141+
repositories {
142+
mavenInstaller {
143+
pom.project mavenProjectDescription
144+
beforeDeployment {
145+
MavenDeployment deployment -> signing.signPom(deployment)
146+
}
142147
}
143148
}
144149
}
145-
}
146150

147-
uploadArchives {
148-
repositories {
149-
mavenDeployer {
150-
configuration = configurations.mavenDeploySupport
151-
if (project.hasProperty('releaseRepositoryUrl')) {
152-
repository(url: releaseRepositoryUrl) {
153-
if (project.hasProperty('releaseRepositoryUser')) {
154-
authentication(userName: releaseRepositoryUser,
155-
password: releaseRepositoryPassword)
151+
uploadArchives {
152+
repositories {
153+
mavenDeployer {
154+
configuration = configurations.mavenDeploySupport
155+
if (project.hasProperty('releaseRepositoryUrl')) {
156+
repository(url: releaseRepositoryUrl) {
157+
if (project.hasProperty('releaseRepositoryUser')) {
158+
authentication(userName: releaseRepositoryUser,
159+
password: releaseRepositoryPassword)
160+
}
156161
}
157162
}
158-
}
159-
if (project.hasProperty('snapshotRepositoryUrl')) {
160-
snapshotRepository(url: snapshotRepositoryUrl) {
161-
if (project.hasProperty('snapshotRepositoryUser')) {
162-
authentication(userName: snapshotRepositoryUser,
163-
password: snapshotRepositoryPassword)
163+
if (project.hasProperty('snapshotRepositoryUrl')) {
164+
snapshotRepository(url: snapshotRepositoryUrl) {
165+
if (project.hasProperty('snapshotRepositoryUser')) {
166+
authentication(userName: snapshotRepositoryUser,
167+
password: snapshotRepositoryPassword)
168+
}
164169
}
165170
}
166-
}
167-
pom.project mavenProjectDescription
168-
beforeDeployment {
169-
MavenDeployment deployment -> signing.signPom(deployment)
171+
pom.project mavenProjectDescription
172+
beforeDeployment {
173+
MavenDeployment deployment -> signing.signPom(deployment)
174+
}
170175
}
171176
}
172177
}
173-
}
174178

175-
repositories {
176-
mavenLocal()
177-
mavenCentral()
179+
task publish {
180+
dependsOn tasks.uploadArchives
181+
}
178182
}
179183
}
180184

0 commit comments

Comments
 (0)