【问题标题】:org.mapdb and maven2 troubleorg.mapdb 和 maven2 的麻烦
【发布时间】:2017-06-13 09:35:18
【问题描述】:

我是 Maven 新手。我正在尝试在我的 java/maven2 pom.xml 文件中添加对 org.mapdb 的引用,但 maven 似乎无法从远程存储库下载 mapdb 工件。

我做了什么: 第一件事:在settings.xml中配置远程maven仓库

二:为maven配置代理设置

第三:将以下几行添加到我的 POM 文件中

<dependency>
    <groupId>org.mapdb</groupId>
    <artifactId>mapdb</artifactId>
    <version>3.0.4</version>
    <type>bundle</type>
</dependency>

我很确定代理和存储库相关的数据没问题:我可以在我的项目中下载任何其他依赖项,例如 org.osgi.core 或 junit。

构建失败并显示以下消息:

Downloading: http://repo1.maven.org/maven2/org/mapdb/mapdb/3.0.4/mapdb-3.0.4.bundle
[INFO] Unable to find resource 'org.mapdb:mapdb:bundle:3.0.4' in repository central (http://repo1.maven.org/maven2)
[INFO]     ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]     ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.mapdb:mapdb:bundle:3.0.4

  Try downloading the file manually from the project website.

  Then, install it using the command: 
  mvn install:install-file -DgroupId=org.mapdb -DartifactId=mapdb -Dversion=3.0.4 -Dpackaging=bundle -Dfile=/path/to/file

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

  Path to dependency: 
1) com.sirti.NOC.acc_gw:DB_writer:jar:0.0
2) org.mapdb:mapdb:bundle:3.0.4

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

for artifact: 
  com.sirti.NOC.acc_gw:DB_writer:jar:0.0

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

我已经尝试过手动浏览存储库,并且在http://repo1.maven.org/maven2/org/mapdb/mapdb/3.0.4/中看到了mapdb jar

当然,我可以手动下载并安装 jar,但如果必须这样做,使用 maven 有什么意义呢?

【问题讨论】:

    标签: java maven mapdb


    【解决方案1】:

    终于可以下载mapdb包了。

    只需要删除

    <type>bundle</type>
    

    来自依赖声明的标签。

    【讨论】:

      猜你喜欢
      • 2012-03-08
      • 2016-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多