Skip to content

Commit

Permalink
Removed gh mvn repo docs
Browse files Browse the repository at this point in the history
  • Loading branch information
santanusinha committed Aug 23, 2024
1 parent 3949407 commit 296814d
Showing 1 changed file with 1 addition and 79 deletions.
80 changes: 1 addition & 79 deletions docs/docs/extra/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@
Drove is written in Java. We provide a few libraries that can be used to integrate with a Drove cluster.

## Setup
Drove libraries are hosted in Github Package Repository. To use this in Maven use the following repository entry:

```xml
<repositories>
<!-- Setup other repositories-->
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/phonepe/drove</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
```

Setup the drove version
```xml
Expand All @@ -30,68 +13,7 @@ Setup the drove version
```

!!!note "Checking the latest version"
Latest version can be checked at the github packages page [here](https://github.com/PhonePe/drove/packages/2229703){:target="_blank"}

!!!danger "Accessing maven repo on github"
Public repos on github need authentication. In order to use these please follow the steps as mentioned below:

- Create a Personal Access Token on github.
- Go to your account -> Settings -> Developer settings -> Personal access token -> Tokens (classic) -> Generate new token (classic)
(Basically create a PAT and add your username and password in maven-settings.xml or .m2/settings.xml for the repo `https://maven.pkg.github.com/phonepe/drove`).
- The only permission needed is `read:packages`.

- Create a settings file or add required configurations to your `~/.m2/settings.xml`.

Sample settings file:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/phonepe/drove</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>YOUR GITHUB USERNAME</username>
<password>YOUR PERSONAL ACCESS TOKEN</password>
</server>
</servers>

</settings>

```
> Your PAT works fine as the repo itself is public.

To build:
```shell
mvn -s /path/to/settings.xml clean package
```

If setting up your github actions, please follow the steps in this excellent [stack-overflow answer](https://stackoverflow.com/questions/64706720/how-to-access-maven-dependency-from-github-packages-on-a-github-actions-workflow){:target="_blank"} to setup your actions correctly.
Latest version can be checked at the github packages page [here](https://central.sonatype.com/search?q=com.phonepe.drove){:target="_blank"}


All libraries are located in sub packages of the top level package `com.phonepe.drove`.
Expand Down

0 comments on commit 296814d

Please sign in to comment.