Skip to content

Commit ca0fb3d

Browse files
authored
Add optional shaded JAR build via Maven "shade" profile (#273)
* Add shaded (uber) JAR build using Maven Shade Plugin * Fix typo * Bump up the version number to the latest version number * Move shaded JAR build to optional Maven profile "shade" * Update Maven shade plugin version and README
1 parent da21e02 commit ca0fb3d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ This library is licensed under the Apache 2.0 License.
1616

1717
## Building from Source
1818

19-
After you've downloaded the code from GitHub, you can build it using Maven. To disable GPG signing in the build, use this command: `mvn clean install -Dgpg.skip=true`
19+
After you've downloaded the code from GitHub, you can build it using Maven.
20+
* To disable GPG signing in the build, use this command: `mvn clean install -Dgpg.skip=true`
21+
* To build the default (non-shaded) JAR, use this command: `mvn clean install`
22+
* To build the shaded (uber) JAR with all dependencies included, use this command: `mvn clean install -Pshade`
23+
The shaded JAR will be generated in the `target/` directory with the `-shaded` classifier, e.g.: `target/aws-secretsmanager-jdbc-2.0.2-shaded.jar`
2024

2125
## Usage
2226
The recommended way to use the SQL Connection Library is to consume it from Maven. The latest released version can be found at: https://mvnrepository.com/artifact/com.amazonaws.secretsmanager/aws-secretsmanager-jdbc

pom.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,37 @@
261261
</plugins>
262262
</build>
263263
</profile>
264+
<profile>
265+
<id>shade</id>
266+
<build>
267+
<plugins>
268+
<plugin>
269+
<groupId>org.apache.maven.plugins</groupId>
270+
<artifactId>maven-shade-plugin</artifactId>
271+
<version>3.6.0</version>
272+
<executions>
273+
<execution>
274+
<id>shade</id>
275+
<phase>package</phase>
276+
<goals>
277+
<goal>shade</goal>
278+
</goals>
279+
<configuration>
280+
<shadedArtifactAttached>true</shadedArtifactAttached>
281+
<shadedClassifierName>shaded</shadedClassifierName>
282+
<createDependencyReducedPom>false</createDependencyReducedPom>
283+
<transformers>
284+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
285+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
286+
<mainClass>com.amazonaws.secretsmanager.sql.AWSSecretsManagerDriver</mainClass>
287+
</transformer>
288+
</transformers>
289+
</configuration>
290+
</execution>
291+
</executions>
292+
</plugin>
293+
</plugins>
294+
</build>
295+
</profile>
264296
</profiles>
265297
</project>

0 commit comments

Comments
 (0)