Currently I am doing java project using Maven. There is no problem to run using netbeans or eclips with VM option(-Djava.security.policy=security_policy.txt ) setting in the IDE.
But now i want to run without ECLIPS/NETBEANS and tried mvn test and found this error.
java.security.AccessControlException: access denied (java.io.FilePermission D:\Tecforte\LR4\branches\Prototype\LR_V4\Collector\.\config\logging.proper
ties read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
I already experience this prob in Eclips but it is solved when i put -Djava.security.policy=security_policy.txt in the VM option.
So my question is… How to run using command prompt to include the security option or in short question… how to avoid the AccessControlException ?
Thanks in advance
See systemPropertyVariables (or systemPropertiesFiles), can be set on the Maven test plugin configuration.
Example:
This will pass the system property someProperty=someValue to your unit tests.