File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -58,19 +58,14 @@ val jar by tasks.existing(Jar::class) {
58
58
)
59
59
)
60
60
}
61
+
61
62
// add module-info.class to the META-INF/versions/9/ directory.
62
63
dependsOn(tasks.compileModuleInfoJava)
63
- doLast {
64
- // We can't do that directly with the shadowJar task because it doesn't support replacing existing files.
65
- val zipPath = this @existing.outputs.files.singleFile.toPath()
66
- val zipUri = URI .create(" jar:${zipPath.toUri()} " )
67
- val moduleInfoFilePath = tasks.compileModuleInfoJava.get().outputs.files.asFileTree.matching {
68
- include(" module-info.class" )
69
- }.singleFile.toPath()
70
- FileSystems .newFileSystem(zipUri, emptyMap<String , String >()).use { fs ->
71
- val moduleInfoFile = fs.getPath(" META-INF/versions/9/module-info.class" )
72
- Files .copy(moduleInfoFilePath, moduleInfoFile, StandardCopyOption .REPLACE_EXISTING )
73
- }
64
+ from(tasks.compileModuleInfoJava.get().outputs.files.asFileTree.matching {
65
+ include(" module-info.class" )
66
+ }) {
67
+ this .duplicatesStrategy = DuplicatesStrategy .INCLUDE
68
+ into(" META-INF/versions/9" )
74
69
}
75
70
}
76
71
You can’t perform that action at this time.
0 commit comments