maven - 无法将本地 Maven 人工制品安装到远程存储库 google-android-maps

标签 maven maven-3

我正在设置 Jenkins 构建环境来构建我的 android 项目。大多数情况下它可以,但是中央存储库中没有一些依赖项,例如 Google Android Maps API,因此我需要手动将其安装到我的远程存储库中。我已使用 mvn install 将这些安装到我的本地存储库中这工作正常。

我已经做了一些谷歌搜索,并且到目前为止有以下配置,但是当我尝试将 map jar 部署到我的远程存储库时,我看到了以下错误。

mvn deploy:deploy-file -DgroupId=com.google.android.maps -DartifactId=maps -Dversion=8_r1 -Dpackaging=jar -Dfile=C:\Users\James\.m2\repository\com\google\android\maps\maps\8_r1\maps-8_r1.jar -DrepositoryId=cloudbeesreleases -Durl=https://repository-myusername.forge.cloudbees.com/release/

我看到这个:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-deploy-plugin:2.5:deploy-file (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.450s
[INFO] Finished at: Sat Feb 18 17:01:06 GMT 2012
[INFO] Final Memory: 4M/92M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project standalone-pom: Cannot deploy artifact from the local repository: C:\Users\James\.m2\repository\com\google\android\maps\maps\8_r1\maps-8_r1.jar -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project standalone-pom: Cannot deploy artifact from the local repository: C:\Users\James\.m2\repository\com\google\android\maps\maps\8_r1\maps-8_r1.jar
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: Cannot deploy artifact from the local repository: C:\Users\James\.m2\repository\com\google\android\maps\maps\8_r1\maps-8_r1.jar
    at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:211)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR] 
[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/MojoFailureException

我的 settings.xml 中有以下内容
<profiles>
    <profile>
      <id>artifactory</id>
      <repositories>
        <repository>
          <id>cloudbeesreleases</id>
          <name>libs-releases</name>
          <url>https://repository-myusername.forge.cloudbees.com/release/</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>        
      </repositories>      
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>

我是否配置错误,或者我完全误解了 deploy应该管用?

最佳答案

错误消息似乎很简单。

Cannot deploy artifact from the local repository:...



您可以尝试将文件部署到不同的位置吗?还有 this discussion似乎是在同一个问题上,并说明为什么会出现问题。

关于maven - 无法将本地 Maven 人工制品安装到远程存储库 google-android-maps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9343192/

相关文章:

packaging - Maven 默认的打包类型有哪些?

java - Maven : Unable to get Property Value from Proprties file

postgresql - 用于 postgres 的 liquibase maven 插件生成的 databasechangelog 的插入查询中区分大小写的列名

java - 我是 Maven 新手,有更好的方法来搜索原型(prototype)吗?

java - 在 Intellij 中传递配置文件属性

java - Maven Java Fx 示例无法运行 - 不重复

java - Maven 3.1.0 破坏了 Google App Engine Maven 插件

java - Maven 抛出错误 : No plugin found for prefix 'assembly' in the current project and in the plugin groups

maven - 将 kotlinx-html-js 添加到 intellij 中的 kotlin/js 项目

java - DDD 项目的 Maven 模块布局