Maven: change the directory in which tests are executed

前端 未结 1 1551
死守一世寂寞
死守一世寂寞 2020-12-11 00:30

In my code I have set to create some files in ./ directory, because when the software will be deployed in the installation machine, all the configuration files

1条回答
  •  时光说笑
    2020-12-11 00:38

    If you are using the surefire plugin to execute tests (which is the default), then you can set working directory like this:

    
        
            
                org.apache.maven.plugins
                maven-surefire-plugin
                2.7.2
                
                    ${java.io.tmpdir}
                
            
        
    
    

    Reference: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html

    To set to the specific directory in the question:

    ${project.build.directory}/test-run
    

    0 讨论(0)
提交回复
热议问题