2010-07-15 47 views
2

我已經將一些工件添加到本地Nexus Maven存儲庫中。
當我建立我的項目,我得到以下錯誤:Maven在下載快照工件時將'-windows'添加到工件名稱

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building pronto-web Java EE 6 Webapp
[INFO] task-segment: [verify]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Source\Pronto\pronto\pronto-web\target\classes
[INFO] [antrun:run {execution: remove-javax}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [gwt:compile {execution: default}]
[INFO] using GWT jars from project dependencies : 20100714-SNAPSHOT
[WARNING] You should not declare gwt-dev as a project dependency. This may introduce complex dependency conflicts
Downloading: http ://mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] artifact not found - Unable to locate resource in repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-dev -Dversion=20100714-20100715.053026-1 -Dclassifier=windows -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.gwt -DartifactId=gwt-dev >-Dversion=20100714-20100715.053026-1 -Dclassifier=windows -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

com.google.gwt:gwt-dev:jar:20100714-20100715.053026-1

from the specified remote repositories:
releases (http://mercury:8980/nexus/content/groups/public),
all (http://mercury:8980/nexus/content/groups/all),
snapshots (http://mercury:8980/nexus/content/groups/public-snapshots)

http ://mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Thu Jul 15 08:57:29 CEST 2010
[INFO] Final Memory: 50M/614M
[INFO] ------------------------------------------------------------------------

有沒有人一個想法,爲什麼行家認爲應該有「-windows」添加到神器的名字嗎?(下載:http:// mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar)

如果我瀏覽存儲庫,它包含工件,但沒有'-windows'後綴。

該工件的舊版本依賴於平臺,並具有'windows'或'linux'或'mac'作爲分類器,但最新版本與平臺無關,我的poms中沒有任何這樣的分類器。

PS: 我在協議和冒號之間的每個URL中都加了一個空格,因爲我還沒有收到足夠的信譽來發布鏈接。

+0

嘗試運行mvn -U - 也許maven依賴於舊的快照POM。在你的情況下,「窗口」可能是一個分類器,它必須在你的POM中進行配置,仔細分析它們。 – lexicore 2010-07-15 07:28:56

回答

3

以下的依賴,必須聲明的地方,很可能作爲一個傳遞依賴:

<dependency> 
    <groupId>com.google.gwt</groupId> 
    <artifactId>gwt-dev</artifactId> 
    <version>20100714-SNAPSHOT</version> 
    <classifier>windows</classifier> 
<dependency> 

我懷疑一個壞POM如果文物不依賴於平臺了。

有沒有更近期的快照可以使用?

+0

謝謝帕斯卡爾和Lexicore的快速回復。 我相信在部署到存儲庫的工件中或者在我的項目pom中(僅在公共存儲庫中的某些較早版本中),從來沒有這樣的classifiere元素。 我刪除了我的本地.m2目錄中的com/google子目錄,以防萬一,現在問題消失了。 也許我應該重新命名它,讓它可供進一步調查,但沒想到這真的解決了這個問題。 – user285085 2010-07-15 08:37:59

+1

經過一些maven配置更改後,工件更新並切換到Maven 3,我再次出現此錯誤。清除.m2目錄此時不起作用。 看來,gwt-maven-plugin導致了這個錯誤。 我將它從1.2更新爲1.3-SNAPSHOT,現在錯誤再次消失。 – user285085 2010-07-15 12:39:02

+0

@devde:比較兩個插件版本的poms會很有趣。但無論如何,這很奇怪。也許你應該發表評論作爲答案並接受它。 – 2010-07-15 19:46:20

相關問題