更改 Neo4j-OGM 单元测试的临时目录?

change temp dir for Neo4j-OGM unit tests?

开箱即用,Neo4j-OGM 库的 junit 测试在 /tmp 下创建临时数据库文件。

我该如何更改?

在 maven-surefire-plugin 配置中设置 java.io.tmpdir 似乎不起作用。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <java.io.tmpdir>/alt/tmp</java.io.tmpdir>
  </configuration>
</plugin>

这对我有用

<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>

更新,因为上面的语法已被弃用:

<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>