JMH is released under the GPL2 license which is a viral license :-) If I use JMH (but only in tests) do I have to make my application available under the GPL2 license by definition?

I asked various test groups, but so far opinions are divided. I'm waiting for someone to give an answer best supported by some legal expertise :-)

1 Answer 1


If you distribute your software together with tests and JMH, then it must be GPL licensed. If you distribute your software without these tests and without JMH, then it doesn't have to be GPL licensed.

You might be able to distribute your software, together with tests that are designed to work with JMH, but that don't actually work because you didn't distribute JMH. You can do that without a GPL license. You can then add instructions how to download JMH, how to combine it with the tests and how to run these tests.

If I follow these instructions, then I have tests that I can only distribute with the GPL license. But on the other hand I don't have your permission to distribute your tests, so as the logical consequence I cannot distribute these tests at all. (Or I might have your permission to distribute the tests, but no source code, which means I cannot meet my GPL license obligations, so I cannot distribute under GPL either).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .