Skip to content

Commit

Permalink
Allow to generate a jmh uber jar to run benchmarks easily from cmdlin…
Browse files Browse the repository at this point in the history
…e with different arguments. (netty#8264)

Motivation:

It is sometimes useful to be able to run benchmarks easily from the commandline and passs different arguments / options here. We should support this.

Modifications:

Add the benchmark-jar profile which allows to generate such an "uber-jar" that can be used directly to run benchmarks as documented at http://openjdk.java.net/projects/code-tools/jmh/.

Result:

More flexible way to run benchmarks.
  • Loading branch information
normanmaurer authored Sep 5, 2018
1 parent 3c2dbdb commit 8635d88
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions microbench/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,48 @@
</plugins>
</build>
</profile>
<profile>
<id>benchmark-jar</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>microbenchmarks</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jmh.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<!--
Shading signed JARs will fail without this.
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
-->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
Expand Down

0 comments on commit 8635d88

Please sign in to comment.