2012-09-21 43 views
5

在ADT 20.0.0(鏈接自here)中,添加了manifestmerger屬性(將庫項目的清單包含到應用程序項目中)。是否有可能在Maven構建中啓用此屬性?如果是,如何?Android maven - manifestmerger屬性

回答

2

the pull request which added the feature提供一個確切的答案:

<plugin> 
    <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
    <artifactId>android-maven-plugin</artifactId> 
    <configuration> 
     <!-- add the following mergeManifests option --> 
     <mergeManifests>true</mergeManifests> 
    </configuration> 
</plugin> 
+0

爲我工作,謝謝 – dleerob

+0

注意這是APKLIB合併,而不是AAR。 – William

0

以上答案上班的時候包括APKLIB的清單。

但是APKLIBs是AAR的前身,它是Android的當前庫包裝標準。

合併來自AAR體現使用以下命令:

<plugin> 
    <groupId>com.simpligility.maven.plugins</groupId> 
    <artifactId>android-maven-plugin</artifactId> 
    <configuration> 
     <manifestMergeLibraries>true</manifestMergeLibraries> 
    </configuration> 
</plugin> 

http://simpligility.github.io/android-maven-plugin/manifest-merger-mojo.html