I try to build the i-jetty webserver using maven-android-plugin.
I created a set of pom.xml files for this and I got the above error
building it. I first thought, that the error is because of some apklibs
contain the same references. So I copied all the sourcecode together in
one src dir and modified the relevant pom.xml but still get the same error.
I don't know which files are duplicate. I tried with 2.9.0-beta-1,
2.9.0-beta-2 and even built an 2.9.0-SNAPSHOT but nothing works. What
can I do to find my mistake ? Can I do something to help debugging ?
Thanks,
Lars
> --
> You received this message because you are subscribed to the Google Groups
> "Maven Android Developers" group.
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.
>
>
I already attached the pom.xml to the first post for the case that
i-jetty-server and i-jetty-ui sources are mixed to one single directory.
Here now comes the case for the original i-jetty directory structure.
This archive contains the needed poms and resources for i-jetty-server.
Simply extract in current i-jetty-SNAPSHOT.
Lars
I digged a bit deeper and found one problem:
All of the org.eclipse.jetty.jetty-*.jar s included from i-jetty contain
a file about.html containing the license. It seems that android's
ApkBuilder.java can not handle this. It thinks that files are duplicate.
Has someone an idea how to handle that issue best ?
Thanks, Lars
Not sure.. worst case you can patch the plugin code and add a new
option that allows to exclude files of certain name patterns from the
exploded dependencies..
Not even sure if that is not already there .. check out the plugin
options.
manfred
I found no option that does that - at least not in the maven-android-plugin.
Doing this would be very difficult. I attached a stacktrace to
illustrate that.
[ERROR] Cannot add resources from jar
com.android.sdklib.build.DuplicateFileException: Duplicate files at the
same path inside the APK
at
com.android.sdklib.build.ApkBuilder$JavaAndNativeResourceFilter.checkEntry(ApkBuilder.java:121)
at
com.android.sdklib.internal.build.SignedJarBuilder.writeZip(SignedJarBuilder.java:225)
at
com.android.sdklib.build.ApkBuilder.addResourcesFromJar(ApkBuilder.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
com.jayway.maven.plugins.android.phase09package.ApkBuilder.addResourcesFromJar(ApkBuilder.java:266)
at
com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:307)
at
com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:196)
at
com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:169)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
The last step that is controled by the maven-android-plugin is
com.jayway.maven.plugins.android.phase09package.ApkBuilder.addResourcesFromJar(ApkBuilder.java:266)
Here a whole jar file is handed over to google's SDK Tools, there the
depackaging takes place. The relevant class is:
com/android/sdklib/build/ApkBuilder.java. There some checks take place
(for duplicate files for example) and there are already some exceptions
from this (for example META-INF directory or .cvsignore files and so
on). Here would be the best place to handle this issue. But I think I
never get google to exclude "about.html" in their SDK.
The other, dirty way would be to de-jar every jar in
maven-andriod-plugin, look for about.html, exclude it and re-jar it and
then hand it over to google's ApkBuilder. Would a patch that does this
have a chance to get included ?
What do you think would be the best way ?
As a workaround I remove the about.html's from every relevant jar in my
local maven repository by hand at the moment.
Regards,
Lars
Heureka!
Finally I found it! There is indeed one option, which does what I need
in the maven-android-plugin.
<extractDuplicates>true</extractDuplicates>
does what I need.
Thank you!
Ha.. sweet. I thought I saw that problem and a solution for it before..
Eric Turley did you ever get this working I have the same problem.Thanks
--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.