开源协议的选择

通用技能2.1

Posted by BY on August 22, 2018

主流开源协议

开源协议众多,采用最主流的即可。几张图片(出处见水印)简洁明了:

图一 图二 图三

使用

  1. 在项目的根目录放置一个LICENSE或者COPYING文件,这个文件里面是你所使用的开源协议的具体细则,比如你用的是MIT License协议, 你只需要到网上拷贝一个MIT License协议正文进来就可以了,比如vsa这个项目, 使用的是Apache License 2.0开源协议,协议的正文在这里

  2. 在你项目的每个源文件中加入版权声明,比如vsa项目中的这个文件加入了如下的版权声明
    # Copyright 2013 Mellanox Technologies, Ltd
    #
    # 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.
    
  3. 补充:上面的2步中,第一步是必须的,实施起来比较简单,拷贝一个对应的协议正文即可。第二步不是特别必须,而且没有严格约定如何描述,甚至有些项目里面没有在源码中写版权信息,当然规范的操作应该是每个源文件中都加。

参考

参考:

更多协议: