Capability to run tests against published jar, rather than locally built sources?

Think CI, and specifically testing against multiple JDKs. I’d like to build my jars using JDK7 with JDK6 compatibility. I’d like to be able to then take the jars built and published by that and run the tests in CI jobs using JDK6 and JDK8.

Is there any way I am missing to do that using the same build script as-is?

Or, assuming I need to changes, is the best (only?) option to write a separate build script that names the published jars as testRuntime deps and runs the tests skipping compilation?

Other suggestions?