Skip to content

Commit 42985fe

Browse files
committed
correct approach
1 parent d8645ea commit 42985fe

5 files changed

Lines changed: 119 additions & 298 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,25 @@ jobs:
3838
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3939
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
4040

41-
- name: Generate and Deploy Thin JAR
41+
- name: Deploy Thin JAR (Simple approach)
4242
run: |
43-
# Deploy thin JAR as a separate artifact to the same staging repository
44-
./release-thin-jar.sh
43+
# Get version from POM
44+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
45+
echo "Deploying thin JAR version: $VERSION"
46+
47+
# Update version in thin_public_pom.xml
48+
sed -i "s/<version>.*<\/version>/<version>$VERSION<\/version>/" thin_public_pom.xml
49+
50+
# Thin JAR already exists from main build - just deploy it with different POM
51+
mvn gpg:sign-and-deploy-file \
52+
-Dfile="target/databricks-jdbc-${VERSION}-thin.jar" \
53+
-DpomFile=thin_public_pom.xml \
54+
-DrepositoryId=central \
55+
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
56+
-DgroupId=com.databricks \
57+
-DartifactId=databricks-jdbc-thin \
58+
-Dversion="$VERSION" \
59+
-Dpackaging=jar
4560
env:
4661
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4762
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,39 @@ Add the following dependency to your `pom.xml`:
2424
</dependency>
2525
```
2626

27+
#### Thin JAR
28+
29+
For applications requiring explicit dependency management, use the thin JAR variant:
30+
31+
```xml
32+
<dependency>
33+
<groupId>com.databricks</groupId>
34+
<artifactId>databricks-jdbc-thin</artifactId>
35+
<version>1.0.9-oss</version>
36+
</dependency>
37+
```
38+
39+
The thin JAR contains only the driver code and declares all dependencies in its POM, enabling dependency introspection and version management.
40+
2741
### Build from Source
2842

2943
1. Clone the repository
3044
2. Run the following command:
3145
```bash
3246
mvn clean package
3347
```
34-
3. The jar file is generated as `target/databricks-jdbc-<version>.jar`
48+
3. The following JAR files are generated:
49+
- `target/databricks-jdbc-<version>.jar` (standard JAR with bundled dependencies)
50+
- `target/databricks-jdbc-<version>-thin.jar` (thin JAR without dependencies)
3551
4. The test coverage report is generated in `target/site/jacoco/index.html`
3652

53+
To install the thin JAR locally with dependency metadata:
54+
```bash
55+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
56+
sed -i "s/<version>.*<\/version>/<version>$VERSION<\/version>/" thin_public_pom.xml
57+
mvn install:install-file -Dfile="target/databricks-jdbc-${VERSION}-thin.jar" -DpomFile=thin_public_pom.xml
58+
```
59+
3760
## Usage
3861

3962
### Connection String

generate-thin-pom.sh

Lines changed: 0 additions & 149 deletions
This file was deleted.

release-thin-jar.sh

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)