Starting an H2 Database Server from Maven?

后端 未结 9 1702
不思量自难忘°
不思量自难忘° 2021-01-30 07:09

Suppose I want to create and use an H2 database for my integration tests.

Maven has a command to run tests: mvn test.

Is there a way to tell maven t

9条回答
  •  长情又很酷
    2021-01-30 07:45

    I was able to get it to work without using an external server just by adding the dependency to H2 via Maven and then using this bean:

    
        
        
        
                
    
    

    Then again, this required that I use a file-based DB instead of in-memory. But it does the trick.

提交回复
热议问题