Skip to content

gmazzo/gradle-embedded-dependencies-plugin

Repository files navigation

GitHub Maven Central Gradle Plugin Portal Build Status Coverage Users

Contributors

gradle-embedded-dependencies-plugin

A Gradle plugin to embed dependencies (A.K.A. fat or uber jar) in the produced jar. It can optionally repackage the classes

Usage

Apply the plugin:

plugins {
  java
  id("io.github.gmazzo.dependencies.embedded") version "<latest>"
}

dependencies {
  embedded("org.apache.commons:commons-lang3:3.14.0")
}

Then the jar task will have the classes from org.apache.commons:commons-lang3:3.14.0 (and it won't be a dependency when published)

Repackaging and filtering

By default, the plugin will just copy the classes from the dependencies to the produced jar. If you want to repackage them, you can use the repackage option:

configurations.embedded {
    embedding {
        include("com.foo.**")
        exclude("com.bar.**")
        repackage("(org\\.apache\\.commons)\\.(.*)".toRegex(), "my.$1.repackaged.$2")
    }
}

About

A Gradle plugin to embed dependencies (A.K.A. `fat` or `uber` jar) in the resulting `jar` outcome

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages