@@ -24,7 +24,7 @@ dependencies {
2424 testImplementation ' org.hamcrest:hamcrest-library:1.3'
2525 testImplementation " org.apache.logging.log4j:log4j-core:${ log4jVersion} "
2626
27- implementation ' io.netty:netty-all:4.1.65 .Final'
27+ implementation ' io.netty:netty-all:4.1.68 .Final'
2828 compileOnly " org.apache.logging.log4j:log4j-api:${ log4jVersion} " // provided by Logstash
2929}
3030
@@ -51,9 +51,12 @@ task generateGemJarRequiresFile {
5151 jars_file. newWriter(). withWriter { w ->
5252 w << " # AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n "
5353 w << " require \' jar_dependencies\'\n "
54- configurations. runtimeClasspath. allDependencies. each {
55- w << " require_jar(\' ${ it.group} \' , \' ${ it.name} \' , \' ${ it.version} \' )\n "
56- }
54+ configurations. runtimeClasspath. resolvedConfiguration. resolvedArtifacts
55+ .collect {it. owner}
56+ .sort { it. group }
57+ .each {
58+ w << " require_jar(\' ${ it.group} \' , \' ${ it.name} \' , \' ${ it.version} \' )\n "
59+ }
5760 w << " require_jar(\' ${ project.group} \' , \' ${ project.name} \' , \' ${ project.version} \' )\n "
5861 }
5962 }
@@ -62,12 +65,14 @@ task generateGemJarRequiresFile {
6265task vendor {
6366 doLast {
6467 String vendorPathPrefix = " vendor/jar-dependencies"
65- configurations. runtimeClasspath. allDependencies. each { dep ->
66- File f = configurations. runtimeClasspath. filter { it. absolutePath. contains(" ${ dep.group} /${ dep.name} /${ dep.version} " ) }. singleFile
67- String groupPath = dep. group. replaceAll(' \\ .' , ' /' )
68- File newJarFile = file(" ${ vendorPathPrefix} /${ groupPath} /${ dep.name} /${ dep.version} /${ dep.name} -${ dep.version} .jar" )
69- newJarFile. mkdirs()
70- Files . copy(f. toPath(), newJarFile. toPath(), REPLACE_EXISTING )
68+ configurations. runtimeClasspath. resolvedConfiguration. resolvedArtifacts. each { artifact ->
69+ ModuleVersionIdentifier dep = artifact. owner
70+ File f = artifact. file
71+
72+ String groupPath = dep. group. replaceAll(' \\ .' , ' /' )
73+ File newJarFile = file(" ${ vendorPathPrefix} /${ groupPath} /${ dep.name} /${ dep.version} /${ dep.name} -${ dep.version} .jar" )
74+ newJarFile. mkdirs()
75+ Files . copy(f. toPath(), newJarFile. toPath(), REPLACE_EXISTING )
7176 }
7277 String projectGroupPath = project. group. replaceAll(' \\ .' , ' /' )
7378 File projectJarFile = file(" ${ vendorPathPrefix} /${ projectGroupPath} /${ project.name} /${ project.version} /${ project.name} -${ project.version} .jar" )
0 commit comments