[WARNING] 'dependencies.dependency.systemPath' for


使用Maven打包时,总是会出现下面的 WARNING

[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.demo.abc:common:jar:1.1.0
[WARNING] 'dependencies.dependency.systemPath' for com.abc.toolbox:jar should not point at files within the project directory, ${basedir}/../lib/com.abc.toolbox-4.5.1.jar will be unresolvable by dependent projects @ line 21, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

产生的原因:

  引用了本地jar包导致

pom.xml

<dependency>
     <groupId>com.abc</groupId>
     <artifactId>toolbox</artifactId>
     <version>4.5.1</version>
     <scope>system</scope>
     <systemPath>${basedir}/../lib/com.abc.toolbox-4.5.1.jar</systemPath>
</dependency>

解决方法:

  将 basedir 修改为 pom.basedir

<dependency>
     <groupId>com.abc</groupId>
     <artifactId>toolbox</artifactId>
     <version>4.5.1</version>
     <scope>system</scope>
     <systemPath>${pom.basedir}/../lib/com.abc.toolbox-4.5.1.jar</systemPath>
</dependency>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM