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

前端 未结 6 1245
再見小時候
再見小時候 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:53

    If all you are trying to do is gather dependecies, you could add pom to change from the default jar packaging.

    However, based on the context in your question, having src/test/java and src/test/resources folders leads me to believe you have a component that is just tests? Changing packaging to pom would stop the tests from being run from maven. If this is indeed your use case, it would seem that you are trying to skip the packaging. The best way to achieve that is to bind the plugin for the modules packaging to phase none, as there is no way to skip the package phase of the maven lifecycle. This is identified as Solution 1 above.

提交回复
热议问题