gpt4 book ai didi

java - Jar 文件无法识别 - Maven Artifact 丢失

转载 作者:行者123 更新时间:2023-12-01 15:38:29 25 4
gpt4 key购买 nike

依赖关系:

<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-common</artifactId>
<version>2.0</version>
<scope>main</scope>
</dependency>

并且我收到以下错误。它说:无法在存储库中央(http://repo1.maven.org/maven2)中找到资源“org.apache.ibatis:ibatis-common:jar:2.0”
所以我尝试使用命令安装它,但仍然收到以下错误。有人可以帮助我吗?

缺少:

1) org.apache.ibatis:ibatis-common:jar:2.0

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.ibatis -DartifactId=ibatis-common -Dversion=2.0 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.apache.ibatis -DartifactId=ibatis-common -Dversion=2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) sonatype:Struts2OfficeExpenses:war:1.0-SNAPSHOT
2) org.apache.ibatis:ibatis-common:jar:2.0

----------
1 required artifact is missing.

for artifact:
sonatype:Struts2OfficeExpenses:war:1.0-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

最佳答案

发生这种情况是因为 maven 找不到您指定的依赖项。
您可以指定存储库来获取 jar。

添加依赖

<dependency>
<groupId>com.ibatis</groupId>
<artifactId>ibatis2-common</artifactId>
<version>2.1.7.597</version>
</dependency>

添加存储库

<repositories>
<repository>
<id>appfuse-releases</id>
<name>AppFuse Releases</name>
<url>https://oss.sonatype.org/content/repositories/appfuse-releases</url>
</repository>
</repositories>

关于java - Jar 文件无法识别 - Maven Artifact 丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8474220/

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