2017-01-22 519 views
2

我在Netbeans有一個maven web項目。 這些都是在pom.xml無法下載spring-web和spring-webmvc依賴關係

<dependencies> 

    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-web-api</artifactId> 
     <version>7.0</version> 
     <scope>provided</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>4.3.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-beans</artifactId> 
     <version>4.3.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>4.3.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>4.3.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>4.3.5.RELEASE</version> 
    </dependency> 

</dependencies> 

依賴當我選擇下載聲明依賴性依賴它下載一切除了彈簧網絡4.3.5.RELEASE.jar彈簧webmvc-4.3.5.RELEASE.jar。每次我做它停止在4%,它說它已完成。

+0

那麼我最終通過mozilla下載它們並手動安裝罐子。不過我不明白他們沒有下載,我試圖重新啓動netbeans和互聯網連接。奇怪 – Maver

+0

Maven檢查是否必須再次下載'jar',因爲可能修復了一個錯誤。因此Maven會比較本地文件和遠程文件的散列值。如果哈希匹配,他認爲沒有任何變化。散列比較可能需要4%。 –

+2

嘗試從Maven本地存儲庫中刪除目錄org/springframework/spring-web和org/springframework/spring-webmvc,然後在您的項目中重新啓動maven install。 –

回答

1

我面臨同樣的問題。只需刪除在您家中創建的.m2文件夾(在Windows中爲c:\ Users \ user.m2)。並更新項目。

如果這不起作用,請參閱此鏈接。 Problems using Maven and SSL behind proxy

+0

它有時會發生,這解決了同一個問題前幾次 –

+0

嗨安東尼,現在它工作嗎?你是否超越代理工作? –

+0

嗨,我不是OP,我只是說它發生在我身上一次。而且我完全無視你在說什麼來解決我的問題。我在說你的解決方案很好,而OP應該首先嚐試。 –