Skip to content

[DRAFT] Add Maven Central publishing configuration#189

Draft
rdeepak2002 wants to merge 14 commits intoNetflix:mainfrom
rdeepak2002:feature/maven-central-publishing
Draft

[DRAFT] Add Maven Central publishing configuration#189
rdeepak2002 wants to merge 14 commits intoNetflix:mainfrom
rdeepak2002:feature/maven-central-publishing

Conversation

@rdeepak2002
Copy link
Collaborator

@rdeepak2002 rdeepak2002 commented Dec 20, 2025

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew build --write-locks to refresh dependencies)
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

Add Maven Central Publishing Configuration

Goal: Enable publishing Maestro modules to Maven Central so Netflix's internal Maestro can consume them as dependencies (e.g., com.netflix.maestro:maestro-flow:1.0.0).

Changes

Publishing Setup (following Netflix Nebula OSS pattern):

  • Added com.netflix.nebula.netflixoss plugin (v11.6.0) for Maven Central publishing
  • Applied plugin to all 12 library modules (excludes maestro-server - it's an application)
  • Configured netflixossPublishCandidatesToMavenCentral=true in gradle.properties

Build Configuration:

  • Configured javadoc to be lenient with Lombok-annotated code (standard approach for OSS projects)
  • Set group = 'com.netflix.maestro' for all publishable modules including netflix-sel
  • Uses Maestro's existing Lombok configuration - no additional plugins needed

CI/CD Workflow:

  • Updated GitHub Actions to use Nebula's snapshot and final tasks
  • Snapshots: ./gradlew build snapshot (auto-publishes on push to main)
  • Releases: ./gradlew -Prelease.useLastTag=true final (triggered by version tags like v1.0.0)
  • Uses NETFLIX_OSS_* environment variables for Sonatype credentials

Documentation:

  • Added PUBLISHING.md with release process documentation
  • Updated README.md with library usage examples

Key Implementation Details

Nebula Plugin Application:
The plugin must be applied to each subproject, not just declared at root level. This was discovered by analyzing Genie's actual implementation.

Javadoc with Lombok:
Uses standard Gradle javadoc configuration with failOnError = false - a pragmatic, widely-used approach that avoids unnecessary third-party plugin dependencies while maintaining Maven Central compatibility.

Published Modules (12 total)

All library modules published to com.netflix.maestro:
netflix-sel, maestro-common, maestro-dsl, maestro-engine, maestro-database, maestro-flow, maestro-queue, maestro-timetrigger, maestro-signal, maestro-aws, maestro-kubernetes, maestro-http

Testing

Local publishing verified:
./gradlew publishToMavenLocal
All 12 modules published successfully to ~/.m2/repository/com/netflix/maestro/

Next Steps (Post-Merge)

  1. Set up Sonatype OSSRH account and claim com.netflix.maestro group ID
  2. Generate GPG keys and configure GitHub secrets
  3. Test snapshot publishing to Maven Central
  4. Create first release tag for production publishing

- Configure Nebula Netflix OSS plugin for publishing (same as Genie)
- Add gradle.properties with Maven Central publishing enabled
- Update GitHub Actions workflow for automatic snapshot/release publishing
- Add PUBLISHING.md documentation for release process
- Update README.md with library usage instructions

This enables publishing all 13 Maestro modules to Maven Central, allowing
Netflix's internal Maestro to consume modules like maestro-flow as
dependencies.
- Use 'build snapshot' instead of 'snapshot publish -x test'
- Use '-Prelease.useLastTag=true final' instead of 'final publish -x test'
- Remove softprops/action-gh-release (not used by Genie)

These changes ensure we follow Netflix Genie's exact Nebula plugin usage.
Genie uses default shallow clone (fetch-depth: 1) and it works fine.
Nebula doesn't need full git history when using -Prelease.useLastTag=true.
Keep only the publishing configuration to match Genie's minimal approach.
Key changes:
- Apply com.netflix.nebula.netflixoss to all projects except maestro-server
- Add io.franzbecker.gradle-lombok plugin for Lombok support
- Configure javadoc to not fail on errors (common with Lombok)
- Set group='com.netflix.maestro' for all publishable projects
- Exclude maestro-server from publishing (it's an application)
- Include netflix-sel in publishing

Now publishToMavenLocal works correctly for all 12 library modules.
…ation

- Removed io.franzbecker:gradle-lombok (deprecated since 2021)
- Removed lombok version configuration
- Uses only standard Gradle javadoc configuration with failOnError=false
- Maestro already has Lombok configured via compileOnly/annotationProcessor
- Minimal approach without unnecessary third-party plugins
- Restored group = 'com.netflix.maestro' to configure block that includes maestro-server
- Updated dependency locks
- Publishing works successfully: ./gradlew publishToMavenLocal passes
- Note: maestro-server has Spring Boot ASM issue requiring investigation
- Root cause: Nebula plugin pollutes global buildscript classpath causing Spring Boot ASM conflict
- Solution: Exclude maestro-server from all build/publish commands via -x flag
- Updated CI/CD workflows to use -x maestro-server:build -x test
- Publishing works perfectly for all 12 library modules
- maestro-server is not published anyway (it's an application, not a library)
- Remove root gradle.lockfile (created during troubleshooting, not needed)
- Revert maestro-server/gradle.lockfile to original state
- These changes were from troubleshooting the Spring Boot ASM issue
- Lockfile updates didn't fix the issue and are unrelated to publishing
- Add Spring Boot plugin declaration with 'apply false' to root build.gradle
- Remove version from maestro-server Spring Boot plugin (inherits from root)
- This isolates Spring Boot plugin buildscript dependencies from Nebula plugin
- Resolves java.lang.NoSuchMethodError for org.springframework.asm.Type

The 'apply false' pattern prevents buildscript classpath pollution and ASM
version conflicts between Nebula Netflix OSS plugin and Spring Boot plugin.

References Netflix Genie's build configuration for multi-module projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant