Difference between maven scope compile and provided for JAR packaging

后端 未结 7 1898
忘掉有多难
忘掉有多难 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:29

    For a jar file, the difference is in the classpath listed in the MANIFEST.MF file included in the jar if addClassPath is set to true in the maven-jar-plugin configuration. 'compile' dependencies will appear in the manifest, 'provided' dependencies won't.

    One of my pet peeves is that these two words should have the same tense. Either compiled and provided, or compile and provide.

提交回复
热议问题