// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // // Allows unit tests to run with a Java Security Manager // grant { // let everyone read target dir permission java.io.FilePermission "${preserve.project.build.directory}${/}-", "read"; }; // we don't care about the permissions of the testing infrastructure, // including maven; grant codeBase "file://${user.home}/.m2/repository/org/apache/maven/-" { permission java.security.AllPermission; }; // junit; grant codeBase "file://${user.home}/.m2/repository/junit/-" { permission java.security.AllPermission; }; // mockito; grant codeBase "file://${user.home}/.m2/repository/org/mockito/-" { permission java.security.AllPermission; }; // objenesis (via mockito); grant codeBase "file://${user.home}/.m2/repository/org/objenesis/-" { permission java.security.AllPermission; }; // surefire booter; grant codeBase "file://${project.build.directory}/surefire/-" { permission java.security.AllPermission; }; // jaxb impl grant codeBase "file://${user.home}/.m2/repository/com/sun/xml/bind/jaxb-impl/-" { permission java.security.AllPermission; }; // Geronimo specs grant codeBase "file://${user.home}/.m2/repository/org/apache/geronimo/specs/-" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.io.FilePermission "${user.home}/.m2/repository/-", "read"; }; // RI specs grant codeBase "file://${user.home}/.m2/repository/javax/validation/-" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.io.FilePermission "${user.home}/.m2/repository/-", "read"; }; grant codeBase "file://${user.home}/.m2/repository/org/apache/bval/-" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; }; // test classes grant codeBase "file://${project.build.testOutputDirectory}/-" { permission java.security.AllPermission; }; // classes under test grant codeBase "file://${project.build.outputDirectory}/-" { permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.bind.*"; permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.io.FilePermission "${user.home}/.m2/repository/-", "read"; permission java.util.PropertyPermission "*", "read"; };