第二节:依赖传递
当存在间接依赖的情况时,主工程对间接依赖的jar可以访问吗?这要看间接依赖的jar包引入时的依赖范围——只有依赖范围为compile时可以访问。例如:
项目B:
项目C:
项目B中只可以访问到项目C中的log4j,而无法访问到项目C中的servlet-api、junit。