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.
Maven dependency scope – provided Maven dependency scope provided is used during build and test the project. They are also required to run, but should not exported, because the dependency will be provided by the runtime, for instance, by servlet container or application server.
Maven includes a dependency with this scope in the runtime and test classpaths, but not the compile classpath. This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.
compile This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects. provided This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With