Skip to content

Commit

Permalink
Update GitHub package manager usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Jun 11, 2021
1 parent 3bef3fd commit 99e191d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ The `docs/design` folder contains records of the major decisions in the design o

### Installing the library

While it's a work in progress, snapshots of this library are published on a Maven repository hosted on [GitHub Packages](https://github.com/elastic/elasticsearch-java/packages/).
While it's a work in progress, snapshots of this library are published to a Maven repository hosted on [GitHub Packages](https://github.com/elastic/elasticsearch-java/packages/). To access it [you need a personal access token](https://github.com/settings/tokens) on your GitHub account that has the `read:packages` permission. This token should then be added to `~/.gradle/gradle.properties`:

```properties
ESJavaGithubPackagesUsername=YOUR_GITHUB_USERNAME
ESJavaGithubPackagesPassword=YOUR_GITHUB_TOKEN
```

Along with this library, you also need a JSON/object mapping library. `elasticsearch-java` has built-in support for [Jackson](https://github.com/FasterXML/jackson) and [JSON-B](http://json-b.net/) implementations such as [Eclipse Yasson](https://github.com/eclipse-ee4j/yasson).

Expand All @@ -34,8 +39,9 @@ Gradle project (Groovy flavor) setup using Jackson:
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
name = "ESJavaGithubPackages"
url = uri("https://maven.pkg.github.com/elastic/elasticsearch-java")
credentials(PasswordCredentials)
}
}
Expand Down
7 changes: 2 additions & 5 deletions java-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ publishing {
repositories {
maven {
// See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry
name = "GitHubPackages"
name = "ESJavaGithubPackages"
url = uri("https://maven.pkg.github.com/elastic/elasticsearch-java")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
credentials(PasswordCredentials::class)
}

maven {
Expand Down

0 comments on commit 99e191d

Please sign in to comment.