Skip to content

Commit bf0b96c

Browse files
Add flatten-maven-plugin for Sonatype Central Portal (#284)
Sonatype Central Portal validates deployed POMs as standalone files, unlike the old OSSRH/Nexus which resolved Maven properties during validation. This caused the deploy to fail because child module POMs contain unresolved `${project.groupId}`/`${project.version}` and lack inherited metadata (url, licenses, scm, developers). This adds `flatten-maven-plugin` with `flattenMode=ossrh` to the release profile. This produces self-contained POMs with resolved coordinates, versions, and inlined parent metadata. Fixes https://github.com/openzipkin/zipkin-reporter-java/actions/runs/23481323296/job/68325597619 Signed-off-by: Adrian Cole <adrian@tetrate.io>
1 parent 8165133 commit bf0b96c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ hs_err_pid*
1212

1313
# Maven
1414
target/
15+
.flattened-pom.xml
1516

1617
# IntelliJ
1718
.idea/

pom.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969

7070
<license.skip>${skipTests}</license.skip>
7171

72+
<flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
7273
<go-offline-maven-plugin.version>1.2.8</go-offline-maven-plugin.version>
7374
<!-- TODO: cleanup any redundant ignores now also in the 4.0 release (once final) -->
7475
<license-maven-plugin.version>5.0.0</license-maven-plugin.version>
@@ -292,6 +293,12 @@
292293
<version>${central-publishing-maven-plugin.version}</version>
293294
</plugin>
294295

296+
<plugin>
297+
<groupId>org.codehaus.mojo</groupId>
298+
<artifactId>flatten-maven-plugin</artifactId>
299+
<version>${flatten-maven-plugin.version}</version>
300+
</plugin>
301+
295302
<plugin>
296303
<groupId>org.eclipse.m2e</groupId>
297304
<artifactId>lifecycle-mapping</artifactId>
@@ -578,6 +585,30 @@
578585
<id>release</id>
579586
<build>
580587
<plugins>
588+
<plugin>
589+
<groupId>org.codehaus.mojo</groupId>
590+
<artifactId>flatten-maven-plugin</artifactId>
591+
<configuration>
592+
<flattenMode>ossrh</flattenMode>
593+
</configuration>
594+
<executions>
595+
<execution>
596+
<id>flatten</id>
597+
<phase>process-resources</phase>
598+
<goals>
599+
<goal>flatten</goal>
600+
</goals>
601+
</execution>
602+
<execution>
603+
<id>flatten.clean</id>
604+
<phase>clean</phase>
605+
<goals>
606+
<goal>clean</goal>
607+
</goals>
608+
</execution>
609+
</executions>
610+
</plugin>
611+
581612
<plugin>
582613
<groupId>org.sonatype.central</groupId>
583614
<artifactId>central-publishing-maven-plugin</artifactId>

0 commit comments

Comments
 (0)