我是Maven的新手。我试图在我的java/maven2mapdb文件中添加对org.mapdb的引用,但maven似乎无法从远程存储库下载pom.xml工件。
我所做的:第一件事:在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又有什么意义呢?
发布于 2017-06-13 17:58:58
最后,我可以下载mapdb包了。
只需移除
<type>bundle</type>依赖项声明中的标记。
https://stackoverflow.com/questions/44517634
复制相似问题