diff --git a/core/src/test/java/org/acegisecurity/ldap/LdapTestServer.java b/core/src/test/java/org/acegisecurity/ldap/LdapTestServer.java index 077de0d1bc..c85418678e 100644 --- a/core/src/test/java/org/acegisecurity/ldap/LdapTestServer.java +++ b/core/src/test/java/org/acegisecurity/ldap/LdapTestServer.java @@ -207,16 +207,16 @@ public class LdapTestServer { private void startLdapServer() { cfg = new MutableStartupConfiguration(); - // Attempt to use the maven target directory for the apache ds store. - // This doesn't work at the moment - need to find out if we can access maven properties somehow. + // Attempt to use the maven target directory for the apache ds store. Property is passed + // through surefire plugin setup in pom.xml. - String tempDirectory = System.getProperty("maven.build.dir"); + String apacheWorkDir = System.getProperty("apacheDSWorkDir"); - if(tempDirectory == null) { - tempDirectory = System.getProperty("java.io.tmpdir"); + if(apacheWorkDir == null) { + apacheWorkDir = System.getProperty("java.io.tmpdir" + File.separator + "apacheds-work"); } - File workingDir = new File(tempDirectory + File.separator + "apacheds-work"); + File workingDir = new File(apacheWorkDir); // Delete any previous contents (often not compatible between apache-ds versions). deleteDir(workingDir); diff --git a/pom.xml b/pom.xml index aa2ad9546c..eb0c91f7e5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,4 @@ - + 4.0.0 org.acegisecurity acegi-security-parent @@ -250,6 +248,13 @@ **/Abstract* once + + + + apacheDSWorkDir + ${basedir}/target/apacheds-work + +