gpt4 book ai didi

maven - 添加本地外部 jar - 不应指向项目目录中的文件

转载 作者:行者123 更新时间:2023-12-03 15:06:56 26 4
gpt4 key购买 nike

在我的 Maven 项目中,我使用自定义外部 my-custom-external像这样的 jar :

pom.xml

<dependencies>
<dependency>
<groupId>com.myproject</groupId>
<artifactId>my-custom-external</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/my-custom-external-1.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>

我成功构建了我的项目 mvn verify但在控制台中我有警告:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.myproject:prj_1:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.myproject:my-custom-extneral:jar should not point at files within the project directory, ${project.basedir}/libs/my-custom-extneral-1.0-SNAPSHOT.jar will be unresolvable by dependent projects @ line 62, 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]

最佳答案

您可以使用 ${pom.basedir} 替换 ${project.basedir}

关于maven - 添加本地外部 jar - 不应指向项目目录中的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55183286/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com