|
83 | 83 | <version>33.5.0-jre</version> |
84 | 84 | <scope>test</scope> |
85 | 85 | </dependency> |
| 86 | + <dependency> |
| 87 | + <groupId>org.openjdk.jmh</groupId> |
| 88 | + <artifactId>jmh-core</artifactId> |
| 89 | + <version>${commons.jmh.version}</version> |
| 90 | + <scope>test</scope> |
| 91 | + </dependency> |
86 | 92 | </dependencies> |
87 | 93 | <distributionManagement> |
88 | 94 | <site> |
|
365 | 371 | </pluginRepository> |
366 | 372 | </pluginRepositories> |
367 | 373 | </profile> |
| 374 | + <!-- Profile to build and run the benchmarks. Use 'mvn test -Pbenchmark', and add '-Dbenchmark=foo' to run only the foo benchmark --> |
| 375 | + <profile> |
| 376 | + <id>benchmark</id> |
| 377 | + <properties> |
| 378 | + <skipTests>true</skipTests> |
| 379 | + <benchmark>org.apache</benchmark> |
| 380 | + </properties> |
| 381 | + <dependencies> |
| 382 | + <dependency> |
| 383 | + <groupId>org.openjdk.jmh</groupId> |
| 384 | + <artifactId>jmh-core</artifactId> |
| 385 | + <version>${commons.jmh.version}</version> |
| 386 | + <scope>test</scope> |
| 387 | + </dependency> |
| 388 | + <dependency> |
| 389 | + <groupId>org.openjdk.jmh</groupId> |
| 390 | + <artifactId>jmh-generator-annprocess</artifactId> |
| 391 | + <version>${commons.jmh.version}</version> |
| 392 | + <scope>test</scope> |
| 393 | + </dependency> |
| 394 | + </dependencies> |
| 395 | + <build> |
| 396 | + <plugins> |
| 397 | + <!-- Enable the compilation of the benchmarks --> |
| 398 | + <plugin> |
| 399 | + <artifactId>maven-compiler-plugin</artifactId> |
| 400 | + <version>${commons.compiler.version}</version> |
| 401 | + <configuration combine.self="override"> |
| 402 | + <testIncludes> |
| 403 | + <testInclude>**/*</testInclude> |
| 404 | + </testIncludes> |
| 405 | + </configuration> |
| 406 | + </plugin> |
| 407 | + <!-- Hook the benchmarks to the test phase --> |
| 408 | + <plugin> |
| 409 | + <groupId>org.codehaus.mojo</groupId> |
| 410 | + <artifactId>exec-maven-plugin</artifactId> |
| 411 | + <executions> |
| 412 | + <execution> |
| 413 | + <id>benchmark</id> |
| 414 | + <phase>test</phase> |
| 415 | + <goals> |
| 416 | + <goal>exec</goal> |
| 417 | + </goals> |
| 418 | + <configuration> |
| 419 | + <classpathScope>test</classpathScope> |
| 420 | + <executable>java</executable> |
| 421 | + <arguments> |
| 422 | + <argument>-classpath</argument> |
| 423 | + <classpath /> |
| 424 | + <argument>org.openjdk.jmh.Main</argument> |
| 425 | + <argument>-rf</argument> |
| 426 | + <argument>json</argument> |
| 427 | + <argument>-rff</argument> |
| 428 | + <argument>target/jmh-result.json</argument> |
| 429 | + <argument>${benchmark}</argument> |
| 430 | + </arguments> |
| 431 | + </configuration> |
| 432 | + </execution> |
| 433 | + </executions> |
| 434 | + </plugin> |
| 435 | + </plugins> |
| 436 | + </build> |
| 437 | + </profile> |
368 | 438 | </profiles> |
369 | 439 | <developers> |
370 | 440 | <developer> |
|
0 commit comments