Skip to content

Commit 631a5dc

Browse files
authored
Merge pull request #1143 from ably/fix/local-maven-publish
[ECO-5383][LiveObjects] Enable maven publish
2 parents 8ec259d + c75fb05 commit 631a5dc

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ implementation("io.ably:ably-java:$ABLY_VERSION") {
4747
runtimeOnly("io.ably:network-client-okhttp:$ABLY_VERSION")
4848
```
4949

50+
### Publishing to local Maven repository for development and testing
51+
To publish the library to your local Maven repository, you can use the following command:
52+
53+
./gradlew publishToMavenLocal
54+
55+
56+
Alternatively, to publish only the specific (LiveObjects) module:
57+
58+
./gradlew :live-objects:publishToMavenLocal
59+
60+
61+
- To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
62+
63+
```
64+
repositories {
65+
mavenLocal()
66+
}
67+
```
68+
- Note - Place `mavenLocal()` before `mavenCentral()` for resolution precedence.
69+
5070
### How to Add a New Network Engine
5171

5272
To add a new network engine, follow these steps:

build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ subprojects {
3030
configure(subprojects) {
3131
pluginManager.withPlugin("com.vanniktech.maven.publish") {
3232
extensions.configure<MavenPublishBaseExtension> {
33-
signAllPublications()
33+
// Check if we're running a local publish task
34+
val isLocalPublish = gradle.startParameter.taskNames.any {
35+
it.contains("publishToMavenLocal") || it.contains("ToMavenLocal")
36+
}
37+
38+
if (!isLocalPublish) {
39+
signAllPublications()
40+
}
3441
}
3542
}
3643
}

live-objects/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
plugins {
44
`java-library`
55
alias(libs.plugins.kotlin.jvm)
6+
alias(libs.plugins.maven.publish)
67
}
78

89
repositories {

0 commit comments

Comments
 (0)