What Google (really Harmony) did is mere cloning. They (very) expressly didn't use Java the software, only the "Java API".
It's not useless. Your customers can compile it, and link it to the GPLed library. After all the GPL allows you absolute freedom of use, as long as you don't distribute the derivative work.
Obviously there's some gray area if you, say, publish your code in the context of fair use (as an academic paper, say) and someone else does the integration work without your blessing (this is what I meant by "useless piece of source code"). But simply saying "build it yourself" is not a get out of jail free card for the GPL.
In my understanding only the compiled result which links to the GPLed library is a derivative work.
[1] AT&T was legally required to provide the source code of its OS 'for free', I'm not sure if the terms actually qualify as 'free-as-in-freedom', hence the impetus to create an alternative implementation.
(And really it's not simply a question of "non-free" -- there are plenty of open source licenses that are incompatible with the GPL. Is this technically a workaround for the incompatibility between Apache v2 and GPL v2?)
But a non-free villain could bootstrap a build using Maven without even publishing their source at all -- just keep a Maven repository with their binary jars and and a pom.xml that specifies dependencies on a whole bunch of GPL libraries.
Is there a provision against it? I hope so, but I haven't found it yet.
http://wbillingsley.blogspot.com.au/2012/06/does-oracle-v-go...
For example, if you distributed your commercial software packaged up with a GPL library, with scripts or links or whatever designed to have that library loaded together with the commercial binary as part of a finished product, then the "dynamic" nature of the linking might well be considered to be a technical irrelevancy.
On the other hand, if you distributed your commercial binary on it's own, and expected your customers to find a compatible library to dynamically link against it, then that might be a different matter.
That is, after all, what the GNU project was created for.