gradle-shadow-plugin

How to create Micronaut's fat-jar without shadow plugin?

最后都变了- 提交于 2021-01-27 17:20:01
问题 What started as a roadblock to setup a new Micronaut project with corporate repo, is now more about curiosity of how Embedded server is bootstrapped. I have a Micronaut CLI generated project with com.github.johnrengelman.shadow gradle plugin which works fine when I run the jar using- $ java -Dmicronaut.environments=E1 -jar build/appBundle/app.jar build.gradle - plugins { id "com.github.johnrengelman.shadow" version "5.0.0" } ... shadowJar { mergeServiceFiles() } When I replace shadow plugin

How to create Micronaut's fat-jar without shadow plugin?

自作多情 提交于 2021-01-27 17:15:47
问题 What started as a roadblock to setup a new Micronaut project with corporate repo, is now more about curiosity of how Embedded server is bootstrapped. I have a Micronaut CLI generated project with com.github.johnrengelman.shadow gradle plugin which works fine when I run the jar using- $ java -Dmicronaut.environments=E1 -jar build/appBundle/app.jar build.gradle - plugins { id "com.github.johnrengelman.shadow" version "5.0.0" } ... shadowJar { mergeServiceFiles() } When I replace shadow plugin

Gradle, shadowJar: use relocate inside task

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:11:31
问题 I have the following task: task myJar(type: Jar) { archiveName = 'myJar.jar' includeEmptyDirs = false destinationDir = rootProject.libsDir dependsOn compileJava manifest.attributes('Class-Path': '../lib/commons-lang-2.5.jar') into '/', { from compileJava.destinationDir include 'com/myCompany/project/util/order/**', 'com/myCompany/project/event/**', } } and I would like to relocate all classes from com/myCompany/project/event/** to com/myCompany/relocated/project/event/** (so that some apps

Shadow Plugin Gradle: What does mergeServiceFiles() do?

烈酒焚心 提交于 2019-12-04 17:51:34
问题 In my build.gradle file I need to add the line: shadowJar { mergeServiceFiles() } Otherwise the jar does not run properly. I wonder what this line does exactly? I use the Gradle plugin in Eclipse Luna. I create the jar on one Java project which depends on another one. 回答1: mergeServiceFiles is declared exactly here and its implementation is as follows: /** * Syntactic sugar for merging service files in JARs * @return */ public ShadowJar mergeServiceFiles() { try { transform

Shadow Plugin Gradle: What does mergeServiceFiles() do?

醉酒当歌 提交于 2019-12-03 10:38:30
In my build.gradle file I need to add the line: shadowJar { mergeServiceFiles() } Otherwise the jar does not run properly. I wonder what this line does exactly? I use the Gradle plugin in Eclipse Luna. I create the jar on one Java project which depends on another one. Opal mergeServiceFiles is declared exactly here and its implementation is as follows: /** * Syntactic sugar for merging service files in JARs * @return */ public ShadowJar mergeServiceFiles() { try { transform(ServiceFileTransformer.class); } catch (IllegalAccessException e) { } catch (InstantiationException e) { } return this; }