From 3112dc5f81d3c5fba3964a17cb73d2190a9db806 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 12 Jan 2021 12:27:04 +0100 Subject: [PATCH] Improve JMH Jar configuration --- gradle/spring-module.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gradle/spring-module.gradle b/gradle/spring-module.gradle index a617009c37..51b18007f8 100644 --- a/gradle/spring-module.gradle +++ b/gradle/spring-module.gradle @@ -1,5 +1,8 @@ apply plugin: 'org.springframework.build.compile' apply plugin: 'org.springframework.build.optional-dependencies' +// Uncomment the following for Shadow support in the jmhJar block. +// Currently commented out due to ZipException: archive is not a ZIP archive +// apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'me.champeau.gradle.jmh' apply from: "$rootDir/gradle/publications.gradle" @@ -8,10 +11,27 @@ dependencies { jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.25' jmh 'net.sf.jopt-simple:jopt-simple:4.6' } + jmh { duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE } +jmhJar { + // Uncomment the following for Shadow's Transformer support. + // mergeServiceFiles() + // append('META-INF/spring.handlers') + // append('META-INF/spring.schemas') + // append('META-INF/spring.tooling') + exclude 'LICENSE' + exclude 'THIRD-PARTY' + exclude 'META-INF/license.txt' + exclude 'META-INF/notice.txt' + exclude 'META-INF/DEPENDENCIES' + exclude 'META-INF/LICENSE*' + exclude 'META-INF/NOTICE' + exclude 'META-INF/THIRD-PARTY' +} + jar { manifest.attributes["Implementation-Title"] = project.name manifest.attributes["Implementation-Version"] = project.version