无法将本地 Maven 工件安装到远程存储库 google-android-maps
我正在设置 Jenkins 构建环境来构建我的 android 项目。大部分情况下都可以,但是有一些依赖项在中央存储库中不可用,例如 Google Android Maps API,因此我需要手动将其安装到远程存储库。我已经使用 mvn install
将这些安装到我的本地存储库中,并且工作正常。
我已经完成了一些谷歌搜索,并且到目前为止具有以下配置,但是当我尝试将地图 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
应该如何工作?
I'm in the process of setting up a Jenkins build environment to build my android projects. For the most part its OK however there are some dependencies that are not available in the central repository, such as the Google Android Maps API, therefore I need to install it to my remote repository manually. I've got these install to my local repo using mvn install
and that works fine.
I've done some googling, and have the following configuration so far, but I'm seeing the following errors when I try to deploy the maps jar to my remote repo.
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/
and I see this :
[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
I've got the following in my 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>
Have I got something misconfigured, or am I completely misunderstanding how the deploy
should work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
错误消息看起来很简单。
您可以尝试部署文件并将其放置在其他位置吗?另外 此讨论似乎是关于同一问题并说明为什么会出现问题。
The error message seems straightforward.
Can you try deploying the file placing it in a different location? Also this discussion seems to be on the same problem and states why there is a problem.
将 Raghuram 的答案和 neu242 的评论放在一起就是我的解决方案。为了清楚起见:
Putting together Raghuram's answer and neu242's comment was the solution for me. For clarity's sake:
有几点需要尝试:
使用设置参数确保使用正确的设置文件,其中有多个具有层次结构的设置文件。
日志输出是否显示诸如上传 http://..... 的 URL 是否正确以及您所期望的内容?
使用 sonatype 前端手动上传它们是一种选择吗?
您的设置文件不应该也有一个服务器标签:
文档说“要映射到settings.xml下面的服务器ID”,所以我猜测如果没有匹配的服务器配置它就无法工作。
A couple of things to try:
Use the settings parameter to make sure the correct settings file is being used, there multiple ones with a hierarchy.
Does the log output say some thing like uploading http://..... is the URL correct and what you would expect it to be?
Is uploading them manually using the sonatype front end an option?
Shouldn't your settings file also have a server tag:
The docs say "Server Id to map on the under section of settings.xml" so I am guessing it will not work without a matching server configuration.