Skip to content

Instantly share code, notes, and snippets.

@umjammer
Last active January 13, 2024 10:09
Show Gist options
  • Save umjammer/ac94626baa3cb387100392e6ef817bd7 to your computer and use it in GitHub Desktop.
Save umjammer/ac94626baa3cb387100392e6ef817bd7 to your computer and use it in GitHub Desktop.
🚧 [Java] Uber Jar, Fat Jar, Shade, Jars in Jar

Uber Jar, Fat Jar, Shade, Jars in Jar

☘ extracted dependencies in jar

maven

merge properties

  • maven-assembly-plugin

in assmbly.xml

<containerDescriptorHandlers>
    <containerDescriptorHandler>
      <handlerName>metaInf-services</handlerName>
    </containerDescriptorHandler>
  </containerDescriptorHandlers>
  • maven-shade-plugin

in pom.xml

 <configuration>
  <transformers>
    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
  </transformers>

gradle

shadow has limit 65535 for extracted files, this is too few. -> specs

☘ jars in jar

we need special class loader for jars in jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment