第二节:依赖传递

第二节:依赖传递

当存在间接依赖的情况时,主工程对间接依赖的jar可以访问吗?这要看间接依赖的jar包引入时的依赖范围——只有依赖范围为compile时可以访问。例如:
02.依赖传递性 - 图1

项目B:


com.atguigu.maven
pro04_maven_moduleC
1.0-SNAPSHOT


项目C:


javax.servlet
javax.servlet-api
3.1.0
provided


junit
junit
4.11
test


log4j
log4j
1.2.14


项目B中只可以访问到项目C中的log4j,而无法访问到项目C中的servlet-api、junit。

上一节 下一节 回目录