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

feat: support creating shaded jars #333

Merged
merged 1 commit into from Jan 31, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions .readme-partials.yaml
Expand Up @@ -23,3 +23,14 @@ custom_content: |
}
}
```

### Creating a Shaded Jar

A jar with all dependencies included is automatically generated when you execute `mvn package`.
The dependencies in this jar are not shaded. To create a jar with shaded dependencies you must
activate the `shade` profile like this:

```
mvn package -Pshade
```

44 changes: 44 additions & 0 deletions pom.xml
Expand Up @@ -309,6 +309,50 @@
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>shade</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<relocations>
<relocation>
<pattern>com</pattern>
<shadedPattern>com.google.cloud.spanner.jdbc.shaded.com</shadedPattern>
<excludes>
<exclude>com.google.cloud.spanner.**</exclude>
</excludes>
</relocation>
<relocation>
<pattern>android</pattern>
<shadedPattern>com.google.cloud.spanner.jdbc.shaded.android</shadedPattern>
</relocation>
<relocation>
<pattern>io</pattern>
<shadedPattern>com.google.cloud.spanner.jdbc.shaded.io</shadedPattern>
<excludes>
<exclude>io.grpc.netty.shaded.**</exclude>
</excludes>
</relocation>
<relocation>
<pattern>org</pattern>
<shadedPattern>com.google.cloud.spanner.jdbc.shaded.org</shadedPattern>
<excludes>
<exclude>org.conscrypt.**</exclude>
</excludes>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<reporting>
<plugins>
<plugin>
Expand Down