GunaSekharM / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

mergeManifests fails when upstream apklib changes #343

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Setup: multi-module project with an 'app' apk that depends on an 'api' apklib. 
Use mergeManifests in the app pom.

Build will work successfully.

Add another intent-filter to the apklib manifest.

Build will fail with conflict.

Reason appears to be because the mergeManifests is changing the original 
AndroidManifest.xml in the app projects source tree.  Since it now has those 
elements in it, changes in the upstream are no longer able to be merged in.

IMHO, a bigger issue is that it is modifying the original AndroidManifest.  It 
should never alter it.

Original issue reported on code.google.com by mala...@playhaven.com on 3 Jan 2013 at 5:52

GoogleCodeExporter commented 9 years ago
My current workaround is to do this:

            <plugin>
                <groupId>com.github.goldin</groupId>
                <artifactId>copy-maven-plugin</artifactId>
                <version>0.2.5</version>
                <executions>
                    <execution>
                        <!-- Currently, there is a bug where mergeManifests is modifying the src/AndroidManifest.xml
                        Source files should never be altered. Bug report: http://code.google.com/p/maven-android-plugin/issues/detail?id=343 -->
                        <id>copy-AndroidManifest</id>
                        <phase>validate</phase>
                        <goals><goal>copy</goal></goals>
                        <configuration>
                            <failIfNotFound>false</failIfNotFound>
                            <resource>
                                <targetPath>${project.build.directory}</targetPath>
                                <directory>${project.basedir}/src</directory>
                                <include>AndroidManifest.xml</include>
                                <mkdir>true</mkdir>
                            </resource>
                            <verbose>true</verbose>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Then point to here instead:
<androidManifestFile>${project.build.directory}/AndroidManifest.xml</androidMani
festFile>

Original comment by mala...@playhaven.com on 24 Jan 2013 at 7:13

GoogleCodeExporter commented 9 years ago
Resolved (in 3.8.3) by https://github.com/jayway/maven-android-plugin/pull/275

Example config:
<sourceManifestFile>${project.basedir}/src/AndroidManifest.xml</sourceManifestFi
le>
<androidManifestFile>${project.build.directory}/AndroidManifest.xml</androidMani
festFile>

Original comment by malac...@gmail.com on 9 Feb 2014 at 3:34

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 22 Mar 2014 at 6:30