Packaging the SeaLights Test Listener with Gradle



The SeaLights Test Listener agent is needed for capturing coverage from the application server. It does this by being defined as a javaagent during run time.

The location of the SeaLights Test Listener jar file that is downloaded by the Gradle plugin is saved in the property sealights.testListenerPath
You can use this property to copy the jar file into a location that gets packaged alongside your artifact, for instance in a docker file.

Here is a sample of copying the SeaLights Test Listener into the folder build

task copySealightsTL (dependsOn: test) { doLast { copy { from file(sealights.testListenerPath) into "build" rename '.*', 'sl-test-listener.jar' } } }