问题
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