From 5464678355a392ed7ec0a02c464b29a9ab12db6b Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Tue, 6 Feb 2007 18:18:14 +0000 Subject: [PATCH] Pass apache-ds temp working directory as a system property through the surefire plugin. --- .../java/org/acegisecurity/ldap/LdapTestServer.java | 12 ++++++------ pom.xml | 11 ++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) 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 + +