Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup for publishing to Sonatype's Central Portal #3

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ build

# IntelliJ
.idea/

# Vim
*.swp
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# wherobots-jdbc-driver
JDBC Driver Implementation for the Wherobots Spatial SQL API
# Wherobots Spatial SQL JDBC Driver

This library provides a JDBC driver implementation for the Wherobots
Spatial SQL API. It allows you to build Java/Scala/Kotlin applications
that can interact with Wherobots and leverage the Spatial SQL and
geospatial analytics capabilities of WherobotsDB.

This JDBC driver is also directly usable from database applications like
JetBrains's DataGrip or DBeaver.

## Usage

### As a library

```gradle
dependencies {
implementation 'com.wherobots.jdbc:wherobots-jdbc-driver:0.1.0'
}
```

### In DataGrip

TODO: add instructions for configuring a database connection with the
Wherobots JDBC driver.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this hard to set up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too much, but there are a few settings to get right given the limitations of our JDBC Driver implementation.


## Release

To publish a new release, you need an account on [Sonatype's Central
Portal](https://central.sonatype.com) with permissions to publish into
the `com.wherobots` namespace. From your account, create an API key,
which gets you a user token and secret key pair:

```sh
export OSSRH_USERNAME=<user token>
export OSSRH_PASSWORD=<secret key>
```

You also need a GnuPG key, loaded up in `gpg-agent`, for signing the
release artifacts.

Then, after setting the new version in `lib/build.gradle`, publish with:

```sh
$ ./gradlew clean publishToCentralPortal
```

You can then check the status and validation of thsi deployment at
https://central.sonatype.com/publishing/deployments
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

org.gradle.parallel=true
org.gradle.caching=true

38 changes: 35 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,43 @@
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java-library'
id 'net.thebugmc.gradle.sonatype-central-portal-publisher' version '1.2.4'
id 'signing'
}

description = 'JDBC driver for the Wherobots Cloud Spatial SQL API'
group = 'com.wherobots.jdbc'
version = '0.1.0'

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

centralPortal {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')

pom {
url = 'https://www.wherobots.com'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Wherobots Inc.'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/wherobots/wherobots-jdbc-driver'
url = 'https://github.com/wherobots/wherobots-jdbc-driver'
}
}
}

dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.apache.httpcomponents.core5:httpcore5:5.2.4'
Expand All @@ -42,12 +70,16 @@ java {
}

tasks.named('jar') {
archiveBaseName.set('wherobots-jdbc-driver')
manifest {
attributes('Implementation-Title': project.name,
attributes('Implementation-Title': rootProject.name,
'Implementation-Version': project.version)
}
}

tasks.withType(Jar) {
archiveBaseName.set('wherobots-jdbc')
}

signing {
useGpgCmd()
}
Loading