diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f849a3545..04ec04bb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,6 +47,26 @@ implementation("io.ably:ably-java:$ABLY_VERSION") { runtimeOnly("io.ably:network-client-okhttp:$ABLY_VERSION") ``` +### Publishing to local Maven repository for development and testing +To publish the library to your local Maven repository, you can use the following command: + + ./gradlew publishToMavenLocal + + +Alternatively, to publish only the specific (LiveObjects) module: + + ./gradlew :live-objects:publishToMavenLocal + + +- To use the locally published library in your project, you can add the following dependency in your `build.gradle` file: + +``` +repositories { + mavenLocal() +} +``` +- Note - Place `mavenLocal()` before `mavenCentral()` for resolution precedence. + ### How to Add a New Network Engine To add a new network engine, follow these steps: diff --git a/build.gradle.kts b/build.gradle.kts index 779cab77a..c741178c7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,7 +30,14 @@ subprojects { configure(subprojects) { pluginManager.withPlugin("com.vanniktech.maven.publish") { extensions.configure { - signAllPublications() + // Check if we're running a local publish task + val isLocalPublish = gradle.startParameter.taskNames.any { + it.contains("publishToMavenLocal") || it.contains("ToMavenLocal") + } + + if (!isLocalPublish) { + signAllPublications() + } } } } diff --git a/live-objects/build.gradle.kts b/live-objects/build.gradle.kts index ce6642496..e4219840d 100644 --- a/live-objects/build.gradle.kts +++ b/live-objects/build.gradle.kts @@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { `java-library` alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.maven.publish) } repositories {