如何在Maven上解除项目

Jul*_*ira 11 android maven

我正在尝试将文件安装到我的本地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
Run Code Online (Sandbox Code Playgroud)

我不确定错误是否因为正在跳过google-play-services,如果您这么认为,请帮助解除它.

Rya*_*art 7

据我所知,一个项目只有当它依赖的其他模块无法构建时才会被"禁止".这就是"先前失败"的含义.你需要回到第一次失败并修复它.


Rop*_*Rop 6

当您尝试多次将相同的发布版本(不是 *-SNAPSHOT)部署到存储库时,此错误消息出现在 maven 中。这通常是禁止的,以防止不可预测的构建。如果你想多次部署同一个版本,它需要是 -SNAPSHOT 版本。

我想在你的情况下也会发生同样的事情,当你安装文件并且文件已经存在并且不是 -SNAPSHOT 版本时。Maven 然后得出结论,安装将在任何重复尝试时再次失败,因此将其标记为“禁止”。

那么解决方案是将工件版本更改为 -SNAPSHOT 版本或增加到下一个发布版本 - 然后再次构建。


Jul*_*ira 5

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

PS:我遇到的另一个问题是我一直在使用PowerShell运行maven命令,但是存在某种不兼容性。

  • 您介意共享以前使用过的-Dfile参数和您使用过的那个参数吗? (2认同)