This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-mcp.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e628fb  build: add maven-publish plugin for local artifact publishing 
(#32)
4e628fb is described below

commit 4e628fba895594fbc05168c542fcc7bcfe36532b
Author: Aditya Parikh <[email protected]>
AuthorDate: Tue Jan 6 18:54:03 2026 -0400

    build: add maven-publish plugin for local artifact publishing (#32)
    
    Enable publishing of project artifacts to Maven repositories with
    sources and javadoc JARs.
    
    Changes:
    - Add maven-publish plugin to build.gradle.kts
    - Configure publishing block with detailed comments
    - Add withSourcesJar() and withJavadocJar() for artifact generation
    - Update CONTRIBUTING.md with publishToMavenLocal instructions
    
    Usage:
      ./gradlew publishToMavenLocal
    
    This publishes to ~/.m2/repository/org/apache/solr/solr-mcp/{version}/:
    - solr-mcp-{version}.jar (main artifact)
    - solr-mcp-{version}-sources.jar (source code)
    - solr-mcp-{version}-javadoc.jar (API documentation)
    - solr-mcp-{version}.pom (Maven POM)
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Claude Opus 4.5 <[email protected]>
---
 CONTRIBUTING.md  | 20 ++++++++++++++++++++
 build.gradle.kts | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3fbb590..4c957e0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -38,6 +38,26 @@ To keep this document concise, please see the Development 
Guide for all testing
 - Docker image tests: dev-docs/DEVELOPMENT.md#docker-integration-tests
 - Coverage reports: dev-docs/DEVELOPMENT.md#testing
 
+## Publishing to Maven Local
+
+To install the project artifacts to your local Maven repository for testing or 
local development:
+
+```bash
+./gradlew publishToMavenLocal
+```
+
+This publishes the following artifacts to 
`~/.m2/repository/org/apache/solr/solr-mcp/{version}/`:
+
+- `solr-mcp-{version}.jar` - Main application JAR
+- `solr-mcp-{version}-sources.jar` - Source code for IDE navigation
+- `solr-mcp-{version}-javadoc.jar` - API documentation
+- `solr-mcp-{version}.pom` - Maven POM with dependencies
+
+This is useful when:
+- Testing the library locally before publishing to a remote repository
+- Sharing artifacts between local projects during development
+- Verifying the published POM and artifact structure
+
 ## Submitting Changes
 
 ### Pull Request Process
diff --git a/build.gradle.kts b/build.gradle.kts
index f51a7c1..eec916a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ import net.ltgt.gradle.errorprone.errorprone
 
 plugins {
     java
+    `maven-publish`
     alias(libs.plugins.spring.boot)
     alias(libs.plugins.spring.dependency.management)
     jacoco
@@ -34,6 +35,48 @@ java {
     toolchain {
         languageVersion = JavaLanguageVersion.of(25)
     }
+    withSourcesJar()
+    withJavadocJar()
+}
+
+// Maven Publishing Configuration
+// ==============================
+// This configuration enables publishing the project artifacts to Maven 
repositories.
+// The publishing block defines what artifacts are published and where they go.
+//
+// Artifacts Published:
+// -------------------
+// - Main JAR: The compiled application JAR
+// - Sources JAR: Source code for IDE navigation and debugging
+// - Javadoc JAR: Generated API documentation
+//
+// Publishing to Maven Local:
+// -------------------------
+// To install artifacts to your local Maven repository (~/.m2/repository):
+//   ./gradlew publishToMavenLocal
+//
+// This is useful for:
+// - Testing the library locally before publishing to a remote repository
+// - Sharing artifacts between local projects during development
+// - Verifying the published POM and artifact structure
+//
+// After publishing, artifacts will be available at:
+//   ~/.m2/repository/org/apache/solr/solr-mcp/{version}/
+//
+// The publication includes:
+// - solr-mcp-{version}.jar (main artifact)
+// - solr-mcp-{version}-sources.jar (source code)
+// - solr-mcp-{version}-javadoc.jar (API documentation)
+// - solr-mcp-{version}.pom (Maven POM with dependencies)
+publishing {
+    publications {
+        create<MavenPublication>("maven") {
+            // Include the main JAR and all artifacts from the java component
+            // This automatically includes sources and javadoc JARs when
+            // withSourcesJar() and withJavadocJar() are configured above
+            from(components["java"])
+        }
+    }
 }
 
 configurations {

Reply via email to