But for reason I don’t know generated war contains two unlisted in dependencies libs: asm-3.1.jar and cglib-2.2.1-v20090111.jar And when using maven configured with the same dependencies this libs aren’t present in war file.
Hard to say. Given the POMs of ‘guice’ and ‘cglib’, I see no reason not to include ‘cglib’ and ‘asm’. Maybe the Maven build selects a different version of ‘guice’ (conflict resolution works differently in Maven). If you don’t want ‘cglib’ and ‘asm’, you can always exclude them in the build script.
We just run into the same problem. The guice pom has a profile named “guice.with.jarjar”. When this profile is active (default), the cglib dependency is optional. Gradles maven dependency resolver seems to ignore this. When you run a maven project with the guice dependency and deactivate the profile
That’s correct. Gradle doesn’t currently honor Maven profiles when resolving. (It’s strongly discouraged to have profiles in published POMs, even in Maven land.) I’m pretty sure there is a JIRA for it, though. I think that supporting the default profile would be a good step forward.