16

我正在尝试将文件安装到我的本地 Maven 存储库(按照https://gist.github.com/4211293中的步骤),但是,我总是收到以下错误消息:

    PS C:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib> mvn install:install-file  -DgroupId=com.google.android.gms -DartifactId=google-play-services-jar -Dversion=4 -Dpackaging=jar -Dfile=.\libs\google-play-services.jar
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building google-play-services 4
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ google-play-services ---
    [INFO] Installing C:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib to C:\Users\Juliano\.m2\repository\com\google-play-services-jar\4\google-play-services-jar-4.jar
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Skipping google-play-services
    [INFO] This project has been banned from the build due to previous failures.
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.534s
    [INFO] Finished at: Mon Dec 24 00:05:04 BRST 2012
    [INFO] Final Memory: 6M/89M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project google-play-services: Error installing artifact 'com:google-play-services-jar:jar': Failed to install artifact com:google-play-services-jar:jar:4: C:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib
    (Access is denied) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我不确定这个错误是否是因为 google-play-services 被跳过了,如果你认为是这样,请帮助解禁它。

4

4 回答 4

9

据我所知,一个项目只有在它所依赖的其他模块未能构建时才会以这种方式被“禁止”。这就是“以前的失败”的含义。您需要回到第一个故障并修复它。

于 2012-12-24T03:44:01.407 回答
9

问题解决了。该错误与 -Dfile 参数有关,因为它似乎不接受相对路径。

PS: Another problem I had was that I've been using PowerShell to run maven commands but there's some kind of incompatibility.

于 2012-12-24T09:44:06.093 回答
6

This error msg appears in maven, when you try to deploy the same release-version (not *-SNAPSHOT) to repository multiple times. That is generally forbidden, to prevent unpredictable builds. If you want to deploy the same version multiple times it needs to be -SNAPSHOT version.

I guess the same thing happens in your case, when you do install-file and the file already exists and is not a -SNAPSHOT version. Maven then concludes the install will fail again on any repeated attempts and therefore marks it as "banned".

Solution then, is to change artifact version to a -SNAPSHOT version or increase to next release-version - then build again.

于 2013-06-14T08:46:02.633 回答
0

Problem:- If you are deploying your artifact with maven deploy plugin using "deploy-file" goal and error "this project has been banned from the build due to previous failures" occurs then following below is the solution.

Solution:- 1) make sure all required parameters are valid. so check for white space.

2) -Dfile=target/artifactid is generated and found at correct place.

3) Durl=http://localhost:8081/nexus/repo have correct access.

Cheers

于 2018-01-27T08:27:49.583 回答