Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install a local maven artefact to remote repository, google-android-maps

Tags:

maven

maven-3

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?

like image 316
Jimmy Avatar asked Feb 18 '12 17:02

Jimmy


2 Answers

The error message seems straightforward.

Cannot deploy artifact from the local repository:...

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.

like image 190
Raghuram Avatar answered Oct 05 '22 04:10

Raghuram


Putting together Raghuram's answer and neu242's comment was the solution for me. For clarity's sake:

cp ~/.m2/repository/path/to/jar/api-1.0-SNAPSHOT.jar /tmp/.
mvn deploy:deploy-file -DgroupId=com.mygroup -DartifactId=api -Dversion=1.0-SNAPSHOT -Durl=file:./local-maven-repo/ -DrepositoryId=local-maven-repo -DupdateReleaseInfo=true -Dfile=/tmp/api-1.0-SNAPSHOT.jar -Dpackaging=jar
like image 40
kraxor Avatar answered Oct 05 '22 03:10

kraxor