打开IDEA设置,依次进入 Editor→Copyright→Copyright Profiles
如上图所示,点击Add profile 按钮
如上图所示,填写协议名称点击ok
添加完成后协议内容会自动生成一些内容需要自己替换掉。
模板内容参考:
Copyright 2017-$today.year your.com.
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
https://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.
替换完成后记得点Validate按钮验证下,没问题点击apply按钮应用
打开IDEA设置,依次进入 Editor→Copyright
默认情况是这样:
配置默认的copyright,选中刚才创建的copyright profile
设置完成后最后点击Apply应用。
依次点击Code→Update Copyright …
搞定。
https://www.leftso.com/article/2407301211034846.html