I have a project A which has some dependencies. Some of them have a provided
scope.
<dependencies>
...
<dependency>
<groupId>some-group</groupId>
<artifactId>some-artifact</artifactId>
<scope>provided</scope>
</dependency>
...
</dependencies>
Now I have another project B which imports A:
<dependencies>
...
<dependency>
<groupId>my-group</groupId>
<artifactId>my-project-a</artifactId>
</dependency>
...
</dependencies>
All dependencies in project A are imported transitively in project B.
However, the provided
dependencies in project A, such as some-group:some-artifact
, are not. Is it also possible to import the provided
dependencies from A into B?
The 'provided' scope is not transitive and therefore not inherited.
Dependent on your context you either have to add the dependency manually or you may depend on a common parent POM or a BOM (Bill of Materials).
Here is more information on the scopes and BOMs: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments