Skip to content

Commit 9ee4911

Browse files
committed
fix multimodule project with bom maven central publication
1 parent f9e8f7a commit 9ee4911

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* Update ru.vyarus.java-lib 2.2.1 -> 2.2.2 (disable publication option, support submodules without coverage)
2+
* Fix multi-module with bom mavne central publication:
3+
- pom section from allprojects wasn't applied in subprojects because java plugin is activated only in subprojects
4+
- bom was not publishing
5+
16
### 3.0.2 (2021-09-06)
27
* Fix multi-module project release
38
* Replace travis with github actions

app/templates/project-multi/build.gradle

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
id 'jacoco'
66
id 'java-platform'
7-
id 'ru.vyarus.java-lib' version '2.2.1'
7+
id 'ru.vyarus.java-lib' version '2.2.2'
88
id 'net.researchgate.release' version '2.8.1'
99
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
1010
id 'com.github.ben-manes.versions' version '0.39.0'
@@ -46,6 +46,7 @@ javaLib {
4646
allprojects {
4747
apply plugin: 'project-report'
4848
apply plugin: 'ru.vyarus.github-info'
49+
apply plugin: 'ru.vyarus.java-lib'
4950
apply plugin: 'signing'
5051

5152
repositories { mavenLocal(); mavenCentral() }
@@ -57,12 +58,16 @@ allprojects {
5758
license = 'MIT'
5859
}
5960

60-
pom {
61-
developers {
62-
developer {
63-
id '<%= githubUser %>'
64-
name '<%= authorName %>'
65-
email '<%= authorEmail %>'
61+
// delay required because java plugin is activated only in subprojects and without it
62+
// pom closure would reference root project only
63+
afterEvaluate {
64+
pom {
65+
developers {
66+
developer {
67+
id '<%= githubUser %>'
68+
name '<%= authorName %>'
69+
email '<%= authorEmail %>'
70+
}
6671
}
6772
}
6873
}
@@ -77,7 +82,6 @@ allprojects {
7782
subprojects {
7883
apply plugin: 'groovy'
7984
apply plugin: 'jacoco'
80-
apply plugin: 'ru.vyarus.java-lib'
8185
apply plugin: 'ru.vyarus.quality'
8286
apply plugin: 'com.github.ben-manes.versions'
8387

@@ -87,7 +91,7 @@ subprojects {
8791
dependencies {
8892
implementation platform(project(':'))
8993

90-
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.2.3'
94+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.4.2'
9195

9296
implementation 'org.slf4j:slf4j-api'
9397

@@ -132,6 +136,7 @@ nexusPublishing {
132136

133137
// release manages only root project (subprojects will be checked and released implicitly)
134138
afterReleaseBuild {
139+
dependsOn 'publishToSonatype'
135140
dependsOn subprojects.collect {":$it.name:publishToSonatype" }
136141
dependsOn 'closeAndReleaseSonatypeStagingRepository'
137142
doLast {

0 commit comments

Comments
 (0)