答案 0 :(得分:1)
也许您应该在依赖语句中使用maven存储库的直接链接?例如,在这里:
<!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib -->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
</dependency>
答案 1 :(得分:1)
您正在尝试为依赖项定义systemPath,但只允许使用 system scope
的依赖项。你必须:
systemPath
并使用(或配置)将从中下载依赖项的Maven存储库。如果您使用开源或公共依赖项,则默认情况下它们可能会在Central Maven repository上可用。
<dependency>
<groupId>com.someproject.foo</groupId>
<artifactId>foo-lib</artifactId>
<version>1.2.3/version>
<scope>system</scope>
<systemPath>...</systemPath>
</dependency>
如果您的依赖项是私有的或公司所有,我强烈建议您为您和您的团队配置Maven仓库,而不是使用系统依赖性。 Using system scope is deprecated:
系统依赖
重要提示:这已标记为已弃用。