Using JMH within a secure environment

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Jun 23 11:43:34 UTC 2014


What Bernd said.

After you resolved the dependencies (usually the first time you build
the benchmark project), the access to outside world is not required,
since Maven cached all required bits locally. You will need the Internet
access first time around only. Adding a benchmark does not introduce new
dependencies, and therefore you can add @Benchmark and rebuild the
benchmark project without accessing the outside world.

But I think there's some confusion about "using" JMH. You have to have
Internet connection at least once when building the benchmarks, but that
can be done on local developer machine. You can _run_ JMH benchmarks
from the uberjar on isolated machine afterwards. (In fact, we do that
every so often).

Thanks,
-Aleksey.

On 06/17/2014 11:20 PM, Bernd Eckenfels wrote:
> Hello,
> 
> if you run maven once to get all dependencies downloaded you can
> further use maven in offline mode (-o,--offline).
> 
> Gruss
> Bernd
> 
> Am Tue, 17 Jun 2014 12:42:35 -0500
> schrieb Kedar Bhat <kedar.r.bhat at gmail.com>:
> 
>> I searched the archives and didn't find this question answered, so
>> apologies in advance if I missed it, but is it possible to use JMH
>> within a secure (ie no internet access, not even through a proxy)
>> environment? It seems that one needs to regenerate a
>> microbenchmarks.jar file when there is a new method to be
>> benchmarked, but this seems to require access to the outside world.
>> Is the only alternative to setup a Maven repo within the  secure
>> environment? Is it possible to use the jars on Maven Central to
>> generate the microbenchmarks.jar without needing to access the
>> outside world?
>>
>> Thank you for any nudge in the right direction!
>>
>> Kedar Bhat



More information about the jmh-dev mailing list