Declare Maven dependency as test runtime only

前端 未结 4 1201
半阙折子戏
半阙折子戏 2021-02-04 00:03

What is the best way to declare a Maven dependency as only being used for the test runtime (but not test compilation) class path?

Specifically, I want slf4j-api

4条回答
  •  迷失自我
    2021-02-04 00:30

    There is no concept of test-runtime in maven. The only real downside is the dependency analysis identifying these runtime test dependencies as unused. Since they are only test dependencies, however, this is pretty benign and cannot cause issues to other projects transitively dependent on this project.

提交回复
热议问题