Working with Restricted Security Environments

In some Java environments, such as J2EE containers, applet environments, or applications deployed via Java Webstart, security restrictions are applied to hosted Java code that restrict access to various system resources.

To use Clover in these environments, Clover needs to be granted various security permissions for it to function. This requires the addition of a grant entry to the security policy file for the Clover jar. For background on the syntax of the policy file, see Default Policy Implementation and Policy File Syntax. For background on setting Java security policies in general, see Permissions in the Java SDK.

Recommended Permissions

Clover requires access to the Java system properties for runtime configurations, as well as read write access to areas of the file system to read the Clover coverage database and to write coverage information. Clover also uses a shutdown hook to ensure that it flushes any as yet unflushed coverage information to disk when Java exits. To support these requirements, the following security permissions are recommended:

grant codeBase "file:/path/to/clover.jar" {
    permission java.util.PropertyPermission "*", "read";
    permission java.io.FilePermission "<<ALL FILES>>", "read, write";
    permission java.lang.RuntimePermission "shutdownHooks";
}





Last modified on Aug 6, 2014

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.