Repository navigation
feat(build): publish nightly snapshot jars to the ASF Nexus snapshot repository - #220
Closed
adityamparikh wants to merge 1 commit into
Closed
adityamparikh wants to merge 1 commit into
adityamparikh wants to merge 1 commit into
Conversation
…repository Maven Central never accepts SNAPSHOT/nightly artifacts (a hard Sonatype/ Central platform rule); org.apache.* groupIds instead publish SNAPSHOT versions to the Apache Nexus snapshot repository. Wire the existing maven-publish configuration to https://repository.apache.org/content/repositories/snapshots, with credentials read lazily via providers.environmentVariable(ASF_NEXUS_USERNAME/ ASF_NEXUS_PASSWORD) so every other Gradle task keeps working with zero env vars set; only `publish` fails, loudly, when credentials are missing. Add a nightly-jar.yml workflow (2 AM UTC cron + workflow_dispatch, guarded to apache/solr-mcp, secret presence checked inside a run: step rather than an if: condition per the parse-time bug fixed in PR apache#218) and dev-docs/ NIGHTLY_JAR.md documenting the flow. The ASF Nexus deploy credentials (ASF_NEXUS_USERNAME / ASF_NEXUS_PASSWORD) are not yet provisioned as repo secrets -- an ASF committer with org.apache.solr Nexus deploy rights (Eric Pugh or Jan Høydahl) needs to add them. Until then the scheduled workflow run fails loudly by design. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Contributor
Author
|
@epugh @janhoy — nightly jar to the ASF Nexus snapshot repo, the Maven-dependency counterpart to #218's nightly Docker image. Flagging up front: this needs |
This was referenced Sep 18, 2026
Contributor
|
I question whether we at all need publishing nightly SNAPSHOT jars anywhere. Users can check out and build the project to obtain those if they don't want to run on an officially released version. Can we simply skip this and simplify things? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ASF_NEXUS_USERNAME/ASF_NEXUS_PASSWORDrepo secrets are not provisioned yet. Eric Pugh or Jan Høydahl (org.apache.solr Nexus deploy rights) need to add them. Until then, the scheduled workflow will fail loudly on every run by design — see "Open question" below.What / why
This adds a nightly jar publish, the Maven/Gradle-dependency counterpart to the nightly Docker image effort in #218 (not touched here).
Maven Central never accepts SNAPSHOT/nightly artifacts — that's a hard Sonatype/Central platform rule. The ASF-native destination for
org.apache.*groupIds (this project isorg.apache.solr) is the Apache Nexus snapshot repository athttps://repository.apache.org/content/repositories/snapshots.The project's
build.gradle.ktsalready appliesmaven-publishand defines amavenpublication (group = "org.apache.solr",version = "1.0.0-SNAPSHOT"), but had norepositories {}block — nothing was ever published anywhere but~/.m2viapublishToMavenLocal. This PR:build.gradle.kts: adds arepositories {}block underpublishing {}targeting the ASF Nexus snapshot repository. Credentials are read lazily viaproviders.environmentVariable("ASF_NEXUS_USERNAME"/"ASF_NEXUS_PASSWORD")—.orNullnever throws, so./gradlew build/test/publishToMavenLocal/etc. all keep working with zero env vars set for every contributor who doesn't have them. Only./gradlew publishitself fails, loudly and clearly (doFirstcheck), when credentials are missing — instead of an opaque HTTP 401 deep in the Maven-publish plugin..github/workflows/nightly-jar.yml: a new scheduled workflow (2 AM UTC, matching ci: publish nightly Docker image to apache/solr-mcp-nightly #218's Docker cron) +workflow_dispatch, guarded toif: github.repository == 'apache/solr-mcp'so forks don't run it. Secret presence is checked inside arun:step (shell[[ -n ... ]]), not inside anif:condition — an earlier nightly workflow attempt in this repo's history (PR ci: remove nightly-build.yml (startup failure from secrets-in-if; unwanted) #155 / issue Figure out Release process #15) referencedsecrets.*directly in anif:, which is illegal YAML and caused a permanent parse-time failure with zero jobs ever running. ci: publish nightly Docker image to apache/solr-mcp-nightly #218 already fixed this pattern for the Docker workflow; this PR follows the same fix for the jar workflow.dev-docs/NIGHTLY_JAR.md: new doc (mirrorsdev-docs/DOCKER_PUBLISHING.md's style) explaining the flow, how to publish locally, how consumers add the snapshot repository to their own Gradle/Maven build, and — most importantly — the credential gap below.Open question for Eric Pugh / Jan Høydahl
Not claiming certainty here: it's unconfirmed whether
org.apache.solris already pre-provisioned in ASF's Nexus for this specific sub-project (solr-mcp), the way it presumably is for the main Apache Solr project, or whether that itself needs requesting separately. Whoever provisions theASF_NEXUS_USERNAME/ASF_NEXUS_PASSWORDsecrets should confirm.Verification
./gradlew tasks --all—publish,publishToMavenLocal,publishAllPublicationsToAsfNexusSnapshotsRepository, andpublishMavenPublicationToAsfNexusSnapshotsRepositoryall resolve with no configuration errors../gradlew spotlessCheck— passes../gradlew build(full build, JDK 25, Testcontainers/Docker available) — BUILD SUCCESSFUL, all tests includingrat,spotlessCheck, and the Testcontainers-based integration tests pass.Test plan
ASF_NEXUS_USERNAME/ASF_NEXUS_PASSWORDas repo secretsorg.apache.solrgroupId is provisioned for deploy in ASF Nexus for this sub-projectnightly-jar.ymlviaworkflow_dispatchand confirm the artifact appears at https://repository.apache.org/content/repositories/snapshots🤖 Generated with Claude Code