title: IDEA使用copyright tags:
- IDEA
- CopyRight
- 版權 categories: idea date: 2017-11-30 01:54:19
背景
用了那麼多的開源元件可能大家都會發現基本上各個元件都會在程式碼前面註釋版權宣告
比如Mybatis宣告如下
/**
* Copyright 2009-2016 the original author or authors.
*
* 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.
*/
複製程式碼
那麼在IDEA下免我們如何使用版權呢?
步驟
- 在設定中找到copyright
- 新建新的profile 【定義copyright text】
- 定義完成後使用validate進行校驗 [針對老的copyright也支援一鍵替換]
- 返回修改scope為使用profile
- 在code選單欄選擇update copyright
- 程式碼中都會生成如下版權宣告
/*
* Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
* Vestibulum commodo. Ut rhoncus gravida arcu.
*/
複製程式碼
複製程式碼