I originally found Nico’s advice https://github.com/nicokruger/android-maven-phonegap/issues/1 as I was browsing to find a maven repository hosting the phonegap .jar file.
While this put me on the path to adding the jar to my local repository, I ran in to all sorts of issues (Maven newbie here) with errors such as:
- [Error]…Goal requires a project to execute but there is no POM in this directory (Tried adding -DgeneratePom=true to the command line, but this didn’t help)
- [Error]…The packaging for this project did not assign a file to the build artifact
After working through the issues, I came up with these steps to install. However, when I look at my local .m2 repository I only see the pom file created below; no jar file is present.
Thanks!
Environment
- Windows 7
- Apache Maven 3.0.4
- Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Steps (Modified: These are the correct steps now. Thanks to Ryan)
-
Download phonegap 1.7.0 from http://phonegap.com/download
-
Extract to temp folder
-
Navigate to: temp/phonegap-phonegap-475bfd2/lib/android
-
Execute the following at a command prompt:
mvn install:install-file -Dfile=cordova-1.7.0.jar -DgroupId=org.apache.cordova -DartifactId=phonegap -Dversion=1.7.0 -Dpackaging=jar -
Phonegap (cordova-1.7.0.jar) should now be installed in your local Maven repository
-
In your project pom, add the following to your POM file:
<dependency> <groupId>org.apache.cordova</groupId> <artifactId>phonegap</artifactId> <version>1.7.0</version> </dependency>
Drop the pom and use the install-file goal instead, like this: