]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1954] Adding validatehierarchy property for JCR
authorMartin Stockhammer <martin_s@apache.org>
Tue, 13 Jun 2017 22:04:07 +0000 (00:04 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Tue, 13 Jun 2017 22:04:07 +0000 (00:04 +0200)
archiva-jetty/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-webapp-test/pom.xml
archiva-modules/archiva-web/archiva-webdav/pom.xml
archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/ArchivaJcrRepositoryConfig.java

index f5cbd3e8c697a5d06c08c0130fa9355402e6b810..33b00489cbd6b350661aec8cf94d1354b6b8d3ac 100644 (file)
                   <systemProperty>AsyncLoggerConfig.WaitStrategy=Block</systemProperty>
                   <systemProperty>archiva.repositorySessionFactory.id=jcr</systemProperty>
                   <systemProperty>archiva.cassandra.configuration.file=%ARCHIVA_BASE%/conf/archiva-cassandra.properties</systemProperty>
+                  <systemProperty>org.apache.jackrabbit.core.state.validatehierarchy=true</systemProperty>
                 </systemProperties>
                 <extraArguments>
                   <extraArgument>-XX:MaxPermSize=128m</extraArgument>
index 2c471a5513ca326fd50448468fb161fbb7eba87d..882cd6f25c269ce0e21d199603a14f164c2779a8 100644 (file)
             <!--org.apache.jackrabbit.minMemoryPerCache>1</org.apache.jackrabbit.minMemoryPerCache-->
             <archiva.repositorySessionFactory.id>jcr</archiva.repositorySessionFactory.id>
             <openjpa.Log>${openjpa.Log}</openjpa.Log>
+            <org.apache.jackrabbit.core.state.validatehierarchy>true</org.apache.jackrabbit.core.state.validatehierarchy>
           </systemPropertyVariables>
         </configuration>
       </plugin>
index b68c2ad3399c65fe0222bd827f1a0eecba221342..30fd890b04ed7a799aaf28a59c31e17cd71fe26e 100644 (file)
                       <name>openjpa.Log</name>
                       <value>${openjpa.Log}</value>
                     </systemProperty>
+                    <systemProperty>
+                      <name>org.apache.jackrabbit.core.state.validatehierarchy</name>
+                      <value>true</value>
+                    </systemProperty>
                   </systemProperties>
                 </configuration>
               </execution>
index 5d596644810d9080e9f1f78ddda035562529a08a..2b08b3f297c8e9f433a6858662c2f18ea94c523d 100644 (file)
             <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
             <archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
             <openjpa.Log>${openjpa.Log}</openjpa.Log>
+            <org.apache.jackrabbit.core.state.validatehierarchy>true</org.apache.jackrabbit.core.state.validatehierarchy>
           </systemPropertyVariables>
           <forkMode>${webdav.forkMode}</forkMode>
         </configuration>
index 11d7cae5ddb0ffd01f82cd7def327be604422a11..8271e2bec1b9c3034f74679aebd1f1e4cfc5f040 100644 (file)
@@ -30,6 +30,15 @@ import java.io.File;
  */
 public class ArchivaJcrRepositoryConfig
 {
+    // Recommended to avoid inconsistencies caused by race conditions.
+    static
+    {
+        if ( !System.getProperties( ).containsKey( "org.apache.jackrabbit.core.state.validatehierarchy" ) )
+        {
+            System.setProperty( "org.apache.jackrabbit.core.state.validatehierarchy", "true" );
+        }
+    }
+
     public static RepositoryConfig create( String file, String home )
         throws ConfigurationException
     {