2017-06-13 88 views
0

我是Maven的新手。我試圖在java/maven2 pom.xml文件中添加對org.mapdb的引用,但maven似乎無法從遠程存儲庫下載mapdb工件。org.mapdb和maven2麻煩

我所做的: 第一件事:在settings.xml中配置的遠程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) 

我已經嘗試過手動瀏覽存儲庫,我已經看到創建mapdb在http://repo1.maven.org/maven2/org/mapdb/mapdb/3.0.4/

當然罐子,我可以手動下載並安裝JAR ,但是如果我必須這樣做,使用maven有什麼意義呢?

回答

0

最後,我已經能夠下載mapdb軟件包。

只有不得不刪除從依賴聲明

<type>bundle</type> 

標籤。

+0

我還在想爲什麼.... – jazzter