如何在开源程序中添加Apache License2.0授权

在开源程序中添加许可证是必不可少的一个工作,下面我们来看一下当今最常用开源许可证Apache License2.0如何添加到自己的开源程序中,添加License十分简单,根据下面的步骤你只需要5分钟就可以完成。

1、官网条款全文

全文地址:https://www.apache.org/licenses/LICENSE-2.0

可以打开官文看一下全文内容,也可以跳过直接看下面步骤。

2、如何应用到开源程序中

  • 将下文拷贝保存到LICENSE文件中(或NOTICE文件,建议两个都有)。

下文为官网拷贝下来的内容,建议从官网拷贝。

Copyright [yyyy] [name of copyright owner]

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 [yyyy] [name of copyright owner]”

    License第一行版权信息将方括号中的内容替换成自己的,同时去掉”[]”,建议加上联系方式。

  • 加入源文件开头。

    为了让第三方显而易见的了解该程序的License,建议在源文件的开头包含这段声明

  • 将LICENSE文件放入源代码库与源程序一起发布。

声明:本文仅代表作者个人观点,请自行斟酌使用。 

发布了34 篇原创文章 · 获赞 18 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/CatherineJChen/article/details/103989008