一般情況下,如何解決未在maven回購庫中找到的資源,是否有另一個可以添加到的回購列表pom.xml?我嘗試了列爲命令行的解決方案,但它沒有起作用,儘管maven將其報告爲SUCCESS。無法在存儲庫中心找到資源(http://repo1.maven.org/maven2)
I tried to build test-analytics, but got error:
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
Downloading: http://repo1.maven.org/maven2/com/google/code/gwt-dnd/gwt-dnd/3.1.1/gwt-dnd-3.1.1.pom
[INFO] Unable to find resource 'com.google.code.gwt-dnd:gwt-dnd:pom:3.1.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/com/google/code/gwt-dnd/gwt-dnd/3.1.1/gwt-dnd-3.1.1.jar
[INFO] Unable to find resource 'com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -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.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.google.testing.testify.risk.frontend:test-analytics:war:1.0-SNAPSHOT
2) com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1
----------
1 required artifact is missing.
for artifact:
com.google.testing.testify.risk.frontend:test-analytics:war:1.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Nov 18 21:24:23 EST 2012
[INFO] Final Memory: 16M/238M
[INFO] ------------------------------------------------------------------------
這是命令和錯誤:您需要了解如何在你的POM文件配置repositories部分
mvn deploy:deploy-file -DgroupId=com.google.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -Dpackaging=jar -Dfile=gwt-dnd-3.1.1.jar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'deploy'.
[INFO] ------------------------------------------------------------------------
[INFO] Building test-analytics
[INFO] task-segment: [deploy:deploy-file] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for 'deploy:deploy-file'
[0] Inside the definition for plugin 'maven-deploy-plugin' specify the following:
<configuration>
...
<url>VALUE</url>
</configuration>
-OR-
on the command line, specify: '-Durl=VALUE'
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Nov 20 14:10:37 EST 2012
[INFO] Final Memory: 14M/238M
[INFO] ------------------------------------------------------------------------
所以這是我做的。 下載了gwt-dnd-3.1.1.jar,並將其放在與pom.xml相同的級別,並運行命令: sudo mvn install:install-file -DgroupId = com.google.code.gwt-dnd -DartifactId = gwt-dnd -Dversion = 3.1.1 -Dpackaging = jar -Dfile = gwt-dnd-3.1.1.jar result = BUILD SUCCESSFUL 現在我該怎麼辦?我仍然沒有戰爭文件,或任何可執行文件實際上運行在../target – kamal
應用程序我不認爲它需要旁邊的pom.xml。 。 。另外,請確認它已安裝到本地存儲庫中;你可以簡單地通過查找來做到這一點。m2/repository/my/maven/groupId/As/Directory/Structure/myArtifact – chad
+1,用於對Maven中關鍵概念的精確闡述。 – Withheld