【发布时间】:2020-07-30 16:19:56
【问题描述】:
我正在将一个示例 maven 项目转换为 Gradle。在 maven 项目中,有许可证、组织、开发人员等标签。我只想在 Gradle 项目中提供这些细节。我尝试在build.gradle 文件中添加以下内容,
licenses {
license {
name = 'Apache 1'
url = 'http://www.apache.org/licenses/LICENSE-1.0.txt'
distribution = 'repo'
comments = 'OSS license'
}
}
organization {
name = 'Sonatype'
url = 'http://www.sonatype.com'
}
但它给出了一个错误。
> Could not find method licenses() for arguments [build_aa7z0myalt7c30hobty4ylab$_run_closure1@227a2f2] on root project 'simple-weather' of type org.gradle.api.Project.
怎么做,我是否必须添加一些插件?
【问题讨论】:
标签: maven gradle build.gradle gradle-plugin