gpt4 book ai didi

intellij-idea - IntelliJ 不断向 Java 源文件添加重复的版权模板 header

转载 作者:行者123 更新时间:2023-12-05 07:56:30 25 4
gpt4 key购买 nike

IntelliJ 添加了太多版权 header

我将 IntelliJ 设置为将许可证作为 header 中的注释包含在源代码中。由于某种原因,IntelliJ 在所有文件中重复了几个版权声明。

因此目前所有文件都有一到五次(或更多)重复的许可证 header ,例如:

/*
* Copyright [2014] [John Doe]
*
* 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.
*/

/*
* Copyright [2014] [John Doe]
*
* 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.
*/

如何删除同一 header 的多次重复?

我找不到再次删除标题的功能。 IntelliJ 是否提供这样的功能?我应该使用 Linux 开发板工具并替换 tne 字符串吗?我怎样才能安全地做到这一点?

最佳答案

根据 Creating Copyright Profiles - IntelliJ IDEA 13.1.0 Web Help (粗体是我的):

In the Keyword to detect copyright in comments text box, type a character string to distinguish copyright notices from other comments during copyright update.

即它需要是一个足够唯一的子字符串,以可靠地识别您在版权配置文件中指定的版权声明。

关于intellij-idea - IntelliJ 不断向 Java 源文件添加重复的版权模板 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28628252/

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