【发布时间】:2015-02-20 11:24:06
【问题描述】:
IntelliJ 添加了太多的版权标头
我将 IntelliJ 设置为在源代码中包含许可证作为标题中的注释。出于某种原因,IntelliJ 在所有文件中重复了几个版权声明。
所以目前所有文件都有一到五个(或更多)重复的许可证头,例如:
/*
* 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.
*/
如何删除同一标题的多次重复?
我找不到再次删除标题的功能。 IntelliJ 是否提供这样的功能?我应该使用 Linux 板工具并替换 tne 字符串吗?我怎样才能安全地做到这一点?
【问题讨论】:
-
在您清理副本后,它是否会在某些情况下继续添加副本?一个肯定的答案将大大扩展要解决的问题。
-
是的,当我在提交期间激活“更新版权”设置时,IntelliJ 添加了多个版权标题。我不会期望这种行为。帮助说“要正确更新版权通知,请确保版权配置文件中指定的关键字是通知定义的一部分。否则,IntelliJ IDEA 将不会检测版权通知,并且不会更新现有通知,而是插入新通知”。我注意到我应该在这里寻找什么关键字。
标签: intellij-idea copyright-display