Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Multiple libraries with different group but the same artifact name and version fails #125

Open karlwettin opened 7 years ago

karlwettin commented 7 years ago

Adding the the dependency

compile group: 'foo', name: 'api', version: '0.0.1'

will create file image/lib/api-0.0.1.jar

So if I add a second dependency such as

compile group: 'bar', name: 'api', version: '0.0.1'

will also create (overwrite) file image/lib/api-0.0.1.jar

So libs needs to be saved as group-name-version.jar rather than just name-version.jar. Alternatively prefix file names with something unique.

bjornmagnusson commented 7 years ago

I dont´t quite get the actual problem. What is actually failing? Do you have an example gradle buildscript which shows and demonstrates the issue?

karlwettin commented 7 years ago

Away from computer now, but I'll whip up an example for you if this doesn't explain it:

If a project contains multiple dependencies with the same artifact name and version (but different groups) then the docker image will only store one of these jars in /lib since they share the same file name. I.e. jars copied to /lib must also contain the group name.

karlwettin commented 6 years ago

Did you get what I mean?

bjornmagnusson commented 6 years ago

Think so. But having a hard time understanding the relation to this plugin. Sounds like an generic gradle issue. Can provide an buildscript?