Skip to content

Commit 3cdd323

Browse files
authored
http-client-benchmark with Apache SDK client added (#6256)
* Add initial empty module for Apache5x for seting up package (#6075) * Add initial module for Apache5x for seting up package * Add based on new module checklist * Baseline or Copy all the ApacheSDKHttpClient classes to newly added Apache5SDKHttpClient (#6088) * Add initial module for Apache5x for seting up package * Add based on new module checklist * Baseline all the classes from Apache4 SDK client to the new Apache5 module * Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues (#6100) * Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues * Handle comments from review * Handle comments from Zoe * Update the snap shot * Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability (#6132) * Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability * Upated test cases * Handled comments * Updated snap shot after merge from master * Revert "Updated snap shot after merge from master" This reverts commit 64f7d33. * Updated snap shot after merge from master * Fix architecture test failures for apache5.x (#6140) * Fix architecture test failures for apache5.x * Checkstyle issues * Updated snap shot after merge from master * Use reference of PoolingHttpClientConnectionManager instead of HttpClientConnectionManager for Connection Manager (#6147) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix Apache5 HTTP client retry failures with non-resettable streams (#6154) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Merge PR#6165 #6165 * Disable Client based retries and define httpcore5 httpclient5 in .brazil.json (#6191) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Fix connectionPoolingWorks by setting skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x * disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json * Added Test case for Async , handled review ocmments * Update snapshots * Do not buffer the Response stream using BufferedHttpEntity (#6200) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Fix connectionPoolingWorks by setting skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x * disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json * Added Test case for Async , handled review ocmments * Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x * Fix compilation issues * Fix checkstyle issues * Remove test which are specific to apache http * Merge from master * Apache5x SDkBenhmark Tests (#6206) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Fix connectionPoolingWorks by setting skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x * disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json * Added Test case for Async , handled review ocmments * Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x * Fix compilation issues * Fix checkstyle issues * Remove test which are specific to apache http * Add benchmark for Apache5 and add Streaming Api test cases * Clean up unused APIs and add test to make sure it can be handled with alternatives (#6211) * Clean up unused APIs and add test to make sure it can be handled with alternatives * Added NTCredentials to keep backward compatibilty with Apache4.x * Upgrade Apache5 org.apache.httpcomponents.client5 to latest available version (#6214) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Fix connectionPoolingWorks by setting skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x * disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json * Added Test case for Async , handled review ocmments * Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x * Fix compilation issues * Fix checkstyle issues * Remove test which are specific to apache http * Add benchmark for Apache5 and add Streaming Api test cases * Update Apache5 to 5.5 * Preview API annotation added for Public APIs and TODOs addressed (#6215) * Fix architecture test failures for apache5.x * Checkstyle issues * Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager * Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams * writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this * Fix connectionPoolingWorks by setting skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x * disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json * Added Test case for Async , handled review ocmments * Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x * Fix compilation issues * Fix checkstyle issues * Remove test which are specific to apache http * Add benchmark for Apache5 and add Streaming Api test cases * Update Apache5 to 5.5 * Preview ready , addressing open TODOs * Added PublicApi since checkstyle was failing * Updated the snapshot * Updated thr Brazil package nma e to have preview as suffix * Updated Version as -PREVIEW to release apache5 as preview release (#6219) * Updated Version as -PREVIEW * japi cmp needs to be disables since this is a new version and we dont have old version to compare * Handled Surface API review comments * Added a single test for localaddress , handled review comments * Removing internal package name as -preview after internal discussion * Fix transient text case failures * Handled Surface API review comments (#6224) * Handled Surface API review comments * Added a single test for localaddress , handled review comments * Removing internal package name as -preview after internal discussion * Fix transient text case failures * update pom.xml for apache5.x * Handled comment for merge to master PR for apache 5.x * Handled commed for merge to master PR 6220 (#6240) * Handled Surface API review comments * Added a single test for localaddress , handled review comments * Removing internal package name as -preview after internal discussion * Fix transient text case failures * Handled comment for merge to master PR for apache 5.x * Added change logs * Add Http client bench marks with S3 Get/Put * Removed some dependencies * updated performance comparison logic * updated readme * updated warmup time and iterations * remove performance comparison since we already have printed performamnce and one sent to cw * Review from github * Review comment * updatded prints * Handled Review comments * Added performance comparison for Apache * updated README * remove preview buid * added changed to skpi http client benchmark * updated the snapshot version * updated to run on jdk8 * merge from master * updated README.md * fixed checkbuild issues * fixed checksyle issues * fixed issue where secondary benchmarks were not found * Revert "fixed issue where secondary benchmarks were not found" This reverts commit b536571. * Revert "fixed checksyle issues" This reverts commit 99e697e. * Fixed checkstyle issues * Handled review comments * Updated snapshot * Add skipping of http-client-benchmarks in validate-brazil-config.yml * updated snapshot
1 parent cea37da commit 3cdd323

18 files changed

+1694
-4
lines changed

.brazil.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"region-testing": { "skipImport": true },
100100
"release-scripts": { "skipImport": true },
101101
"s3-benchmarks": { "skipImport": true },
102+
"http-client-benchmarks": { "skipImport": true },
102103
"sdk-benchmarks": { "skipImport": true },
103104
"sdk-native-image-test": { "skipImport": true },
104105
"service-test-utils": { "skipImport": true },

buildspecs/release-javadoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ phases:
1313
pre_build:
1414
commands:
1515
- DOC_PATH='s3://aws-java-sdk-javadoc/java/api'
16-
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,s3-benchmarks,module-path-tests,test-utils,http-client-tests,tests-coverage-reporting,sdk-native-image-test,ruleset-testing-core,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration,v2-migration-tests,architecture-tests,s3-tests"
16+
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,s3-benchmarks,http-client-benchmarks,module-path-tests,test-utils,http-client-tests,tests-coverage-reporting,sdk-native-image-test,ruleset-testing-core,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration,v2-migration-tests,architecture-tests,s3-tests"
1717

1818
build:
1919
commands:

buildspecs/release-to-maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ phases:
1616
- SDK_SIGNING_GPG_PASSPHRASE_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-passphrase-A0H1Kq"
1717
- SONATYPE_PASSWORD_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sonatype-password-I2V6Y0"
1818
- SONATYPE_USERNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sonatype-username-HphNZQ"
19-
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests"
19+
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,http-client-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests"
2020

2121
build:
2222
commands:

buildspecs/validate-brazil-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ phases:
99
build:
1010
commands:
1111
- mvn clean install -P quick -T0.4C
12-
- mvn exec:exec -Dexec.executable=pwd -pl !:aws-sdk-java-pom,!:sdk-benchmarks,!:module-path-tests -q 2>&1 > modules.txt
12+
- mvn exec:exec -Dexec.executable=pwd -pl !:aws-sdk-java-pom,!:sdk-benchmarks,!:http-client-benchmarks,!:module-path-tests -q 2>&1 > modules.txt
1313
- mvn dependency:list -DexcludeTransitive=true -DincludeScope=runtime 2>&1 > deps.txt
1414
- scripts/validate-brazil-config modules.txt deps.txt

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<module>test/test-utils</module>
8080
<module>test/codegen-generated-classes-test</module>
8181
<module>test/sdk-benchmarks</module>
82+
<module>test/http-client-benchmarks</module>
8283
<module>test/module-path-tests</module>
8384
<module>test/tests-coverage-reporting</module>
8485
<module>test/stability-tests</module>

scripts/validate-brazil-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import re
1212
# Usage: validate-brazil-config [module-paths-file] [dependencies-file]
1313

1414
# Generating module-paths-file:
15-
# mvn exec:exec -Dexec.executable=pwd -pl \!:aws-sdk-java-pom,\!:sdk-benchmarks,\!:module-path-tests -q 2>&1 > modules.txt
15+
# mvn exec:exec -Dexec.executable=pwd -pl \!:aws-sdk-java-pom,\!:sdk-benchmarks,\!:http-client-benchmarks,\!:module-path-tests -q 2>&1 > modules.txt
1616
#
1717
# Generates contents similar to:
1818
# /workspace/aws-sdk-java-v2/build-tools

test/http-client-benchmarks/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# HTTP Client Benchmark Harness
2+
3+
This module contains HTTP client benchmark harness using [JMH].
4+
5+
Each benchmark class has a set of default
6+
JMH configurations tailored to HTTP client performance testing and you might need to
7+
adjust them based on your test environment such as increasing warmup iterations
8+
or measurement time in order to get more reliable data.
9+
10+
There are three ways to run benchmarks.
11+
12+
- Using the executable JAR (Preferred usage per JMH site)
13+
```
14+
mvn clean install -P quick -pl :http-client-benchmarks --am
15+
```
16+
17+
# Run specific benchmark
18+
```
19+
java -jar target/http-client-benchmarks.jar Apache5Benchmark
20+
```
21+
22+
# Run all benchmarks: 3 warm up iterations, 3 benchmark iterations, 1 fork.
23+
```
24+
java -jar target/http-client-benchmarks.jar -wi 3 -i 3 -f 1
25+
```
26+
27+
- Using `mvn exec:exec` commands to invoke `UnifiedBenchmarkRunner` main method
28+
```
29+
mvn clean install -P quick -pl :http-client-benchmarks --am
30+
mvn clean install -pl :bom-internal
31+
cd test/http-client-benchmarks
32+
mvn exec:exec
33+
```
34+
35+
## UnifiedBenchmarkRunner
36+
37+
The `UnifiedBenchmarkRunner` provides a comprehensive comparison between different HTTP client implementations:
38+
39+
- **Apache4**: Apache HttpClient 4.x baseline
40+
- **Apache5-Platform**: Apache HttpClient 5.x with platform threads
41+
- **Apache5-Virtual**: Apache HttpClient 5.x with virtual threads
42+
43+
The runner executes all benchmark variations, prints metrics to console, and publishes results to CloudWatch metrics for monitoring and analysis.
44+
45+
## Benchmark Operations
46+
47+
Each benchmark implementation tests the following operations:
48+
- `simpleGet`: Single-threaded GET operations
49+
- `simplePut`: Single-threaded PUT operations
50+
- `multiThreadedGet`: Multi-threaded GET operations (10 threads)
51+
- `multiThreadedPut`: Multi-threaded PUT operations (10 threads)
52+
53+
## Prerequisites
54+
55+
### Java Runtime Requirements
56+
57+
- **Java 8+**: Required for running the benchmarks (as specified by `<javac.target>8</javac.target>`)
58+
- **Java 21+**: Required for virtual threads support (Apache5-Virtual benchmarks)
59+
60+
**Note**: Virtual threads are a preview feature in Java 19-20 and became stable in Java 21. The Apache5-Virtual benchmarks require Java 21 or later.
61+

test/http-client-benchmarks/pom.xml

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
<!--
2+
~ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License").
5+
~ You may not use this file except in compliance with the License.
6+
~ A copy of the License is located at
7+
~
8+
~ http://aws.amazon.com/apache2.0
9+
~
10+
~ or in the "license" file accompanying this file. This file is distributed
11+
~ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
~ express or implied. See the License for the specific language governing
13+
~ permissions and limitations under the License.
14+
-->
15+
16+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<parent>
20+
<groupId>software.amazon.awssdk</groupId>
21+
<artifactId>aws-sdk-java-pom</artifactId>
22+
<version>2.32.6-SNAPSHOT</version>
23+
<relativePath>../../pom.xml</relativePath>
24+
</parent>
25+
26+
<artifactId>http-client-benchmarks</artifactId>
27+
<packaging>jar</packaging>
28+
29+
<name>AWS Java SDK :: Test :: HTTP CLIENT Benchmarks</name>
30+
<description>Contains JMH benchmark code for the SDK HTTP CLIENTS</description>
31+
32+
<properties>
33+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34+
<jmh.version>1.37</jmh.version>
35+
<javac.target>1.8</javac.target>
36+
<uberjar.name>http-client-benchmarks</uberjar.name>
37+
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
38+
</properties>
39+
40+
41+
<dependencies>
42+
<dependency>
43+
<groupId>org.openjdk.jmh</groupId>
44+
<artifactId>jmh-core</artifactId>
45+
<version>${jmh.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.openjdk.jmh</groupId>
49+
<artifactId>jmh-generator-annprocess</artifactId>
50+
<version>${jmh.version}</version>
51+
<scope>provided</scope>
52+
</dependency>
53+
54+
<!-- AWS SDK Dependencies -->
55+
<dependency>
56+
<groupId>software.amazon.awssdk</groupId>
57+
<artifactId>s3</artifactId>
58+
<version>${awsjavasdk.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>software.amazon.awssdk</groupId>
62+
<artifactId>cloudwatch</artifactId>
63+
<version>${awsjavasdk.version}</version>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>software.amazon.awssdk</groupId>
68+
<artifactId>apache-client</artifactId>
69+
<version>${awsjavasdk.version}</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>software.amazon.awssdk</groupId>
73+
<artifactId>apache5-client</artifactId>
74+
<version>${awsjavasdk.version}-PREVIEW</version>
75+
</dependency>
76+
77+
<dependency>
78+
<groupId>org.apache.logging.log4j</groupId>
79+
<artifactId>log4j-api</artifactId>
80+
<scope>compile</scope>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.apache.logging.log4j</groupId>
84+
<artifactId>log4j-core</artifactId>
85+
<scope>compile</scope>
86+
</dependency>
87+
<dependency>
88+
<groupId>org.apache.logging.log4j</groupId>
89+
<artifactId>log4j-slf4j-impl</artifactId>
90+
<scope>compile</scope>
91+
</dependency>
92+
</dependencies>
93+
94+
<dependencyManagement>
95+
<dependencies>
96+
<dependency>
97+
<groupId>software.amazon.awssdk</groupId>
98+
<artifactId>bom-internal</artifactId>
99+
<version>${awsjavasdk.version}</version>
100+
<type>pom</type>
101+
<scope>import</scope>
102+
</dependency>
103+
</dependencies>
104+
</dependencyManagement>
105+
106+
<build>
107+
<resources>
108+
<resource>
109+
<directory>src/main/resources</directory>
110+
</resource>
111+
</resources>
112+
<pluginManagement>
113+
<plugins>
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-compiler-plugin</artifactId>
117+
<version>3.1</version>
118+
<!-- Override the configuration in the parent-->
119+
<configuration combine.self="override">
120+
<compilerVersion>${javac.target}</compilerVersion>
121+
<source>${javac.target}</source>
122+
<target>${javac.target}</target>
123+
</configuration>
124+
<executions>
125+
<execution>
126+
<id>compile</id>
127+
<phase>none</phase>
128+
</execution>
129+
</executions>
130+
<inherited>false</inherited>
131+
</plugin>
132+
<plugin>
133+
<artifactId>maven-clean-plugin</artifactId>
134+
<version>3.1.0</version>
135+
</plugin>
136+
<plugin>
137+
<artifactId>maven-deploy-plugin</artifactId>
138+
<version>2.8.1</version>
139+
</plugin>
140+
<plugin>
141+
<artifactId>maven-install-plugin</artifactId>
142+
<version>2.5.1</version>
143+
</plugin>
144+
<plugin>
145+
<artifactId>maven-jar-plugin</artifactId>
146+
<version>2.4</version>
147+
</plugin>
148+
<plugin>
149+
<artifactId>maven-javadoc-plugin</artifactId>
150+
<version>2.9.1</version>
151+
</plugin>
152+
<plugin>
153+
<artifactId>maven-resources-plugin</artifactId>
154+
<version>2.6</version>
155+
</plugin>
156+
<plugin>
157+
<artifactId>maven-site-plugin</artifactId>
158+
<version>3.3</version>
159+
</plugin>
160+
<plugin>
161+
<artifactId>maven-source-plugin</artifactId>
162+
<version>2.2.1</version>
163+
</plugin>
164+
<plugin>
165+
<artifactId>maven-surefire-plugin</artifactId>
166+
<version>2.17</version>
167+
</plugin>
168+
</plugins>
169+
</pluginManagement>
170+
<plugins>
171+
<plugin>
172+
<groupId>org.apache.maven.plugins</groupId>
173+
<artifactId>maven-compiler-plugin</artifactId>
174+
</plugin>
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-shade-plugin</artifactId>
178+
<version>2.2</version>
179+
<executions>
180+
<execution>
181+
<phase>package</phase>
182+
<goals>
183+
<goal>shade</goal>
184+
</goals>
185+
<configuration>
186+
<finalName>${uberjar.name}</finalName>
187+
<createDependencyReducedPom>false</createDependencyReducedPom>
188+
<artifactSet>
189+
<includes>
190+
<include>*:*</include>
191+
</includes>
192+
</artifactSet>
193+
<transformers>
194+
<transformer
195+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
196+
<manifestEntries>
197+
<Main-Class>org.openjdk.jmh.Main</Main-Class>
198+
</manifestEntries>
199+
</transformer>
200+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
201+
</transformers>
202+
<filters>
203+
<filter>
204+
<!--
205+
Shading signed JARs will fail without this.
206+
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
207+
-->
208+
<artifact>*:*</artifact>
209+
<excludes>
210+
<exclude>META-INF/*.SF</exclude>
211+
<exclude>META-INF/*.DSA</exclude>
212+
<exclude>META-INF/*.RSA</exclude>
213+
</excludes>
214+
</filter>
215+
</filters>
216+
</configuration>
217+
</execution>
218+
</executions>
219+
</plugin>
220+
<plugin>
221+
<groupId>org.codehaus.mojo</groupId>
222+
<!-- Need to use exec not java see:http://mail.openjdk.java.net/pipermail/jmh-dev/2014-July/001192.html, https://stackoverflow.com/questions/15013651/using-maven-execexec-with-arguments -->
223+
<artifactId>exec-maven-plugin</artifactId>
224+
<version>${exec-maven-plugin.version}</version>
225+
<configuration>
226+
<executable>java</executable>
227+
<arguments>
228+
<argument>-classpath</argument>
229+
<classpath/>
230+
<argument>software.amazon.awssdk.benchmark.UnifiedBenchmarkRunner</argument>
231+
<!-- Fail process on failed benchmarks -->
232+
<argument>-c</argument>
233+
</arguments>
234+
</configuration>
235+
</plugin>
236+
<plugin>
237+
<groupId>com.github.spotbugs</groupId>
238+
<artifactId>spotbugs-maven-plugin</artifactId>
239+
<configuration>
240+
<!-- Skipping spotbugs for the generated JMH classes-->
241+
<skip>true</skip>
242+
</configuration>
243+
</plugin>
244+
<plugin>
245+
<groupId>org.apache.maven.plugins</groupId>
246+
<artifactId>maven-dependency-plugin</artifactId>
247+
<executions>
248+
<execution>
249+
<goals>
250+
<goal>analyze-only</goal>
251+
</goals>
252+
</execution>
253+
</executions>
254+
<configuration>
255+
<!-- Skipping maven dependencies analysis to speed up the build -->
256+
<skip>true</skip>
257+
</configuration>
258+
</plugin>
259+
</plugins>
260+
</build>
261+
262+
</project>

0 commit comments

Comments
 (0)