0

Out of the box, the junit tests of the Neo4j-OGM library create the temporary database files under /tmp.

How can I change this?

Setting java.io.tmpdir in the maven-surefire-plugin config does not seem to do the trick.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <java.io.tmpdir>/alt/tmp</java.io.tmpdir>
  </configuration>
</plugin>
Max Spring
  • 1,111
  • 2
  • 11
  • 18

1 Answers1

1

This worked for me

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-surefire-plugin</artifactId>
     <configuration>
           <systemProperties>
               <property>
                   <name>java.io.tmpdir</name>
                   <value>/path/to/temp</value>
                </property>
           </systemProperties>
     </configuration>
...
</plugin>

Update since the syntax above is deprecated:

<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
               <systemPropertyVariables>
                  <java.io.tmpdir>/path/to/temp</java.io.tmpdir> 
               </systemPropertyVariables>
         </configuration>
    ...
    </plugin>
Luanne
  • 19,145
  • 1
  • 39
  • 51
  • After switching to latest Maven 3.3.3, it actually works as advertised. I had been using Maven 3.1.1. It works with the new and the deprecated surefire's systemProperties syntax. – Max Spring Sep 12 '15 at 00:37