However, with runtime or test scoped artifacts, does the same requirement apply? I wouldn't think so, but am very interested in hearing the opinions of the community here.
I'm not a lawyer but I don't see why things would be different for Java code depending on runtime
or1 test
scoped dependencies. Such code import
classes from a library and thus becomes a derivative work of the library in the same way.
Below, some quotes from The LGPL and Java:
It has always been the FSF's position that dynamically linking
applications to libraries creates a
single work derived from both the
library code and the application code.
The GPL requires that all derivative
works be licensed under the GPL, an
effect which can be described as
“hereditary.” So, if an application
links to a library licensed under the
GPL, the application too must be
licensed under the GPL. By contrast,
libraries licensed under the GNU
Lesser General Public License (LGPL)
may be linked to proprietary
applications.
(...)
The typical arrangement for Java is
that each library an application uses
is distributed as a separate JAR (Java
Archive) file. Applications use Java's
“import” functionality to access
classes from these libraries. When the
application is compiled, function
signatures are checked against the
library, creating a link. The
application is then generally a
derivative work of the library. So,
the copyright holder for the library
must authorize distribution of the
work.
So, unless the library is licensed under the GNU General Public License with a linking exception, my understanding is that:
(...) code linked with GPL code must be using a GPL-compatible license.
But, as always, you should ask a lawyer.
1 Update: I was too much focused on the test
scope and did not pay enough attention to the case of runtime
dependencies. As pointed out by the OP, runtime
dependencies seem different since you don't directly import classes from them so the above might not apply (this is at least my interpretation but I'm still not a lawyer :)
References