bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1598345 - in /bval/trunk/bval-jsr303: pom.xml src/test/resources/java.policy
Date Thu, 29 May 2014 17:50:24 GMT
Author: mbenson
Date: Thu May 29 17:50:24 2014
New Revision: 1598345

URL: http://svn.apache.org/r1598345
Log:
get security stuff all working

Modified:
    bval/trunk/bval-jsr303/pom.xml
    bval/trunk/bval-jsr303/src/test/resources/java.policy

Modified: bval/trunk/bval-jsr303/pom.xml
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr303/pom.xml?rev=1598345&r1=1598344&r2=1598345&view=diff
==============================================================================
--- bval/trunk/bval-jsr303/pom.xml (original)
+++ bval/trunk/bval-jsr303/pom.xml Thu May 29 17:50:24 2014
@@ -33,6 +33,10 @@
 
   <description>Implementation specific classes for JSR 303 Bean Validation 1.0</description>
 
+  <properties>
+    <ant.version>1.9.3</ant.version>
+  </properties>
+
   <profiles>
     <profile>
       <id>jaxb</id>
@@ -98,6 +102,63 @@
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-resources-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>default-testResources</id>
+                <phase />
+                <goals>
+                  <goal>testResources</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>filter-testResources</id>
+                <phase>process-test-resources</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
+                    <mkdir dir="${project.build.testOutputDirectory}" />
+                    <condition property="slash" value="/" else="">
+                      <os family="windows" />
+                    </condition>
+                    <copy todir="${project.build.testOutputDirectory}" overwrite="true">
+                      <fileset dir="${project.basedir}/src/test/resources" erroronmissingdir="false"
/>
+                      <filterchain>
+                        <expandproperties />
+                        <!-- append extra slash on windows only -->
+                        <replacestring from="file://" to="file://${slash}" />
+                        <replacestring from="${file.separator}" to="/" />
+                        <!-- preserve system-specific file separator -->
+                        <expandproperties>
+                          <propertyset>
+                            <propertyref prefix="project." />
+                            <globmapper from="*" to="preserve.*" />
+                          </propertyset>
+                        </expandproperties>
+                      </filterchain>
+                    </copy>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.ant</groupId>
+                <artifactId>ant</artifactId>
+                <version>${ant.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <includes>

Modified: bval/trunk/bval-jsr303/src/test/resources/java.policy
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr303/src/test/resources/java.policy?rev=1598345&r1=1598344&r2=1598345&view=diff
==============================================================================
--- bval/trunk/bval-jsr303/src/test/resources/java.policy (original)
+++ bval/trunk/bval-jsr303/src/test/resources/java.policy Thu May 29 17:50:24 2014
@@ -1,34 +1,27 @@
-//
-// 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.
-//
-
-//
-// $Id$
+// 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
 //
-// Cloned from https://svn.apache.org/repos/asf/commons/proper/lang/trunk/src/test/resources/java.policy
-//
-// <argLine>-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy</argLine>
-//
 
 grant
 {
   // let everyone read target dir
-  permission java.io.FilePermission "${user.dir}/target/-", "read";
+  permission java.io.FilePermission "${preserve.project.build.directory}${/}-", "read";
 };
 
 // we don't care about the permissions of the testing infrastructure,
@@ -56,21 +49,46 @@ grant codeBase "file://${user.home}/.m2/
   permission java.security.AllPermission;
 };
 
-// and our own testcases
-grant codeBase "file://${user.dir}/target/test-classes/-"
+// surefire booter;
+grant codeBase "file://${project.build.directory}/surefire/-"
 {
   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";
 };
 
-grant codeBase "file://${user.dir}/target/classes/-"
+// 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";
 };



Mime
View raw message