Search code examples
javamavenearartifactory

Artifactory: Can I avoid embedded redundancies for War and Zip artifacts?


Let's consider the following scenario

  • foo-common is project which builds a 20mb jar (foo-common-0.0.1.jar)
  • foo-app1 is an application which embeds foo-common-0.0.1.jar in a zip artifact
  • foo-app2 is an application which embeds foo-common-0.0.1.jar in a war artifact
  • foo-common, foo-app1 and foo-app2 are all deployed to artifactory
  • foo-app1 and foo-app2 are managed by different teams and live in separate source repositories

This causes disk space issues on artifactory because all 3 artifacts include the 20mb foo-common-0.0.1.jar which ends up taking up 60mb space on disk.

Is there a smarter solution? Is there a way that foo-common, foo-app1 and foo-app2 can all live in artifactory without duplicating foo-common-0.0.1.jar? I'm thinking along the lines of artifactory being smarter and inspecting uploaded wars and zips for embedded jars which already exist in artifactory. Possibly by comparing file hashes or making use of maven dependency information.


Solution

  • No, there isn't currently a "smarter solution".

    Artifactory isn't a diff engine, binary or otherwise; it's an artifact repository. It doesn't rebuild or construct those artifacts "on-demand", it simply stores artifacts.