07-02 03:26
Notice
Recent Posts
Recent Comments
07-02 03:26
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Archives
Today
Total
관리 메뉴

pear

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

dev/java

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

pearlab 2023. 8. 23. 17:18

 

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][sprintboot] Sprint Boot Rest API not found error  (0) 2023.12.12
gradle repositories add maven  (0) 2023.04.06
[eclipse] SSL debug LOG  (0) 2023.03.29
[JAVA] Mac eclipse gradle version setting  (0) 2022.11.11
[JAVA] debug option  (0) 2022.08.26