Does JMH support Tycho?
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed Apr 2 10:36:38 UTC 2014
Hi Max,
On 04/02/2014 02:21 PM, Bureck, Max wrote:
> I have a question: I am trying to test some functionality located in
> an OSGi bundle which uses Tycho for dependency resolution (based on
> the bundle's manifest file). Unfortunately the benchmark does not
> include the dependencies resolved by Tycho. Is there a way to make
> JMH include those dependencies? I don't need any OSGi class loading;
> the dependent bundles just have to be on the classpath.
I am not familiar with Tycho (and have only a rudimentary understanding
of OSGi), so my answer is pure speculation.
There are two facets you should be aware of:
1) JMH compilation usually requires the dependencies during the
compilation; that is, the @GMB-annotated classes should be resolvable on
classpath. You can check if that's the case by listing the benchmarks in
the final JAR (those would be synthetic generated classes which are
calling back into your dependencies).
2) Once JMH had compiled the benchmarks, it is customary to have the
dependencies packed in the single JAR. Can Tycho resolve and bundle the
dependencies during the build? (If feels to counter OSGi goals though)
Either way, it is not the JMH problem per se, but rather the build problem.
If you want a more concrete answer, please provide the simple
Tycho-driven JMH project which is not working, we can then look closely
to what is wrong.
-Aleksey.
More information about the jmh-dev
mailing list