Where in maven project's path should I put configuration files that are not considered resources

前端 未结 4 1250
温柔的废话
温柔的废话 2020-12-23 09:55

I have a simple java maven project. One of my classes when executing needs to load an xml configuration file from the classpath. I don\'t want to package such xml file when

4条回答
  •  甜味超标
    2020-12-23 10:08

    You could place it in src/test/conf/default.xml. Your testclasses can find it, but it wont be packaged using the standard method.

    With an additional assembly you can package it from there. That step is always necessary.

    A different solution could be to create a separate maven module and place it in /src/main/resources/conf/... .Then make this jar a test dependency. You do not need to do any special plugin configuration, but I think it is overkill for a single file.

提交回复
热议问题