簡體   English   中英

Jar文件無法識別-缺少Maven工件

[英]Jar file not identifying - Maven artifact missing

依賴關系:

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

我收到以下錯誤。 它說: Unable to find resource 'org.apache.ibatis:ibatis-common:jar:2.0' in repository central (http://repo1.maven.org/maven2)
所以我嘗試使用命令安裝它,但仍然出現以下錯誤。 有人可以幫我嗎?

失蹤:

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找不到您指定的依賴項。
您可以指定存儲庫以獲取罐子。

添加依賴

<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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM