我想在运行mvn test时在内存数据库中使用,在开发中使用文件支持的数据库。我有过滤器“工作”,因为我运行mvn resources:resources,我将src/main/resources中的模板正确地呈现到target/classes目录中。在我的主要类中使用Grizzly,does服务器确实在target/classes中拾取hibernate.cfg.xml。
但是,当我运行mvn test时,hibernate.cfg.xml似乎被读取为src/main/resources中的原始模板,而不是target/classes中呈现的模板。如何获得mvn test (以及从intellij运行测试)来使用过滤/呈现的资源?
发布于 2014-09-05 20:07:51
将测试配置文件放在src/test/resources中,以便在test时优先(在类路径中)
https://stackoverflow.com/questions/25693243
复制相似问题