【发布时间】:2021-09-02 03:18:44
【问题描述】:
我使用的是 springboot 2.4.6 版和 gradle 6.3 版。这个springboot下载commons-compress 1.20,我想排除这个特定版本的commons-compress。出于安全原因,我想要 commons-compress 1.21。我已通过使用:
强制执行此特定版本implementation('org.apache.commons:commons-compress') {
version {
strictly '1.21'
}
}
但是,当我进行 gradle build 时,它同时显示了 1.20 和 1.21。那么如何在 Plugin 中排除 commons-compress 1.20 呢?
这就是我的代码 sn-p:
buildscript {
ext {
springBootVersion = "2.4.6"
junitVersion = "5.7.2"
awsVersion = "1.11.728"
lombokVersion = "1.18.12"
resilience4jVersion = "1.7.0"
logbackJsonVersion = "0.1.5"
}
}
plugins {
id "checkstyle"
id "com.github.spotbugs" version "4.4.4"
id "idea"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "jacoco"
id "java"
id "org.springframework.boot" version "2.4.6" --> this is the culprit
id "pmd"
}
dependencies {
implementation('org.apache.commons:commons-compress') {
version {
strictly '1.21'
}
}
.....
}
springBoot {
buildInfo {
properties {
additional = ['deployTag': System.getenv('DEPLOY_TAG') ?: '']
}
}
}
【问题讨论】:
标签: spring-boot gradle