Hi guys,
I would like to share a quick tip on how to solve class loading conflicts when both asm3 and asm4 libraries are on class path. Upstream projects usually solve this problem by bundling shaded versions of asm3/asm4, but due to "no bundled libraries" rule this trick cannot be used in Fedora. Our objectweb-asm3 package now provides shaded versions of all artifacts in this package (in addition to original ones). Only difference between original artifacts and our shaded artifacts is that all classes have been relocated from "org.objetweb.asm" to "org.objectweb.distroshaded.asm" package. gId:aId of these shaded artifacts is the same as gId:aId of their original counterparts, but they have classifier "distroshaded". So if upstream of your package bundles asm3 and unbundled version causes problems somewhere, then you can simply change the "org.objectweb.asm.*" imports in .java files and add proper deps/requires on shaded asm3 artifacts (e.g.: "asm:asm-all::distroshaded:").
Regards Michal
Il 05/12/2013 16:29, Michal Srb ha scritto:
Hi guys,
I would like to share a quick tip on how to solve class loading conflicts when both asm3 and asm4 libraries are on class path. Upstream projects usually solve this problem by bundling shaded versions of asm3/asm4, but due to "no bundled libraries" rule this trick cannot be used in Fedora. Our objectweb-asm3 package now provides shaded versions of all artifacts in this package (in addition to original ones). Only difference between original artifacts and our shaded artifacts is that all classes have been relocated from "org.objetweb.asm" to "org.objectweb.distroshaded.asm" package. gId:aId of these shaded artifacts is the same as gId:aId of their original counterparts, but they have classifier "distroshaded". So if upstream of your package bundles asm3 and unbundled version causes problems somewhere, then you can simply change the "org.objectweb.asm.*" imports in .java files and add proper deps/requires on shaded asm3 artifacts (e.g.: "asm:asm-all::distroshaded:").
Regards Michal -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
my apologize, if i don't understad your suggestion but with groovy/gradle we must use (only e.g.) groovyjarjarasm.asm.ClassWriter for avoid conflict with asm3 and asm >= 4 maven signature has no effects for gradle problems (at build/run time) or you want to create a new package e.g. objectweb-asm3-shaded ? regrads gil
On 12/05/2013 05:32 PM, puntogil@libero.it wrote:
my apologize, if i don't understad your suggestion but with groovy/gradle we must use (only e.g.) groovyjarjarasm.asm.ClassWriter for avoid conflict with asm3 and asm >= 4 maven signature has no effects for gradle problems (at build/run time) or you want to create a new package e.g. objectweb-asm3-shaded ? regrads gil
Well groovyjarjarasm.asm.ClassWriter is in groovy-all.jar. It is a jar which bundles all its dependencies and among them shaded asm3. AFAIK, we don't build this jar in Fedora. But for rest of the groovy jars you can replace all "org.objectweb.asm" strings in groovy 1.8.9 sources with "org.objectweb.distroshaded.asm" and instead of "build-jar-repository objectweb-asm3/asm-tree" use "build-jar-repository objectweb-asm3/asm-tree-distroshaded". groovy uses asm3 internally, so then you can put groovy jars together with their dependencies (distroshaded asm3) on classpath of some other project (which requires asm4) and there won't be any asm3/asm4 conflicts. At least not caused by groovy.
Regards Michal
-- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
On 12/05/2013 04:29 PM, Michal Srb wrote:
gId:aId of these shaded artifacts is the same as gId:aId of their original counterparts, but they have classifier "distroshaded".
Small fix here. Due to inter-module dependencies in objectweb-asm3 classifiers don't work very well. Shaded asm3 artifacts depend on non-shaded asm3 artifacts. So forget about classifiers. All shaded asm3 artifacts are now reachable through asm:asm{,-all,-analysis,-commons,-tree,-util,-xml}-distroshaded.
Michal
Regards Michal -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
java-devel@lists.fedoraproject.org