Skip to content

Commit 5cf82a8

Browse files
committed
Migrate publishing from OSSRH to Maven Central Portal
- Remove oss-parent:9 inheritance - Add central-publishing-maven-plugin for direct Central Portal publishing - Add distributionManagement for snapshot repository - Consolidate release profiles (merge release-sign-artifacts into release) - Update release script to remove manual OSSRH steps - Fix dependency version conflicts: - JUnit BOM: 5.13.2 → 5.13.4 (match mockito requirement) - maven-shared-utils: 3.3.4 → 3.4.2 (match maven-core) - maven-plugin-api: 2.2.1 → 3.9.11 (match maven-core) - Exclude kotlin dependencies from Moshi
1 parent 762d784 commit 5cf82a8

4 files changed

Lines changed: 77 additions & 43 deletions

File tree

jsonschema2pojo-integration-tests/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@
5353
</plugins>
5454
</build>
5555

56-
<dependencyManagement>
57-
<dependencies>
58-
<!-- Enforcer RequireUpperBoundDeps failed due to the Moshi dependency -->
59-
<!-- Need to specify the exact Kotlin version to use -->
60-
<dependency>
61-
<groupId>org.jetbrains.kotlin</groupId>
62-
<artifactId>kotlin-bom</artifactId>
63-
<version>1.4.31</version>
64-
<type>pom</type>
65-
<scope>import</scope>
66-
</dependency>
67-
</dependencies>
68-
</dependencyManagement>
69-
7056
<dependencies>
7157
<dependency>
7258
<groupId>${project.groupId}</groupId>

jsonschema2pojo-jdk-annotation/pom.xml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,56 @@
22

33
<modelVersion>4.0.0</modelVersion>
44

5-
<parent>
6-
<groupId>org.sonatype.oss</groupId>
7-
<artifactId>oss-parent</artifactId>
8-
<version>9</version>
9-
</parent>
10-
115
<groupId>org.jsonschema2pojo</groupId>
126
<artifactId>jsonschema2pojo-jdk-annotation</artifactId>
137
<version>0.0.2-SNAPSHOT</version>
148

9+
<name>jsonschema2pojo-jdk-annotation</name>
10+
<description>Library to easily acquire the JDK 8-compatible javax.annotation.Generated annotation, for cases when javax.annotation-api cannot be used</description>
11+
<url>https://github.com/joelittlejohn/jsonschema2pojo</url>
12+
13+
<developers>
14+
<developer>
15+
<name>Joe Littlejohn</name>
16+
<email>joe.littlejohn@gmail.com</email>
17+
</developer>
18+
</developers>
19+
20+
<licenses>
21+
<license>
22+
<name>Apache License, Version 2.0</name>
23+
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
24+
</license>
25+
</licenses>
26+
1527
<scm>
1628
<url>https://github.com/joelittlejohn/jsonschema2pojo</url>
1729
<connection>scm:git:git@github.com:joelittlejohn/jsonschema2pojo.git</connection>
1830
<developerConnection>scm:git:git@github.com:joelittlejohn/jsonschema2pojo.git</developerConnection>
1931
</scm>
2032

21-
<name>jsonschema2pojo-jdk-annotation</name>
33+
<distributionManagement>
34+
<snapshotRepository>
35+
<id>central</id>
36+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
37+
</snapshotRepository>
38+
</distributionManagement>
39+
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.sonatype.central</groupId>
44+
<artifactId>central-publishing-maven-plugin</artifactId>
45+
<version>0.9.0</version>
46+
<extensions>true</extensions>
47+
<configuration>
48+
<publishingServerId>central</publishingServerId>
49+
<autoPublish>true</autoPublish>
50+
<waitUntil>published</waitUntil>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</build>
2255

2356
<profiles>
2457
<profile>

jsonschema2pojo-upload-release

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
#
55
# To create a new release:
66
#
7-
# 1. Maven release command:
7+
# 1. Maven release command (publishes directly to Maven Central Portal):
88
# export GPG_TTY=$(tty)
99
# ./mvnw clean release:clean release:prepare release:perform -DautoVersionSubmodules
1010
#
11-
# 2. Close and Release snapshots repo at oss.sonatype.org
12-
#
13-
# 3. Wait at least 2hrs for synchronization to central
14-
#
15-
# 4. Run this script to publish new release to github
11+
# 2. Run this script to publish new release to github
1612
#
1713
set -e
1814

pom.xml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
<modelVersion>4.0.0</modelVersion>
44

5-
<parent>
6-
<groupId>org.sonatype.oss</groupId>
7-
<artifactId>oss-parent</artifactId>
8-
<version>9</version>
9-
</parent>
10-
115
<groupId>org.jsonschema2pojo</groupId>
126
<artifactId>jsonschema2pojo</artifactId>
137
<version>1.2.3-SNAPSHOT</version>
@@ -17,6 +11,13 @@
1711
<description>Generate DTO style Java classes from JSON Schema documents</description>
1812
<url>https://github.com/joelittlejohn/jsonschema2pojo</url>
1913

14+
<distributionManagement>
15+
<snapshotRepository>
16+
<id>central</id>
17+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
18+
</snapshotRepository>
19+
</distributionManagement>
20+
2021
<modules>
2122
<module>jsonschema2pojo-cli</module>
2223
<module>jsonschema2pojo-core</module>
@@ -143,6 +144,11 @@
143144
<artifactId>maven-release-plugin</artifactId>
144145
<version>3.3.1</version>
145146
</plugin>
147+
<plugin>
148+
<groupId>org.sonatype.central</groupId>
149+
<artifactId>central-publishing-maven-plugin</artifactId>
150+
<version>0.9.0</version>
151+
</plugin>
146152
<plugin>
147153
<artifactId>maven-resources-plugin</artifactId>
148154
<version>3.4.0</version>
@@ -290,12 +296,22 @@
290296
</execution>
291297
</executions>
292298
</plugin>
299+
<plugin>
300+
<groupId>org.sonatype.central</groupId>
301+
<artifactId>central-publishing-maven-plugin</artifactId>
302+
<extensions>true</extensions>
303+
<configuration>
304+
<publishingServerId>central</publishingServerId>
305+
<autoPublish>false</autoPublish>
306+
<waitUntil>validated</waitUntil>
307+
</configuration>
308+
</plugin>
293309
</plugins>
294310
</build>
295311

296312
<profiles>
297313
<profile>
298-
<id>release-sign-artifacts</id>
314+
<id>release</id>
299315
<activation>
300316
<property>
301317
<name>performRelease</name>
@@ -316,13 +332,6 @@
316332
</execution>
317333
</executions>
318334
</plugin>
319-
</plugins>
320-
</build>
321-
</profile>
322-
<profile>
323-
<id>release</id>
324-
<build>
325-
<plugins>
326335
<plugin>
327336
<artifactId>maven-source-plugin</artifactId>
328337
<executions>
@@ -361,7 +370,7 @@
361370
<dependency>
362371
<groupId>org.junit</groupId>
363372
<artifactId>junit-bom</artifactId>
364-
<version>5.13.2</version>
373+
<version>5.13.4</version>
365374
<type>pom</type>
366375
<scope>import</scope>
367376
</dependency>
@@ -405,6 +414,16 @@
405414
<groupId>com.squareup.moshi</groupId>
406415
<artifactId>moshi</artifactId>
407416
<version>${moshi.version}</version>
417+
<exclusions>
418+
<exclusion>
419+
<groupId>org.jetbrains.kotlin</groupId>
420+
<artifactId>kotlin-reflect</artifactId>
421+
</exclusion>
422+
<exclusion>
423+
<groupId>org.jetbrains.kotlin</groupId>
424+
<artifactId>kotlin-stdlib-jdk8</artifactId>
425+
</exclusion>
426+
</exclusions>
408427
</dependency>
409428
<dependency>
410429
<groupId>com.google.code.javaparser</groupId>
@@ -492,7 +511,7 @@
492511
<dependency>
493512
<groupId>org.apache.maven</groupId>
494513
<artifactId>maven-plugin-api</artifactId>
495-
<version>2.2.1</version>
514+
<version>3.9.11</version>
496515
<scope>provided</scope>
497516
</dependency>
498517
<dependency>

0 commit comments

Comments
 (0)