Skip to content

Commit fc79c75

Browse files
committed
refs #11373 - latest log4j version in scala gradle
1 parent 9c87876 commit fc79c75

File tree

3 files changed

+53
-26
lines changed

3 files changed

+53
-26
lines changed

modules/swagger-codegen/src/main/resources/scala/build.gradle.mustache

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') {
2323
2424
apply plugin: 'com.android.library'
2525
apply plugin: 'com.github.dcendents.android-maven'
26-
26+
2727
android {
2828
compileSdkVersion 23
2929
buildToolsVersion '23.0.2'
@@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') {
3535
sourceCompatibility JavaVersion.VERSION_1_7
3636
targetCompatibility JavaVersion.VERSION_1_7
3737
}
38-
38+
3939
// Rename the aar correctly
4040
libraryVariants.all { variant ->
4141
variant.outputs.each { output ->
@@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') {
5151
provided 'javax.annotation:jsr250-api:1.0'
5252
}
5353
}
54-
54+
5555
afterEvaluate {
5656
android.libraryVariants.all { variant ->
5757
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
@@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') {
6363
artifacts.add('archives', task);
6464
}
6565
}
66-
66+
6767
task sourcesJar(type: Jar) {
6868
from android.sourceSets.main.java.srcDirs
6969
classifier = 'sources'
7070
}
71-
71+
7272
artifacts {
7373
archives sourcesJar
7474
}
@@ -78,16 +78,16 @@ if(hasProperty('target') && target == 'android') {
7878
apply plugin: 'scala'
7979
apply plugin: 'java'
8080
apply plugin: 'maven'
81-
81+
8282
sourceCompatibility = JavaVersion.VERSION_1_7
8383
targetCompatibility = JavaVersion.VERSION_1_7
84-
84+
8585
install {
8686
repositories.mavenInstaller {
8787
pom.artifactId = '{{artifactId}}'
8888
}
8989
}
90-
90+
9191
task execute(type:JavaExec) {
9292
main = System.getProperty('mainClass')
9393
classpath = sourceSets.main.runtimeClasspath
@@ -124,4 +124,13 @@ dependencies {
124124
compile "joda-time:joda-time:$jodatime_version"
125125
compile "org.joda:joda-convert:$joda_version"
126126
compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version"
127+
constraints {
128+
zinc("org.apache.logging.log4j:log4j-core") {
129+
version {
130+
strictly("[2.17.1, 3[")
131+
prefer("2.17.1")
132+
}
133+
because("Log4j vulnerable to remote code execution and other critical security vulnerabilities")
134+
}
135+
}
127136
}

samples/client/petstore-security-test/scala/build.gradle

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') {
2323

2424
apply plugin: 'com.android.library'
2525
apply plugin: 'com.github.dcendents.android-maven'
26-
26+
2727
android {
2828
compileSdkVersion 23
2929
buildToolsVersion '23.0.2'
@@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') {
3535
sourceCompatibility JavaVersion.VERSION_1_7
3636
targetCompatibility JavaVersion.VERSION_1_7
3737
}
38-
38+
3939
// Rename the aar correctly
4040
libraryVariants.all { variant ->
4141
variant.outputs.each { output ->
@@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') {
5151
provided 'javax.annotation:jsr250-api:1.0'
5252
}
5353
}
54-
54+
5555
afterEvaluate {
5656
android.libraryVariants.all { variant ->
5757
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
@@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') {
6363
artifacts.add('archives', task);
6464
}
6565
}
66-
66+
6767
task sourcesJar(type: Jar) {
6868
from android.sourceSets.main.java.srcDirs
6969
classifier = 'sources'
7070
}
71-
71+
7272
artifacts {
7373
archives sourcesJar
7474
}
@@ -78,19 +78,19 @@ if(hasProperty('target') && target == 'android') {
7878
apply plugin: 'scala'
7979
apply plugin: 'java'
8080
apply plugin: 'maven'
81-
81+
8282
sourceCompatibility = JavaVersion.VERSION_1_7
8383
targetCompatibility = JavaVersion.VERSION_1_7
84-
84+
8585
install {
8686
repositories.mavenInstaller {
8787
pom.artifactId = 'swagger-scala-client'
8888
}
8989
}
90-
90+
9191
task execute(type:JavaExec) {
92-
main = System.getProperty('mainClass')
93-
classpath = sourceSets.main.runtimeClasspath
92+
main = System.getProperty('mainClass')
93+
classpath = sourceSets.main.runtimeClasspath
9494
}
9595
}
9696

@@ -124,4 +124,13 @@ dependencies {
124124
compile "joda-time:joda-time:$jodatime_version"
125125
compile "org.joda:joda-convert:$joda_version"
126126
compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version"
127+
constraints {
128+
zinc("org.apache.logging.log4j:log4j-core") {
129+
version {
130+
strictly("[2.17.1, 3[")
131+
prefer("2.17.1")
132+
}
133+
because("Log4j vulnerable to remote code execution and other critical security vulnerabilities")
134+
}
135+
}
127136
}

samples/client/petstore/scala/build.gradle

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') {
2323

2424
apply plugin: 'com.android.library'
2525
apply plugin: 'com.github.dcendents.android-maven'
26-
26+
2727
android {
2828
compileSdkVersion 23
2929
buildToolsVersion '23.0.2'
@@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') {
3535
sourceCompatibility JavaVersion.VERSION_1_7
3636
targetCompatibility JavaVersion.VERSION_1_7
3737
}
38-
38+
3939
// Rename the aar correctly
4040
libraryVariants.all { variant ->
4141
variant.outputs.each { output ->
@@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') {
5151
provided 'javax.annotation:jsr250-api:1.0'
5252
}
5353
}
54-
54+
5555
afterEvaluate {
5656
android.libraryVariants.all { variant ->
5757
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
@@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') {
6363
artifacts.add('archives', task);
6464
}
6565
}
66-
66+
6767
task sourcesJar(type: Jar) {
6868
from android.sourceSets.main.java.srcDirs
6969
classifier = 'sources'
7070
}
71-
71+
7272
artifacts {
7373
archives sourcesJar
7474
}
@@ -78,16 +78,16 @@ if(hasProperty('target') && target == 'android') {
7878
apply plugin: 'scala'
7979
apply plugin: 'java'
8080
apply plugin: 'maven'
81-
81+
8282
sourceCompatibility = JavaVersion.VERSION_1_7
8383
targetCompatibility = JavaVersion.VERSION_1_7
84-
84+
8585
install {
8686
repositories.mavenInstaller {
8787
pom.artifactId = 'swagger-scala-client'
8888
}
8989
}
90-
90+
9191
task execute(type:JavaExec) {
9292
main = System.getProperty('mainClass')
9393
classpath = sourceSets.main.runtimeClasspath
@@ -124,4 +124,13 @@ dependencies {
124124
compile "joda-time:joda-time:$jodatime_version"
125125
compile "org.joda:joda-convert:$joda_version"
126126
compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version"
127+
constraints {
128+
zinc("org.apache.logging.log4j:log4j-core") {
129+
version {
130+
strictly("[2.17.1, 3[")
131+
prefer("2.17.1")
132+
}
133+
because("Log4j vulnerable to remote code execution and other critical security vulnerabilities")
134+
}
135+
}
127136
}

0 commit comments

Comments
 (0)