Difference between maven scope compile and provided for JAR packaging

后端 未结 7 1794
忘掉有多难
忘掉有多难 2020-11-22 14:44

What is the difference between the maven scope compile and provided when artifact is built as a JAR? If it was WAR, I\'d understand - the artifact

7条回答
  •  有刺的猬
    2020-11-22 15:28

    • compile

    Make available into class path, don't add this dependency into final jar if it is normal jar; but add this jar into jar if final jar is a single jar (for example, executable jar)

    • provided

    Dependency will be available at run time environment so don't add this dependency in any case; even not in single jar (i.e. executable jar etc)

提交回复
热议问题