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

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

    None of the other solutions seemed particularly attractive to me, so my solution was to add a file src/main/resources/dummy containing the explanation:

    Dummy file to avoid empty jar warning from Maven.
    

    At least this does not produce any noise in the pom.xml, and there cannot be any misunderstandings about the purpose of the file. It produces a jar with exactly that file, but this was no problem in my case.

提交回复
热议问题