pom中引用本地jar
很奇怪的就是本地的jar一直没有被引用到项目中,后面干脆使用了绝对路径的引用
<dependency> <groupId>com.jun.cloudgroupId> <artifactId>jun-opentsdb-clientartifactId> <version>1.0version> <scope>systemscope> <systemPath>C:/Users/jun/respotory/com/jun/cloud/jun-opentsdb-client/1.0/jun-opentsdb-client-1.0.jarsystemPath> dependency>
问题:
maven 的
不过不推荐使用system,因为一个项目的pom.xml如果使用了scope为system的depend后,会导致传递依赖中断,即所有其他依赖本项目的项目都无法传递依赖了。
比如:假设A项目依赖了m.jar, n.jar, x.jar, 然后我们把A项目打包成了a.jar, 如果此时B项目依赖了A项目,则B项目通常自然就已经默认传递依赖了m.jar, n.jar, x.jar。但是如果A项目的pom.xml文件出现了scope为system的depend,则B项目就只能依赖a.jar, 将无法传递依赖m.jar, n.jar, x.jar
ps:
只适合很奇怪的场景下,先测试使用