scope “provided” does not add in jars in classpath

℡╲_俬逩灬. 提交于 2019-12-10 15:51:19

问题


I am using a dependency of scope "provided" pom file of an artifact. Because of "provided" scope, those dependency jars are not added in classpath of MANIFEST.MF.

Could you help me so that the jars should not be downloaded but should be added in classpath.


回答1:


Well, if you want it semantically right, remove <scope>provided</scope> and leave it default (<scope>compile</scope>). Then set <optional>true</optional> for a dependency, so it will be included in manifest's classpath.

By using provided scope you actually say that you don't want it to be in manifest's classpath since it's anyway provided by the container.



来源:https://stackoverflow.com/questions/11114118/scope-provided-does-not-add-in-jars-in-classpath

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!