Maven - Suppress [WARNING] JAR will be empty - no content was marked for inclusion in pom.xml

前端 未结 6 1219
再見小時候
再見小時候 2021-02-12 21:16

My maven project intentionally only needs src/test/java and src/test/resources. After removing src/main/* folders, the expected w

6条回答
  •  名媛妹妹
    2021-02-12 21:58

    The simply and best solution is to keep the test code in src/main/java yes this is not a typo. Furthermore if it is a test framework the test framework must have tests itself so it makes sense to locate the tests for the productive code from the user point of view into src/main/java and the tests in src/test/java.

    From the user point of view it will be simply jar file where you should define the test.

    This will solve all the issues without any supplemental configuration and changing any default and no violation of conventions.

提交回复
热议问题