[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