国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
maven集成eclipse android項目辦法總結

maven集成eclipse android項目辦法總結  

1.安裝m2eclipse-android-integration

https://svn.codespot.com/a/eclipselabs.org/m2eclipse-android-integration/updates/m2eclipse-android-integration/

其實這個不需要安,不過下面的是必須要安裝的。

安裝maven-android-sdk-deployer

https://github.com/mosabua/maven-android-sdk-deployer

下載完后,執(zhí)行:

Java代碼   
  1. cd mosabua-maven-android-sdk-deployer-df824df  
  2. mvn clean install  
  3.   
  4. #可選擇安裝:  
  5. mvn install -P  1.5   
  6. mvn install -P  1.6   
  7. mvn install -P  2.1   
  8. mvn install -P  2.2   
  9. mvn install -P  2.3 . 3   
  10. mvn install -P  3.0   
  11. mvn install -P  3.1   
  12. mvn install -P  3.2   
  13. mvn install -P  4.0   
  14. mvn install -P  4.0 . 3   

 如果報錯,說明sdk沒有安裝完整(google api等等),要在android sdk manager里面下載完整,

如果運行正常的話,這一步操作就是將sdk的包放入到svn的本地倉庫里了。

2.Create Eclipse project

If you already have an Android project please make sure you have created a POM for your project using version 3.0.0 or greater of the maven-android-plugin.

Then right-click on your project and select Configuration -> Convert to Maven Project.

If you are starting with a new project you can use the Maven Android archetypes to create Android projects completely within Eclipse:

Create a new Maven Project (File -> New -> Project... then select Maven -> Maven Project).

When prompted to Select Archetype click Add Archetype...

In the dialog that appears enter "de.akquinet.android.archetypes" for Archetype Group Id.

In Archetype Artifact Id enter "android-quickstart".

In Archetype Version enter "1.0.8" and continue.

When prompted enter your desired project group and artifact ID, version and, optionally, set the "platform" property for the Android version (defaults to '10').

Click Finish

Right-click on new project and select Maven -> Update Project Configuration.

3.Install Android Connector

Windows->Preferences->Maven->Discovery->Open Catalog->安裝m2e connector for android

4.至此新建的項目應該不會再報錯了。

5.配置maven插件,自動打包簽名,附上我的完整的pom:

Xml代碼   
  1. < project   xmlns = "http://maven.apache.org/POM/4.0.0"   xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"   
  2.           xsi:schemaLocation ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >  
  3.      < modelVersion > 4.0.0 </ modelVersion >   
  4.      < groupId > com.olivephone </ groupId >   
  5.      < artifactId > olive-browser </ artifactId >   
  6.      < version > 1.0.10 </ version >   
  7.      < packaging > apk </ packaging >   
  8.      < name > olive-browser </ name >   
  9.       
  10.      < properties >   
  11.          < platform.version > 2.2.1 </ platform.version >   
  12.      </ properties >   
  13.       
  14.      < dependencies >   
  15.          < dependency >   
  16.              < groupId > com.google.android </ groupId >   
  17.              < artifactId > android </ artifactId >   
  18.              < version > ${platform.version} </ version >   
  19.              < scope > provided </ scope >   
  20.          </ dependency >   
  21.          < dependency >   
  22.              < groupId > com.google.android </ groupId >   
  23.              < artifactId > support-v4 </ artifactId >   
  24.              < version > r7 </ version >   
  25.          </ dependency >   
  26.          < dependency >   
  27.              < groupId > commons-io </ groupId >   
  28.              < artifactId > commons-io </ artifactId >   
  29.              < version > 2.0.1 </ version >   
  30.          </ dependency >   
  31.          < dependency >   
  32.              < groupId > org.apache.commons </ groupId >   
  33.              < artifactId > commons-lang3 </ artifactId >   
  34.              < version > 3.1 </ version >   
  35.          </ dependency >   
  36.          < dependency >   
  37.              < groupId > org.jsoup </ groupId >   
  38.              < artifactId > jsoup </ artifactId >   
  39.              < version > 1.6.1 </ version >   
  40.          </ dependency >   
  41.          < dependency >   
  42.              < groupId > com.google.android </ groupId >   
  43.              < artifactId > libGoogleAnalytics </ artifactId >   
  44.              < version > 1.0 </ version >   
  45.          </ dependency >   
  46.      </ dependencies >   
  47.           
  48.      < build >   
  49.          < plugins >   
  50.              < plugin >   
  51.                  < groupId > com.jayway.maven.plugins.android.generation2 </ groupId >   
  52.                  < artifactId > android-maven-plugin </ artifactId >   
  53.                  < version > 3.1.1 </ version >   
  54.                  < configuration >   
  55.                      < androidManifestFile > ${project.basedir}/AndroidManifest.xml </androidManifestFile >   
  56.                      < assetsDirectory > ${project.basedir}/assets </ assetsDirectory >   
  57.                      < resourceDirectory > ${project.basedir}/res </ resourceDirectory >   
  58.                      < nativeLibrariesDirectory > ${project.basedir}/src/main/native </nativeLibrariesDirectory >   
  59.                      < sdk >   
  60.                          < platform > 8 </ platform >   
  61.                      </ sdk >   
  62.                      < undeployBeforeDeploy > true </ undeployBeforeDeploy >   
  63.                  </ configuration >   
  64.                  < extensions > true </ extensions >   
  65.              </ plugin >   
  66.   
  67.              < plugin >   
  68.                  < artifactId > maven-compiler-plugin </ artifactId >   
  69.                  < version > 2.3.2 </ version >   
  70.                  < configuration >   
  71.                      < source > 1.6 </ source >   
  72.                      < target > 1.6 </ target >   
  73.                      < encoding > UTF8 </ encoding >   
  74.                  </ configuration >   
  75.              </ plugin >   
  76.               
  77.              < plugin >   
  78.                  < groupId > org.apache.maven.plugins </ groupId >   
  79.                  < artifactId > maven-jarsigner-plugin </ artifactId >   
  80.                  < version > 1.2 </ version >   
  81.                  < executions >   
  82.                    < execution >   
  83.                      < id > sign </ id >   
  84.                      < goals >   
  85.                        < goal > sign </ goal >   
  86.                      </ goals >   
  87.                    </ execution >   
  88.                    < execution >   
  89.                      < id > verify </ id >   
  90.                      < goals >   
  91.                        < goal > verify </ goal >   
  92.                      </ goals >   
  93.                    </ execution >   
  94.                  </ executions >   
  95.                  < configuration >   
  96.                      < encoding > UTF-8 </ encoding >   
  97.                      < includes >   
  98.                              < include > target/${artifactId}.apk </ include >   
  99.                              </ includes >      
  100.                              < removeExistingSignatures > true </ removeExistingSignatures >   
  101.                              < keystore > ${keyFilePath} </ keystore >   
  102.                      < storepass > ${storePassword} </ storepass >   
  103.                      < keypass > ${keyPassword} </ keypass >   
  104.                      < alias > ${keyAlias} </ alias >   
  105.                  </ configuration >   
  106.              </ plugin >   
  107.                 
  108.          < plugin >   
  109.                   < groupId > org.codehaus.mojo </ groupId >   
  110.                   < artifactId > exec-maven-plugin </ artifactId >   
  111.                   < version > 1.2.1 </ version >   
  112.                   < executions >   
  113.                       < execution >   
  114.                           < id > zipalign </ id >   
  115.                           < goals >   
  116.                               < goal > exec </ goal >   
  117.                           </ goals >   
  118.                           < phase > install </ phase >   
  119.                           < configuration >   
  120.                               < executable > ${ANDROID_HOME}/tools/zipalign </ executable >  
  121.                                < arguments >   
  122.                                   < argument > -f </ argument >   
  123.                                   < argument > 4 </ argument >   
  124.                                   < argument > target/${project.build.finalName}.apk </ argument >  
  125.                                   < argument > target/${project.build.finalName}-zipped.apk </argument >   
  126.                               </ arguments >   
  127.                           </ configuration >   
  128.                       </ execution >   
  129.                   </ executions >   
  130.          </ plugin >   
  131.          </ plugins >    
  132.      </ build >   
  133.       
  134. </ project >   
 

setting.xml

Xml代碼   
  1. < settings   xmlns = "http://maven.apache.org/POM/4.0.0"   
  2. xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"   
  3. xsi:schemaLocation ="http://maven.apache.org/POM/4.0.0  
  4.                                http://maven.apache.org/xsd/settings-1.0.0.xsd" >   
  5.   
  6. <!-- add by peirenlei here one line-->   
  7. < localRepository > D:/3rdlib/java/m2/repository </ localRepository >   
  8.   
  9. < profiles >   
  10.      < profile >   
  11.          < id > sign </ id >   
  12.          < activation >   
  13.              < activeByDefault > true </ activeByDefault >   
  14.          </ activation >   
  15.          < properties >   
  16.              < keyFilePath > E:/MyDocument/xxxx.keystore </ keyFilePath >   
  17.              < storePassword > 就不告訴你 </ storePassword >   
  18.              < keyPassword > 就不告訴你 </ keyPassword >   
  19.              < keyAlias > 就不告訴你 </ keyAlias >   
  20.          </ properties >   
  21.      </ profile >   
  22.   
  23. </ profiles >   
  24. < activeProfiles >   
  25.     < activeProfile > sign </ activeProfile >   
  26. </ activeProfiles >   
  27.   
  28. </ settings >   
 

特別提醒:

1.<removeExistingSignatures>true</removeExistingSignatures>這個一定要配上,我之前參考網(wǎng)上的都沒有這一項,結果就是簽名的apk里面有兩個簽名,一個是自己的一個是android debug的,so...

2.記住源代碼的路徑要更改為:src/main/java,否則在package的時候會抱錯,并且就算不抱錯,打好的包在真機上也運行不了,謹記,為這個事情,我折磨了一整天。

6.配置這這一切,接下來就是爽歪歪的時候了: 

Java代碼   
  1. mvn clean  package   

 進入target目錄,看到的mvndemo-1.0.9.apk就是已經(jīng)簽過名的apk,怎么?不相信,自己看看:

Java代碼   
  1. jarsigner -verify -verbose -certs "F:\workspace\android_workspace\mvndemo\target\mvndemo-1.0.9.apk"   
 

看到?jīng)]?打印出來的信息里,是不是有自己的簽名信息。

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
maven常用命令介紹
maven2 (二) SCM
maven 簡單實用教程 - Open source of memory - JavaEy...
Maven下,spring+struts2+ibatis整合
Maven使用常見問題
maven常用命令
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服