Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roaringbitmap/mavenroaringbitmapproject
Using the RoaringBitmap library from a GitHub package (maven + gradle)
https://github.com/roaringbitmap/mavenroaringbitmapproject
Last synced: 4 days ago
JSON representation
Using the RoaringBitmap library from a GitHub package (maven + gradle)
- Host: GitHub
- URL: https://github.com/roaringbitmap/mavenroaringbitmapproject
- Owner: RoaringBitmap
- Created: 2024-10-24T00:28:07.000Z (20 days ago)
- Default Branch: master
- Last Pushed: 2024-10-24T01:00:11.000Z (20 days ago)
- Last Synced: 2024-10-24T15:29:15.623Z (19 days ago)
- Language: Java
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## MavenRoaringBitmapProject
This is a demonstration of how to use the RoaringBitmap library from a
GitHub package.- [Maven](#maven)
- [Gradle](#gradle)## Maven
Add the following dependency to your pom.xml file...
```xml
org.roaringbitmap
roaringbitmap
1.3.12
```You may adjust the version number.
Then add the repository to your pom.xml file:
```xml
github
Roaring Maven Packages
https://maven.pkg.github.com/RoaringBitmap/RoaringBitmap
true
true
```
See our pom.xml file as an example.
The registry access is is protected by an authorisation. So you have to add your GitHub credentials to your global settings.xml: `$HOME\.m2\settings.xml`.
You will need a token which you can generate on GitHub.
```
GitHub > Settings > Developer Settings > Personal access tokens > Generate new token
```The token needs the read:packages permission. The token identifier is a long string such as `ghp_ieO----------kN`.
Then put the following in your `settings.xml` file, within the `` element.
```xml
github
lemire
ghp_ieO----------kN```
Replace `lemire` by your GitHub username and `ghp_ieO----------kN` by the token identifier
you just generated.## Gradle
The approach with gradle is similar. You still need your GitHub credentials. Go
to```
GitHub > Settings > Developer Settings > Personal access tokens > Generate new token
```And create a token with read:packages permission.
If your GitHub user name is `lemire` and your GitHub personal token `ghp_ieOkN`,
then you can set them using system variables. Under bash, you can do it like so:
```
export GITHUB_USER=lemire
export GITHUB_PASSWORD=ghp_ieOkN
```If you prefer you can write your GitHub credentials in your gradle.properties
file```
# gradle.properties
githubUser=lemire
githubPassword=ghp_ieOkN
```Then all you need is the following `build.gradle` file:
```groovy
plugins {
id 'java'
}group 'org.roaringbitmap' // name of your project
version '1.0-SNAPSHOT' // version of your projectrepositories {
mavenCentral()
maven {
url 'https://maven.pkg.github.com/RoaringBitmap/RoaringBitmap'
credentials {
username = System.properties['githubUser'] ?: System.env.GITHUB_USER
password = System.properties['githubPassword'] ?: System.env.GITHUB_PASSWORD
}
}
}dependencies {
implementation 'org.roaringbitmap:roaringbitmap:1.3.12'
testImplementation 'junit:junit:3.8.1'
}
```