打包问题解决:Could not get unknown property ‘runtime‘ for configuration ‘:distJars‘ of type org.gradle.api
使用gradle pz打包错误
原文件此部分配置为:
configurations {
wagon
distJars {
extendsFrom runtime
exclude group: 'org.elasticsearch'
exclude group: 'lucene-core'
exclude group: 'org.apache.logging.log4j'
exclude group: 'lucene-analyzers-common'
exclude group: 'org.apache.commons'
}
}
由于gradle 版本之间的差异,从 Gradle 6.x 开始,configurations.runtime
禁止使用参数获取程序执行的配置。相反,可以使用configurations.runtimeClasspath
来实现。因此修改runtime为 runtimeClasspath
修改后配置
configurations {
wagon
distJars {
extendsFrom runtimeClasspath
exclude group: 'org.elasticsearch'
exclude group: 'lucene-core'
exclude group: 'org.apache.logging.log4j'
exclude group: 'lucene-analyzers-common'
exclude group: 'org.apache.commons'
}
}
更多推荐
所有评论(0)