gpt4 book ai didi

groovy - 许可证-gradle-plugin

转载 作者:行者123 更新时间:2023-12-03 06:33:49 28 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





License Gradle Plugin

(1 个回答)


9年前关闭。




感谢回复,我正在寻找应用 License-gradle-plugin 来检查源代码中的 header 。请给我完整的脚本。

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5.0'
}
}

apply plugin: 'license'

我在我的 build.gradle 中使用了此代码,但它没有更新我所有源文件中的标题 src/main/*.groovy files .如何编写构建脚本来检查 .groovy 中是否存在 Header如果不在 groovy 文件中写入 header ,文件?

谢谢,
kothapeta 拉朱。

我按照你说的尝试过,但出现以下异常

FAILURE:无法确定要执行的任务。
  • 什么地方出了错:
    在根项目“license-gradle-plugin-master”中找不到任务“licenseFormatMain”。
  • 尝试:
    运行 gradle 任务以获取可用任务的列表。

  • 构建失败

    谢谢,
    拉朱。

    最佳答案

    所以,reading the instructions表明您:

    把这个放在你的build.gradle文件

    buildscript {
    repositories {
    mavenCentral()
    }

    dependencies {
    classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5.0'
    }
    }

    apply plugin: 'license'

    创建文件 LICENSE在项目的根目录中
    Copyright (C)2013 - Tim Yates

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and
    limitations under the License.

    然后输入
    gradle licenseFormatMain

    关于groovy - 许可证-gradle-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15200659/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com