Merge pull request #102 from apache/dependabot/maven/junit.jupiter.api.version-5.10.0

Bump junit.jupiter.api.version from 5.9.3 to 5.10.0
diff --git a/.github/workflows/pull-request-build.yaml b/.github/workflows/pull-request-build.yaml
index 3bbc044..4144565 100644
--- a/.github/workflows/pull-request-build.yaml
+++ b/.github/workflows/pull-request-build.yaml
@@ -17,7 +17,7 @@
     steps:
       - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
       - name: Set up JDK 11
-        uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
+        uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
         with:
           java-version: '11'
           distribution: 'temurin'
diff --git a/Jenkinsfile b/Jenkinsfile
index 60dc97e..a85eee3 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -122,6 +122,32 @@
             }
           }
         }
+        stage ('Linux Java 20') {
+          options {
+            timeout(time: 4, unit: 'HOURS')
+            retry(2)
+          }
+          agent {
+            docker {
+              label 'ubuntu'
+              image 'apachedirectory/maven-build:jdk-20'
+              alwaysPull true
+              args '-v $HOME/.m2:/home/hnelson/.m2'
+            }
+          }
+          steps {
+            sh '''
+            mvn -V -U clean verify
+            '''
+          }
+          post {
+            always {
+              junit '**/target/surefire-reports/*.xml'
+              deleteDir()
+            }
+          }
+        }
+
         stage ('Windows Java 11') {
           options {
             timeout(time: 4, unit: 'HOURS')
diff --git a/core-annotations/pom.xml b/core-annotations/pom.xml
index 5e83a72..ce53f55 100644
--- a/core-annotations/pom.xml
+++ b/core-annotations/pom.xml
@@ -119,7 +119,7 @@
         <configuration>
           <systemPropertyVariables>
             <felix.cache.rootdir>
-              ${project.build.directory}
+              ${felix.cache.dir}
             </felix.cache.rootdir>
             <felix.cache.locking>
               false
diff --git a/core-integ/pom.xml b/core-integ/pom.xml
index 7d2cb0b..14efe17 100644
--- a/core-integ/pom.xml
+++ b/core-integ/pom.xml
@@ -265,7 +265,7 @@
               </excludes>
               <systemPropertyVariables>
 	            <felix.cache.rootdir>
-	              ${project.build.directory}
+	              ${felix.cache.dir}
 	            </felix.cache.rootdir>
 	            <felix.cache.locking>
 	              false
@@ -290,7 +290,7 @@
                   <systemPropertyVariables>
                     <apacheds.partition.factory>org.apache.directory.server.core.factory.AvlPartitionFactory</apacheds.partition.factory>
 	                <felix.cache.rootdir>
-	                  ${project.build.directory}
+	                  ${felix.cache.dir}
 	                </felix.cache.rootdir>
 	                <felix.cache.locking>
 	                  false
@@ -314,7 +314,7 @@
                   <systemPropertyVariables>
                     <apacheds.partition.factory>org.apache.directory.server.core.factory.LdifPartitionFactory</apacheds.partition.factory>
 	                <felix.cache.rootdir>
-	                  ${project.build.directory}
+	                  ${felix.cache.dir}
 	                </felix.cache.rootdir>
 	                <felix.cache.locking>
 	                  false
diff --git a/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PPolicyInterceptor.java b/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PPolicyInterceptor.java
index 0663556..4d4b2e2 100644
--- a/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PPolicyInterceptor.java
+++ b/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PPolicyInterceptor.java
@@ -30,13 +30,36 @@
 import static org.apache.directory.api.ldap.model.constants.PasswordPolicySchemaConstants.PWD_RESET_AT;
 import static org.apache.directory.api.ldap.model.constants.PasswordPolicySchemaConstants.PWD_START_TIME_AT;
 
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyErrorEnum;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequest;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponseImpl;
+import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapNoPermissionException;
+import org.apache.directory.api.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
+import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.InterceptorEnum;
+import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.api.interceptor.Interceptor;
+import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.CompareOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.GetRootDseOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.HasEntryOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.OperationContext;
+import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,7 +71,7 @@
 public class PPolicyInterceptor extends BaseInterceptor
 {
     private static final Logger LOG = LoggerFactory.getLogger( PPolicyInterceptor.class );
-
+    
     /**
      * Speedup for logs
      */
@@ -75,6 +98,9 @@
 
     private AttributeType pwdEndTimeAT;
 
+    /** a container to hold all the ppolicies */
+//    private PpolicyConfigContainer pwdPolicyContainer;
+
 
     /**
      * Creates a new instance of DefaultAuthorizationInterceptor.
@@ -140,6 +166,114 @@
 
 
     /**
+     * set all the password policies to be used by the server.
+     * This includes a default(i.e applicable to all entries) and custom(a.k.a per user) password policies
+     * 
+     * @param policyContainer the container holding all the password policies
+     */
+//    public void setPwdPolicies( PpolicyConfigContainer policyContainer )
+//    {
+//        this.pwdPolicyContainer = policyContainer;
+//    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void add( AddOperationContext addContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", addContext );
+        }
+        
+        // No need to do anythingh if the PasswordPoloicy is not activated, 
+        // or if we are in a replication context
+        if ( !directoryService.isPwdPolicyEnabled() || addContext.isReplEvent() )
+        {
+            next( addContext );
+            return;
+        }
+
+        // First check if the entry is part of a PasswordPolicy subentry
+        Entry entry = addContext.getEntry();
+
+        PasswordPolicyConfiguration policyConfig = getPwdPolicy( entry, MessageTypeEnum.ADD_REQUEST );
+        
+        if ( policyConfig == null )
+        {
+            // Simply call the next interceptor and return, there is nothing to do.
+            next( addContext );
+            
+            return;
+        }
+
+        // At this point, the user requesting the addition has not been authenticated
+        // We just check what we do depending on the user requesting the addition, either an admin or a normal user
+/*        if ( addContext.getSession().isAnAdministrator() )
+        {
+            // TODO
+        }
+        else
+        {
+            // TODO
+        }
+*/        
+        // First check if the user's password reset is requested 
+        checkPwdReset( addContext );
+        
+        // We have three use cases:
+        // - The entry does not belong to an administrative area associated with a passwordPolicy in a subentry: nothing to do
+        // - The entry belongs to an administrative area associated with a passwordPolicy in a subentry, but has no attribute 
+        //     defined in the subentry pwdAttribute: nothing to do
+        // - The entry belongs to an administrative area associated with a passwordPolicy in a subentry, and has an attribute 
+        //     defined in the subentry pwdAttribute: add the requested operational attribute accordingly to the applied PasswordPolicy
+        //
+        // We can't discard an entry simply base don the fact that it does not have a userPassword attribute, it' snot enough.
+        
+        
+        // propagate the call to the next interceptor
+        next( addContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void bind( BindOperationContext bindContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", bindContext );
+        }
+        
+        // Operation check
+        
+        
+        // propagate the call to the next interceptor
+        next( bindContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean compare( CompareOperationContext compareContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", compareContext );
+        }
+
+        // propagate the call to the next interceptor
+        return next( compareContext );
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     @Override
@@ -155,4 +289,265 @@
         // propagate the call to the next interceptor
         next( deleteContext );
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Entry getRootDse( GetRootDseOperationContext getRootDseContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", getRootDseContext );
+        }
+
+        // propagate the call to the next interceptor
+        return next( getRootDseContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean hasEntry( HasEntryOperationContext hasEntryContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", hasEntryContext );
+        }
+
+        // propagate the call to the next interceptor
+        return next( hasEntryContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", lookupContext );
+        }
+
+        // propagate the call to the next interceptor
+        return next( lookupContext );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void modify( ModifyOperationContext modifyContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", modifyContext );
+        }
+
+        // propagate the call to the next interceptor
+        next( modifyContext );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void move( MoveOperationContext moveContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", moveContext );
+        }
+
+        // propagate the call to the next interceptor
+        next( moveContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", moveAndRenameContext );
+        }
+
+        // propagate the call to the next interceptor
+        next( moveAndRenameContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void rename( RenameOperationContext renameContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", renameContext );
+        }
+
+        // propagate the call to the next interceptor
+        next( renameContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", searchContext );
+        }
+
+        // propagate the call to the next interceptor
+        return next( searchContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void unbind( UnbindOperationContext unbindContext ) throws LdapException
+    {
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Operation Context: {}", unbindContext );
+        }
+
+        // propagate the call to the next interceptor
+        next( unbindContext );
+    }
+
+
+    /**
+     * checks to see if the user's password should be changed before performing any operations
+     * other than bind, password update, unbind, abandon or StartTLS
+     *
+     * @param opContext the operation's context
+     * @throws LdapException
+     */
+    private void checkPwdReset( OperationContext opContext ) throws LdapException
+    {
+        if ( directoryService.isPwdPolicyEnabled() )
+        {
+            CoreSession session = opContext.getSession();
+
+            if ( session.isPwdMustChange() )
+            {
+                boolean isPPolicyReqCtrlPresent = opContext.hasRequestControl( PasswordPolicyRequest.OID );
+
+                if ( isPPolicyReqCtrlPresent )
+                {
+                    PasswordPolicyResponse responseControl = new PasswordPolicyResponseImpl();
+                    responseControl.setPasswordPolicyError( PasswordPolicyErrorEnum.CHANGE_AFTER_RESET );
+                    opContext.addResponseControl( responseControl );
+                }
+
+                throw new LdapNoPermissionException( "password needs to be reset before performing this operation" );
+            }
+        }
+    }
+    
+    
+
+
+    /**
+     * Gets the effective password policy of the given entry.
+     * If the entry has defined a custom password policy by setting "pwdPolicySubentry" attribute
+     * then the password policy associated with the Dn specified at the above attribute's value will be returned.
+     * Otherwise the default password policy will be returned (if present)
+     * 
+     * @param userEntry the user's entry
+     * @param operation The Operation. If it's a Add, then we have to find the PPolicy using the subentries
+     * @return the associated password policy
+     * @throws LdapException If we weren't able to fetch the password policy
+     */
+    private PasswordPolicyConfiguration getPwdPolicy( Entry userEntry, MessageTypeEnum operation ) throws LdapException
+    {
+        switch ( operation )
+        {
+            case ADD_REQUEST:
+                // Fetch the PPolicy from the subentries
+//                if ( pwdPolicyContainer == null )
+//                {
+//                    return null;
+//                }
+
+//                return pwdPolicyContainer.getDefaultPolicy();
+                
+            case BIND_REQUEST:
+            case COMPARE_REQUEST:
+            case DEL_REQUEST:
+            case EXTENDED_REQUEST:
+            case MODIFY_REQUEST:
+                // The entry must have a pwdPolicySubentry AT
+                if ( userEntry.get( pwdPolicySubentryAT ) == null )
+                {
+                    return null;
+                }
+
+                break;
+                
+            case MODIFYDN_REQUEST:
+            case SEARCH_REQUEST:
+            case UNBIND_REQUEST:
+            case ABANDON_REQUEST:
+            default:
+        }
+
+/*
+        if ( pwdPolicyContainer == null )
+        {
+            return null;
+        }
+
+        if ( userEntry == null )
+        {
+            return pwdPolicyContainer.getDefaultPolicy();
+        }
+
+        if ( pwdPolicyContainer.hasCustomConfigs() )
+        {
+            Attribute pwdPolicySubentry = userEntry.get( pwdPolicySubentryAT );
+
+            if ( pwdPolicySubentry != null )
+            {
+                Dn configDn = dnFactory.create( pwdPolicySubentry.getString() );
+
+                PasswordPolicyConfiguration custom = pwdPolicyContainer.getPolicyConfig( configDn );
+                
+                if ( custom != null )
+                {
+                    return custom;
+                }
+                else
+                {
+                    LOG.warn(
+                        "The custom password policy for the user entry {} is not found, returning default policy configuration",
+                        userEntry.getDn() );
+                }
+            }
+        }
+
+        return pwdPolicyContainer.getDefaultPolicy();
+*/
+        return null;
+    }
+
 }
diff --git a/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java b/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java
new file mode 100644
index 0000000..ff72f6d
--- /dev/null
+++ b/interceptors/ppolicy/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java
@@ -0,0 +1,113 @@
+/*
+ *   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.
+ *
+ */
+
+package org.apache.directory.server.core.ppolicy;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
+
+
+/**
+ * A container to hold all the password policies defined in the server
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class PpolicyConfigContainer
+{
+    /** a map holding the entry specific password policies */
+    private Map<Dn, PasswordPolicyConfiguration> ppolicyConfigMap = new HashMap<>();
+
+    /** the default password policy Dn */
+    private Dn defaultPolicyDn;
+
+
+    /**
+     * add a entry specific policy
+     *
+     * @param configDn the Dn where this entry's password policy is defined
+     * @param policyConfig the password policy configuration
+     */
+    public void addPolicy( Dn configDn, PasswordPolicyConfiguration policyConfig )
+    {
+        if ( configDn == null )
+        {
+            throw new IllegalArgumentException( "password policy config's Dn cannot be null" );
+        }
+
+        ppolicyConfigMap.put( configDn, policyConfig );
+    }
+
+
+    /**
+     * @return true if atleast one entry specific password policy exists, false otherwise
+     */
+    public boolean hasCustomConfigs()
+    {
+        return !ppolicyConfigMap.isEmpty();
+    }
+
+
+    /**
+     * Get the password policy configuration defined at a given Dn
+     *  
+     * @param configDn the Dn where password policy was configured
+     * @return The found PasswordPolicyConfiguration instance
+     */
+    public PasswordPolicyConfiguration getPolicyConfig( Dn configDn )
+    {
+        return ppolicyConfigMap.get( configDn );
+    }
+
+
+    /**
+     * @return the default password policy, null if not configured
+     */
+    public PasswordPolicyConfiguration getDefaultPolicy()
+    {
+        return getPolicyConfig( defaultPolicyDn );
+    }
+
+
+    /**
+     * Set the default password policy configuration's Dn
+     * 
+     * @param defaultPolicyDn the default password policy configuration's Dn 
+     */
+    public void setDefaultPolicyDn( Dn defaultPolicyDn )
+    {
+        this.defaultPolicyDn = defaultPolicyDn;
+    }
+
+
+    /**
+     * deactivate an existing password policy.
+     *  
+     * @param ppolicyConfigDn the Dn of the password policy configuration
+     * @return the deactivated password policy config object of the given reference Dn, null otherwise
+     */
+    public PasswordPolicyConfiguration removePolicyConfig( Dn ppolicyConfigDn )
+    {
+        return ppolicyConfigMap.remove( ppolicyConfigDn );
+    }
+}
diff --git a/ldap-client-test/pom.xml b/ldap-client-test/pom.xml
index 4661574..23387e0 100644
--- a/ldap-client-test/pom.xml
+++ b/ldap-client-test/pom.xml
@@ -136,7 +136,7 @@
               </excludes>
 	          <systemPropertyVariables>
 	            <felix.cache.rootdir>
-	              ${project.build.directory}
+	              ${felix.cache.dir}
 	            </felix.cache.rootdir>
 	            <felix.cache.locking>
 	              false
@@ -174,7 +174,7 @@
               </excludes>
 	          <systemPropertyVariables>
 	            <felix.cache.rootdir>
-	              ${project.build.directory}
+	              ${felix.cache.dir}
 	            </felix.cache.rootdir>
 	            <felix.cache.locking>
 	              false
diff --git a/pom.xml b/pom.xml
index 6e9d7c8..21acedf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,7 +73,7 @@
     <junit.jupiter.api.version>5.10.0</junit.jupiter.api.version>
     <kerby.version>2.0.3</kerby.version>
     <ldapsdk.version>4.1</ldapsdk.version>
-    <logback.version>1.4.8</logback.version>
+    <logback.version>1.4.11</logback.version>
     <maven.version>3.9.1</maven.version>
     <mina.core.version>2.2.2</mina.core.version>
     <org.apache.felix.version>7.0.5</org.apache.felix.version>
@@ -86,6 +86,9 @@
     <wagon.ssh.version>3.5.3</wagon.ssh.version>
     <wagon.ssh.external.version>3.5.3</wagon.ssh.external.version>
     <wrapper.version>3.2.3</wrapper.version>
+
+    <!-- properties used in tests -->
+    <felix.cache.dir>${project.build.directory}/felix-root</felix.cache.dir>
   </properties>
 
   <url>https://directory.apache.org/apacheds/1.5</url>
diff --git a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java
index 8cef693..fb1fbbf 100644
--- a/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java
+++ b/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplSearchListener.java
@@ -544,7 +544,7 @@
         // server the DNs are all normalized and a simple string compare should
         // do the trick
         
-        String name = Strings.toLowerCaseAscii( entry.getDn().getName() );
+        String name = Strings.toLowerCase( entry.getDn().getName() );
         
         if ( name.endsWith( replConsumerConfigDn )
             || name.endsWith( schemaDn )
diff --git a/server-annotations/pom.xml b/server-annotations/pom.xml
index 59b1cb5..9354239 100644
--- a/server-annotations/pom.xml
+++ b/server-annotations/pom.xml
@@ -93,7 +93,7 @@
         <configuration>
           <systemPropertyVariables>
             <felix.cache.rootdir>
-              ${project.build.directory}
+              ${felix.cache.dir}
             </felix.cache.rootdir>
             <felix.cache.locking>
               false
diff --git a/server-integ/pom.xml b/server-integ/pom.xml
index c25a8c8..cf82b65 100644
--- a/server-integ/pom.xml
+++ b/server-integ/pom.xml
@@ -270,7 +270,7 @@
             <configuration>
               <systemPropertyVariables>
                 <felix.cache.rootdir>
-                  ${project.build.directory}
+                  ${felix.cache.dir}
                 </felix.cache.rootdir>
                 <felix.cache.locking>
                   false
@@ -327,7 +327,7 @@
               <systemPropertyVariables>
                 <apacheds.partition.factory>org.apache.directory.server.core.factory.JdbmPartitionFactory</apacheds.partition.factory>
                 <felix.cache.rootdir>
-                  ${project.build.directory}
+                  ${felix.cache.dir}
                 </felix.cache.rootdir>
                 <felix.cache.locking>
                   false
@@ -355,7 +355,7 @@
                   <systemPropertyVariables>
                     <apacheds.partition.factory>org.apache.directory.server.core.factory.AvlPartitionFactory</apacheds.partition.factory>
                     <felix.cache.rootdir>
-                      ${project.build.directory}
+                      ${felix.cache.dir}
                     </felix.cache.rootdir>
                     <felix.cache.locking>
                       false
@@ -383,7 +383,7 @@
                   <systemPropertyVariables>
                     <apacheds.partition.factory>org.apache.directory.server.core.factory.LdifPartitionFactory</apacheds.partition.factory>
                     <felix.cache.rootdir>
-                      ${project.build.directory}
+                      ${felix.cache.dir}
                     </felix.cache.rootdir>
                     <felix.cache.locking>
                       false
diff --git a/test-framework/pom.xml b/test-framework/pom.xml
index 4aabdea..6af46ac 100644
--- a/test-framework/pom.xml
+++ b/test-framework/pom.xml
@@ -88,7 +88,7 @@
         <configuration>
           <systemPropertyVariables>
             <felix.cache.rootdir>
-              ${project.build.directory}
+              ${felix.cache.dir}
             </felix.cache.rootdir>
             <felix.cache.locking>
               false