Skip to content

Commit

Permalink
Made the shaded jar explicit
Browse files Browse the repository at this point in the history
Annoyingly you can't shade the default artifact if it has a classifier.
(https://stackoverflow.com/a/47775031)

Changed the *thin* to just be the default artifact classifier &
*shaded* to be ... the shaded artifact.

Augmented the README also as per Julian's suggestion.
  • Loading branch information
fzakaria committed Oct 12, 2020
1 parent b0b4efb commit d292112
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,38 @@

![Maven Central](https://img.shields.io/maven-central/v/com.github.jonathanswenson/bqjdbc)

A fat (shaded) jar is provided at the following coordinates:
This is a [JDBC Driver](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) for [BigQuery](https://cloud.google.com/bigquery)
forked from https://code.google.com/p/starschema-bigquery-jdbc/

You can create a JDBC connection easily for a variety of authentication types.
For instance for a _service account_ in a properties file:

```ini
projectid=disco-parsec-659
type=service
user[email protected]
password=bigquery_credentials.p12
```

```java
import net.starschema.clouddb.jdbc.*;
import java.sql.*;

public static class Example {
public static void main(String[] args) {
// load the class so that it registers itself
Class.forName("net.starschema.clouddb.jdbc.BQDriver");
final String jdbcUrl = BQSupportFuncts.constructUrlFromPropertiesFile(
BQSupportFuncts.readFromPropFile(
getClass().getResource("/serviceaccount.properties").getFile()
));
final Connection con = DriverManager.getConnection(jdbcUrl);
// perform SQL against BigQuery now!
}
}
```

The dependency is provided at the following coordinates:
```xml
<dependency>
<groupId>com.github.jonathanswenson</groupId>
Expand All @@ -11,18 +42,19 @@ A fat (shaded) jar is provided at the following coordinates:
</dependency>
```

If you would like a thin jar you can use _thin_ classifier.

A fat (shaded) jar is provided at the following coordinates.
```xml
<dependency>
<groupId>com.github.jonathanswenson</groupId>
<artifactId>bqjdbc</artifactId>
<version>...</version>
<classifier>thin</classifier>
<classifier>shaded</classifier>
</dependency>
```

## Releases
## Development

### Releases

Releases are handled through GitHub actions, and kicked off when a release is created.

Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
to a groupId that we have ownership over -->
<groupId>com.github.jonathanswenson</groupId>
<artifactId>bqjdbc</artifactId>
<version>2.2.12-SNAPSHOT</version>
<version>2.2.13</version>
<name>Big Query over JDBC</name>
<description>A simple JDBC driver, to reach Google's BigQuery</description>
<properties>
Expand Down Expand Up @@ -191,7 +191,7 @@
</execution>
</executions>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -247,6 +247,5 @@
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}-${project.version}-thin</finalName>
</build>
</project>

0 comments on commit d292112

Please sign in to comment.