-
Notifications
You must be signed in to change notification settings - Fork 118
5. Code Licenses
In a Pentaho Maven project, license information needs to be presented in two ways. The first way is in the project's pom file. The second way is in a LICENSE.txt file. Both of these elements must be present in a Maven based project.
The following licensing tasks need to be completed for each project, and possibly for each module if the licensing will differ across the project.
- Select License Type
- Add License section to Maven POM
- Add LICENSE.txt to project or module root
- Add license headers to source files
The following license types are primarily in use in across the organization. This list can be used as a guide in determining which license type should be used on a given project.
License Type | Description |
---|---|
Apache 2.0 | Used for parts of the Big Data Plugin and shims. Also used for PDI and its plugins. |
LGPL 2.1, GPL 2.0 | Used for Pentaho Platform, platform plugins, etc |
Eclipse Public License | Mondrian and some Mondrian subcomponents (Ex: Eigenbase) |
Mozilla Public License V2 | Primarily Webdetails |
Any EE projects should use this header
From: https://maven.apache.org/pom.html#Licenses
Licenses are legal documents defining how and when a project (or parts of a project) may be used. Note that a project should list only licenses that may apply directly to this project, and not list licenses that apply to this project's dependencies. Maven currently does little with these documents other than displays them on generated sites. However, there is talk of flexing for different types of licenses, forcing users to accept license agreements for certain types of (non open source) projects.
- name, url and comments: are self explanatory, and have been encountered before in other capacities. The fourth license element is:
- distribution: This describes how the project may be legally distributed. The two stated methods are repo (they may be downloaded from a Maven repository) or manual (they must be manually installed).
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>GNU Lesser General Public License, Version 2.1</name>
<url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>GNU Lesser General Public License, Version 3.0</name>
<url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>The MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>Mozilla Public License, Version 1.1</name>
<url>https://www.mozilla.org/media/MPL/1.1/index.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
Additionally, license information should be presented with the inclusion of a LICENSE.txt file.
In standard cases, the appropriate LICENSE.txt file should exist in the root of the project. The LICENSE.txt file should contain a full copy of the applicable license (Apache 2.0, LGPL 2.1, etc.).
When a project contains sub-modules, the following rules apply:
- When all of the sub-modules of a project have the same LICENSE applied, it is acceptable to only have a LICENSE.txt file in the project's root. This file contains the full copy of the applicable license. It is implied that all sub-modules inherit the same license.
- If one of the sub-modules of a project has a different license than the others, then that module should have its own LICENSE.txt file.
- In the case of a project with multiple sub-projects of differing licenses, there should be a LICENSE_INFO.txt file at the root level.
- This file should reference all the differing licenses of the sub-projects.
- Each sub-module should be named, along with the license type. There should a reference to the location of that module's LICENSE.txt within the project.
(TODO: Validate this structure considering the license inheritance)
main - GPL v2 - LICENSE.txt
api - LGPL v2.1 - api/LICENSE.txt
To facilitate the management of licenses on Pentaho projects a maven plugin has been developed and can be found here. To make use of this plugin on your project there are 2 requirements:
-
Defining the property license.licenseName to one of the supported licenses on the root pom of the project and on any sub-module that has a different license.
-
Run the following the plugin goal to generate a license on the root of the project
mvn org.pentaho.maven.plugins:license-helper-maven-plugin:generate
To check the list of supported licenses please see the plugin documentation here
All source code files need to have license information presented in the header. License headers have to match the license presented in the LICENSE.txt file.