grape

[java] runable fat jar 만들기(johnrengelman/shadow) 본문

dev/java

[java] runable fat jar 만들기(johnrengelman/shadow)

grapelab 2023. 9. 1. 18:25

Setting

Gradle 6.8

Java 11

 

Gradle task -> jar

 

plugins {
    // Apply the java-library plugin for API and implementation separation.
    id 'java-library'
    id 'com.github.johnrengelman.shadow' version '6.1.0' // 추가한 코드
}

 

 

jar {

	enabled = false

    finalizedBy shadowJar // 추가한 코드

    manifest {
        attributes 'Main-Class': 'name.Main'
    }
}

 

Version

Gradle Shadow
5.x 5.2.0 - 6.0.0
6.x 5.2.0 - 6.1.0
7.x 7.0.0+
8.x 8.0.0+

 

 

reference

https://github.com/johnrengelman/shadow

 

GitHub - johnrengelman/shadow: Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applicati

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin. - GitHub - johnrengelman/shadow: Grad...

github.com

 

'dev > java' 카테고리의 다른 글

[java]gradle repositories add maven  (0) 2023.08.31
[eclipse] SSL debug LOG(VM arguments)  (0) 2023.08.30
[JAVA] Mac eclipse gradle version setting  (0) 2023.08.29
[JAVA] eclipse debug option  (0) 2023.08.28