mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-26 22:02:41 +00:00
Pass apache-ds temp working directory as a system property through the surefire plugin.
This commit is contained in:
parent
8b98a9d27c
commit
5464678355
@ -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);
|
||||
|
11
pom.xml
11
pom.xml
@ -1,6 +1,4 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.acegisecurity</groupId>
|
||||
<artifactId>acegi-security-parent</artifactId>
|
||||
@ -250,6 +248,13 @@
|
||||
<exclude>**/Abstract*</exclude>
|
||||
</excludes>
|
||||
<forkMode>once</forkMode>
|
||||
<systemProperties>
|
||||
<!-- The working directory for the embedded apache Ldap test server -->
|
||||
<property>
|
||||
<name>apacheDSWorkDir</name>
|
||||
<value>${basedir}/target/apacheds-work</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
Loading…
x
Reference in New Issue
Block a user