maven install 程序包不存在

来源:互联网 发布:网络借贷平台监管办法 编辑:程序博客网 时间:2024/06/06 03:20

大家通常会在自己的一个项目中依赖另外一个项目,最简单的方式就是把依赖的项目(A项目)install到本地maven库,然后在新项目(B项目)中通过dependency引用。

我这里遇到一个奇葩问题,A项目成功install到本地maven库了,B项目引用没问题,run也没有问题,但是我再把B项目install的时候却报找不到A项目的程序包,百度了好多,大家都说是jdk版本问题,我都看了无数遍jdk设置,把maven配置文件中的jdk版本也设置了,installed jre也设置成jdk了,设置如下:

  <profile>      <id>jdk8</id>      <activation>          <activeByDefault>true</activeByDefault>          <jdk>1.8</jdk>    </activation>      <properties>          <maven.compiler.source>1.8</maven.compiler.source>          <maven.compiler.target>1.8</maven.compiler.target>          <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>      </properties>     </profile></profiles>    <activeProfiles><activeProfile>jdk8</activeProfile>  </activeProfiles>


然而仍然不行。后来灵机一动,是不是我的两个项目parent不同造成的,A赖项目parent是视频spring-boot-starter-parent,而B项目的parent是我自己的parent项目,于是吧A项目的parent也改成自己的parent,B项目就可以install了

但是目前我没想出是为什么,有知道原因的小伙伴不防告诉我一声

0 0
原创粉丝点击