Skip to content

Commit 94f924f

Browse files
authored
Merge pull request #3097 from schaefa/issue/manifest-mf.order
Ensured that the MANIFEST.MF files is the first entry in the JAR File
2 parents 20dd35b + de2f8b4 commit 94f924f

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,27 @@ Import-Package: !com.google.*,!org.checkerframework.*,!javax.annotation.*,!graph
160160
}
161161

162162

163-
task removeNotNeededGuava(type: Zip) {
163+
task extractWithoutGuava(type: Copy) {
164164
from({ zipTree({ "build/libs/graphql-java-${project.version}.jar" }) }) {
165165
exclude('/com/**')
166166
}
167+
into layout.buildDirectory.dir("extract")
168+
}
169+
170+
task buildNewJar(type: Jar) {
171+
from layout.buildDirectory.dir("extract")
167172
archiveFileName = "graphql-java-tmp.jar"
168173
destinationDirectory = file("${project.buildDir}/libs")
174+
manifest {
175+
from file("build/extract/META-INF/MANIFEST.MF")
176+
}
169177
doLast {
170178
delete("build/libs/graphql-java-${project.version}.jar")
171179
file("build/libs/graphql-java-tmp.jar").renameTo(file("build/libs/graphql-java-${project.version}.jar"))
172180
}
173181
}
174182

175-
176-
shadowJar.finalizedBy removeNotNeededGuava
183+
shadowJar.finalizedBy extractWithoutGuava, buildNewJar
177184

178185

179186
task testng(type: Test) {

0 commit comments

Comments
 (0)