How to use maven resources also as test resources

前端 未结 2 1563
深忆病人
深忆病人 2020-12-17 18:00

I have a maven project that loads an xslt file and executes the transformation along with other processing on the result. Normally when the user runs the application, the us

2条回答
  •  春和景丽
    2020-12-17 18:01

    My problem is that I want to run tests against those xslt files in testing phase. How can I achieve this?

    There is nothing to do, target/classes is on the class path of tests. More precisely, the class path for tests is:

    • first target/test-classes
    • then target/classes
    • then dependencies

    So resources from src/main/resources (which are copied into target/classes) are visible from tests.

提交回复
热议问题