Skip to content

Commit db4c019

Browse files
committed
update JAR dependencies
1 parent d0a046c commit db4c019

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

build.gradle

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ description = "Beats/Lumberjack Netty implementation"
1313
sourceCompatibility = 1.8
1414
targetCompatibility = 1.8
1515

16-
String jacksonVersion = '2.13.3'
17-
String jacksonDatabindVersion = '2.13.3'
16+
String jacksonVersion = '2.14.0'
17+
String jacksonDatabindVersion = '2.14.0'
1818

1919
repositories {
2020
mavenCentral()
2121
}
2222

2323
dependencies {
24-
testImplementation 'junit:junit:4.12'
24+
testImplementation 'junit:junit:4.13.1'
2525
testImplementation 'org.hamcrest:hamcrest-library:1.3'
26-
testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0'
27-
implementation 'io.netty:netty-all:4.1.65.Final'
26+
testImplementation 'org.apache.logging.log4j:log4j-core:2.17.1'
27+
implementation 'io.netty:netty-all:4.1.68.Final'
2828
implementation 'org.javassist:javassist:3.24.0-GA'
2929
testImplementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
3030
testImplementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
@@ -64,9 +64,12 @@ task generateGemJarRequiresFile {
6464
jars_file.newWriter().withWriter { w ->
6565
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
6666
w << "require \'jar_dependencies\'\n"
67-
configurations.runtimeClasspath.allDependencies.each {
68-
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
69-
}
67+
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
68+
.collect {it.owner}
69+
.sort { it.group }
70+
.each {
71+
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
72+
}
7073
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
7174
}
7275
}
@@ -75,13 +78,14 @@ task generateGemJarRequiresFile {
7578
task vendor {
7679
doLast {
7780
String vendorPathPrefix = "vendor/jar-dependencies"
78-
configurations.runtimeClasspath.allDependencies.each { dep ->
79-
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
80-
String groupPath = dep.group.replaceAll('\\.', '/')
81-
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
82-
newJarFile.mkdirs()
83-
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
84-
}
81+
configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
82+
ModuleVersionIdentifier dep = artifact.owner
83+
File f = artifact.file
84+
String groupPath = dep.group.replaceAll('\\.', '/')
85+
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
86+
newJarFile.mkdirs()
87+
Files.copy(f.toPath(), newJarFile.toPath(), REPLACE_EXISTING)
88+
}
8589
String projectGroupPath = project.group.replaceAll('\\.', '/')
8690
File projectJarFile = file("${vendorPathPrefix}/${projectGroupPath}/${project.name}/${project.version}/${project.name}-${project.version}.jar")
8791
projectJarFile.mkdirs()

0 commit comments

Comments
 (0)