cobigen icon indicating copy to clipboard operation
cobigen copied to clipboard

Migrate from nexus-staging-maven-plugin to central-publishing-maven-plugin

Open Copilot opened this issue 7 months ago • 1 comments

This PR migrates the CobiGen project from the legacy OSS1 Sonatype deployment system (nexus-staging-maven-plugin) to the new Central Sonatype deployment system (central-publishing-maven-plugin).

Changes Made

1. Updated Maven Plugin Configuration

  • Replaced nexus-staging-maven-plugin (v1.6.8) with central-publishing-maven-plugin (v0.6.0)
  • Configured new plugin with:
    • publishingServerId: central
    • autoPublish: false (manual publishing)
    • skipPublishing: ${skip.deployment} (respects existing deployment skip logic)

2. Removed Distribution Management

  • Removed the entire <distributionManagement> section from the main POM
  • The new plugin automatically derives repository URLs, eliminating the need for manual configuration

3. Updated Server Credentials

  • Changed server ID from ossrh to central in .mvn/ci-settings.xml
  • This aligns with the new Central Sonatype authentication requirements

4. Updated Repository URLs

  • Updated snapshot repository URL from https://s01.oss.sonatype.org/content/repositories/snapshots/ to https://central.sonatype.com/repository/maven-snapshots
  • Applied changes to:
    • Main POM repositories section
    • 14 template POM files in test resources
    • 4 test data settings.xml files

5. Updated Repository Names and IDs

  • Changed repository IDs from ossrh to central
  • Updated repository names from "OSSRH Snapshots" to "Central Repository Snapshots"

Files Modified

  • pom.xml - Main configuration changes
  • .mvn/ci-settings.xml - Server credential configuration
  • 14 template POM files in cobigen-templates/*/src/test/resources/utils/pom.xml
  • 4 test data files in cobigen/core-artifact-retriever/src/test/resources/testdata/
  • 2 test template files in cobigen/cobigen-core/src/test/resources/testdata/

Validation

✅ XML structure validated as well-formed
✅ Maven validate phase passes successfully
✅ Central publishing plugin loads correctly
✅ Non-Eclipse modules build successfully with new configuration

The migration follows all requirements from the Central Sonatype documentation and maintains backward compatibility with existing deployment workflows.

Fixes #1700.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • archive.eclipse.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/cobigen/cobigen org.codehaus.plexus.classworlds.launcher.Launcher clean compile -U (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/cobigen/cobigen org.codehaus.plexus.classworlds.launcher.Launcher help:evaluate -Dexpression=project.modules (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/cobigen/cobigen org.codehaus.plexus.classworlds.launcher.Launcher help:effective-pom -q -Doutput=/tmp/effective-pom.xml (dns block)
  • repository.sonatype.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/cobigen/cobigen org.codehaus.plexus.classworlds.launcher.Launcher clean compile -U (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Jul 10 '25 19:07 Copilot