开源代码是否可以商用?

    • 是否可以商用?
    • 如何查看许可证是哪个?
    • 什么是 Apache License 2.0 ?
    • 如何使用开源代码?
      • 1、根路径添加 LICENSE 文件
      • 2、根路径添加 NOTICE 文件
      • 3、在使用的地方(放在文件最上面)
  • 参考地址

是否可以商用?

开源代码是否可以商用,其实是要看源代码的开源许可证,如果源代码对应的开源许可证是支持免费商用,当然可以用,但是一定要遵循其规定

如下部分许可证总结:

转自:https://www.ruanyifeng.com/blog/2011/05/how_to_choose_free_software_licenses.html

更多许可证:

常用开源协议以及是否能够商用:https://www.zhangbj.com/p/833.html

如何查看许可证是哪个?

找到其源码,阅读其源码仓库中的 LICENSE 文件

如果是 Apache License ,便可以商用,但是要遵循其规定。

什么是 Apache License 2.0 ?

Apache License 2.0协议来自于著名的Apache基金会,其最重要的开源软件就是Apache(HTTPD)网站服务器。

Apache License协议和BSD类似,同样鼓励代码共享和尊重原作者的著作权,同样允许代码修改,再发布(作为开源或商业软件)。需要满足的条件也和BSD类似:

  • 需要给代码的用户一份Apache Licence
  • 如果你修改了代码,需要在被修改的文件中说明
  • 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
  • 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。

Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。著名的Android系统,Apache基金会的众多开源项目,Swift项目等,都是用Apache Lincese 2.0协议。

使用Apache Licence 2.0协议的好处是:

  • 永久权利,一旦被授权,永久拥有。
  • 全球范围的权利,在一个国家获得授权,适用于所有国家。假如你在美国,许可是从印度授权的,也没有问题。
  • 授权免费无版税, 前期、后期均无任何费用。
  • 授权无排他性,任何人都可以获得授权
  • 授权不可撤消,一旦获得授权,没有任何人可以取消。比如,你基于该产品代码开发了衍生产品,你不用担心会在某一天被禁止使用该代码。

转自:什么是Apache License 2.0开源协议:https://www.cnblogs.com/cqiuku/p/14857890.html

如何使用开源代码?

1、根路径添加 LICENSE 文件


内容如下:

Apache LicenseVersion 2.0, June 2018http://www.apache.org/licenses/TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION1. Definitions."License" shall mean the terms and conditions for use, reproduction,and distribution as defined by Sections 1 through 9 of this document."Licensor" shall mean the copyright owner or entity authorized bythe copyright owner that is granting the License."Legal Entity" shall mean the union of the acting entity and allother entities that control, are controlled by, or are under commoncontrol with that entity. For the purposes of this definition,"control" means (i) the power, direct or indirect, to cause thedirection or management of such entity, whether by contract orotherwise, or (ii) ownership of fifty percent (50%) or more of theoutstanding shares, or (iii) beneficial ownership of such entity."You" (or "Your") shall mean an individual or Legal Entityexercising permissions granted by this License."Source" form shall mean the preferred form for making modifications,including but not limited to software source code, documentationsource, and configuration files."Object" form shall mean any form resulting from mechanicaltransformation or translation of a Source form, including butnot limited to compiled object code, generated documentation,and conversions to other media types."Work" shall mean the work of authorship, whether in Source orObject form, made available under the License, as indicated by acopyright notice that is included in or attached to the work(an example is provided in the Appendix below)."Derivative Works" shall mean any work, whether in Source or Objectform, that is based on (or derived from) the Work and for which theeditorial revisions, annotations, elaborations, or other modificationsrepresent, as a whole, an original work of authorship. For the purposesof this License, Derivative Works shall not include works that remainseparable from, or merely link (or bind by name) to the interfaces of,the Work and Derivative Works thereof."Contribution" shall mean any work of authorship, includingthe original version of the Work and any modifications or additionsto that Work or Derivative Works thereof, that is intentionallysubmitted to Licensor for inclusion in the Work by the copyright owneror by an individual or Legal Entity authorized to submit on behalf ofthe copyright owner. For the purposes of this definition, "submitted"means any form of electronic, verbal, or written communication sentto the Licensor or its representatives, including but not limited tocommunication on electronic mailing lists, source code control systems,and issue tracking systems that are managed by, or on behalf of, theLicensor for the purpose of discussing and improving the Work, butexcluding communication that is conspicuously marked or otherwisedesignated in writing by the copyright owner as "Not a Contribution.""Contributor" shall mean Licensor and any individual or Legal Entityon behalf of whom a Contribution has been received by Licensor andsubsequently incorporated within the Work.2. Grant of Copyright License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,worldwide, non-exclusive, no-charge, royalty-free, irrevocablecopyright license to reproduce, prepare Derivative Works of,publicly display, publicly perform, sublicense, and distribute theWork and such Derivative Works in Source or Object form.3. Grant of Patent License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,worldwide, non-exclusive, no-charge, royalty-free, irrevocable(except as stated in this section) patent license to make, have made,use, offer to sell, sell, import, and otherwise transfer the Work,where such license applies only to those patent claims licensableby such Contributor that are necessarily infringed by theirContribution(s) alone or by combination of their Contribution(s)with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including across-claim or counterclaim in a lawsuit) alleging that the Workor a Contribution incorporated within the Work constitutes director contributory patent infringement, then any patent licensesgranted to You under this License for that Work shall terminateas of the date such litigation is filed.4. Redistribution. You may reproduce and distribute copies of theWork or Derivative Works thereof in any medium, with or withoutmodifications, and in Source or Object form, provided that Youmeet the following conditions:(a) You must give any other recipients of the Work orDerivative Works a copy of this License; and(b) You must cause any modified files to carry prominent noticesstating that You changed the files; and(c) You must retain, in the Source form of any Derivative Worksthat You distribute, all copyright, patent, trademark, andattribution notices from the Source form of the Work,excluding those notices that do not pertain to any part ofthe Derivative Works; and(d) If the Work includes a "NOTICE" text file as part of itsdistribution, then any Derivative Works that You distribute mustinclude a readable copy of the attribution notices containedwithin such NOTICE file, excluding those notices that do notpertain to any part of the Derivative Works, in at least oneof the following places: within a NOTICE text file distributedas part of the Derivative Works; within the Source form ordocumentation, if provided along with the Derivative Works; or,within a display generated by the Derivative Works, if andwherever such third-party notices normally appear. The contentsof the NOTICE file are for informational purposes only anddo not modify the License. You may add Your own attributionnotices within Derivative Works that You distribute, alongsideor as an addendum to the NOTICE text from the Work, providedthat such additional attribution notices cannot be construedas modifying the License.You may add Your own copyright statement to Your modifications andmay provide additional or different license terms and conditionsfor use, reproduction, or distribution of Your modifications, orfor any such Derivative Works as a whole, provided Your use,reproduction, and distribution of the Work otherwise complies withthe conditions stated in this License.5. Submission of Contributions. Unless You explicitly state otherwise,any Contribution intentionally submitted for inclusion in the Workby You to the Licensor shall be under the terms and conditions ofthis License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modifythe terms of any separate license agreement you may have executedwith Licensor regarding such Contributions.6. Trademarks. This License does not grant permission to use the tradenames, trademarks, service marks, or product names of the Licensor,except as required for reasonable and customary use in describing theorigin of the Work and reproducing the content of the NOTICE file.7. Disclaimer of Warranty. Unless required by applicable law oragreed to in writing, Licensor provides the Work (and eachContributor provides its Contributions) on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied, including, without limitation, any warranties or conditionsof TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR APARTICULAR PURPOSE. You are solely responsible for determining theappropriateness of using or redistributing the Work and assume anyrisks associated with Your exercise of permissions under this License.8. Limitation of Liability. In no event and under no legal theory,whether in tort (including negligence), contract, or otherwise,unless required by applicable law (such as deliberate and grosslynegligent acts) or agreed to in writing, shall any Contributor beliable to You for damages, including any direct, indirect, special,incidental, or consequential damages of any character arising as aresult of this License or out of the use or inability to use theWork (including but not limited to damages for loss of goodwill,work stoppage, computer failure or malfunction, or any and allother commercial damages or losses), even if such Contributorhas been advised of the possibility of such damages.9. Accepting Warranty or Additional Liability. While redistributingthe Work or Derivative Works thereof, You may choose to offer,and charge a fee for, acceptance of support, warranty, indemnity,or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act onlyon Your own behalf and on Your sole responsibility, not on behalfof any other Contributor, and only if You agree to indemnify,defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reasonof your accepting any such warranty or additional liability.END OF TERMS AND CONDITIONSAPPENDIX: How to apply the Apache License to your work.To apply the Apache License to your work, attach the followingboilerplate notice, with the fields enclosed by brackets "[]"replaced with your own identifying information. (Don't includethe brackets!)  The text should be enclosed in the appropriatecomment syntax for the file format. We also recommend that afile or class name and description of purpose be included on thesame "printed page" as the copyright notice for easieridentification within third-party archives.Copyright 2018 Huang JinQunLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.

2、根路径添加 NOTICE 文件

我看一般开源项目里都没有这个文件,大家自行判断吧

用于记录第三方库

Apache SkyWalking
Copyright 2017-2020 The Apache Software FoundationThis product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

「Apache SkyWalking Copyright 2017-2020 The Apache Software Foundation」
对应的是第三方库:
Apache SkyWalking :作者或者机构
Copyright
2017-2020
The Apache Software Foundation:项目

「This product includes software developed at The Apache Software Foundation (http://www.apache.org/).」

如上内容固定

3、在使用的地方(放在文件最上面)

 Copyright 2019, hegaojian(何高建)       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, softwaredistributed 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 andlimitations under the License.

如果修改了源代码,需要在源代码内进行说明

参考地址

使用开源项目必须保留作者姓名?开源软件不能商用?我们需要先学会分辨开源许可证:https://zhuanlan.zhihu.com/p/368237701

开源协议:在项目中使用Apache License 2.0:https://blog.csdn.net/liumiaocn/article/details/107363838

每天记录学习的新知识:开源代码是否可以商用在项目中?相关推荐

  1. 每天记录学习的新知识 :WebView介绍以及基本使用和方法

    WebView介绍以及基本使用和方法 一.简介 二.调用: 三.方法介绍 3.1 WebView状态控制 3.2 WebView销毁和清理 3.3 WebView网页切换 3.4 WebView的回调 ...

  2. 每天记录学习的新知识 : Disposable和CompositeDisposable

    CompositeDisposable 一.Disposable 1.简介 2.调用 2.1.主动解除订阅 2.2.查询是否解除订阅 true 代表 已经解除订阅 2.3.栗子 2.4.取消订阅的操作 ...

  3. 每天记录学习的新知识 :Navigation

    Navigation 前言 Navigation Activity 多个Fragment的情况 Fragment 嵌套 Fragment 参考地址 前言 Jetpack 是一个丰富的组件库,它的组件库 ...

  4. 每天记录学习的新知识:利用高德地图绘制历史路线

    前提: App需要展示行程路线,这里用的是高德地图的Api 绘制路线: 首先下载了官方提供的 AMap3DDemo ,运行后找到 case 多彩线绘制,仿照它基本上可以实现路线绘制. 绿色位置请忽略. ...

  5. 每天记录学习的新知识:圆的运算公式

    前言: 对于圆的运算,忘记得很彻底,回顾一下. 公式: 圆的周长,C=2πr 或 C=πd 圆的面积,S=πr2=πd2/4 弧度 1弧度约为57.3°,即57°17'44.806'',1°为π/18 ...

  6. 每天记录学习的新知识:ContentResolver

    ContentResolver 一.用途 二.方法 三.使用 1.查询 2.插入 3.数据刷新通知 4.可以用于监听系统的数据变化 参考地址 一.用途 ContentResolver直译为内容解析器, ...

  7. 每天记录学习的新知识 : gilde 和 picasso的区别

    区别和联系 1.Context 不同 Picasso.with(只能传入上下文) . Glide.with,后面可以传入上下文,activity实例,FragmentActivity实例,Fragem ...

  8. 每天学习一点新知识(一)——Unity开发游戏的拆包

    每天学习一点新知识(一)--Unity开发游戏的解包 用了CSDN有一段时间了,但一直都没有写过blog,只是在输入,没有输出.而且一直主要都是在查一些作业.题解什么的,还是希望自己能够多学到一些新东 ...

  9. 【每天学习一点新知识】中间人攻击是什么

    目录 中间人攻击介绍 中间人攻击原理 1. ARP欺骗 2. DNS欺骗 防御方法 中间人攻击介绍 中间人攻击(man-in-the-middle attack, abbreviated to MIT ...

最新文章

  1. 25. javacript高级程序设计-新兴的API
  2. 丢失/root目录导致命令行-bash-4.1#,解决方法
  3. 超详细单机版搭建hadoop环境图文解析
  4. 架构之美(china-pub全国独家首发)
  5. C/C++ VS java
  6. 使用ABAP绘制可伸缩矢量图
  7. 系列TCP/IP协议-动态IP选路协议(008)
  8. html按钮分享功能实现,一个分享按钮的插件使用介绍(可扩展,内附开发制作流程)...
  9. 五、字符与字符串(Char类,Char类的使用,String的基本使用,StringBuilder的使用)...
  10. 微课|中学生可以这样学Python(2.3.3节):内置函数sorted()
  11. python使用rpa需要什么插件_使用Python制作ArcGIS插件基础篇——工具介绍
  12. java 读取excel wps_安装WPS引发的excel上传问题
  13. Win10登陆界面卡住,进去后无法打开网络相关的设置,谷歌浏览器无法上网
  14. Linux初级入门百篇-lsof工具
  15. html页面太大了怎么调小,html – 如何在调整浏览器窗口大小时保持绝对定位的元素...
  16. 新的用户故事待办列表就是一副地图
  17. 2017年中兴捧月神算师算法精英挑战赛之阿尔法勒克斯特派(AlphaNext派)-----进来加群咯
  18. Android系统电池管理(PowerManagerService)框架分析及其在实体设备和虚拟设备上的差异(一)
  19. Java5、8、9章复习 5.6
  20. 删除MySQL表的SQL语句-DROP-TABLE-简介

热门文章

  1. 创宇区块链|Rari Capital 遭受重入攻击,损失超 8000 万美元
  2. 哈夫曼树基础知识总结
  3. 【论文-笔记】软件化雷达显控终端的设计与研究
  4. 多视图几何——变换层次总结(射影变换,仿射变换,相似变换,欧式变换)
  5. Linux 命令大全 (新手必备收藏)
  6. 计算机室免费开放活动方案,免费低收费开放方案
  7. java发送hotmail邮件_如何使用Gmail、Yahoo或Hotmail通过Java应用程序发送电子邮件?...
  8. 液晶电视面板行业研究及十四五规划分析报告
  9. 【前端学习】CSS入门
  10. weui实现移动端地址三级联动,基于js