从 3.8.1 版开始,Maven 默认阻止外部 HTTP 存储库(请参阅https://maven.apache.org/docs/3.8.1/release-notes.html)
有没有办法禁用它或从这个规则中免除存储库?
在我的 Maven 项目中,我使用这样的自定义外部my-custom-externaljar:
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>
Run Code Online (Sandbox Code Playgroud)
我成功构建了我的项目,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 …Run Code Online (Sandbox Code Playgroud)