Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
fix(license): add licenses third party generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xzima committed Apr 7, 2022
1 parent 09524fa commit 478529d
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/LICENSES_THIRD_PARTY_groupByLicense.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<#--
#%L
License Maven Plugin
%%
Copyright (C) 2012 Codehaus, Tony Chemit
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->

<#-- To render the third-party file.
Available context :
- dependencyMap a collection of Map.Entry with
key are dependencies (as a MavenProject) (from the maven project)
values are licenses of each dependency (array of string)
- licenseMap a collection of Map.Entry with
key are licenses of each dependency (array of string)
values are all dependencies using this license
-->
<#function artifactFormat p>
<#if p.name?index_of('Unnamed') &gt; -1>
<#return p.artifactId + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")">
<#else>
<#return p.name + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")">
</#if>
</#function>

<#if licenseMap?size == 0>
The project has no dependencies.
<#else>
We uses third-party libraries which may be distributed under different
licenses. We have listed all of these third party libraries and their licenses
below. This file can be regenerated at any time by simply running:

mvn clean verify -Dthird.party.licenses=true

You must agree to the terms of these licenses, in addition to
source code license, in order to use this software.

---------------------------------------------------
Third party Java libraries listed by License type.

PLEASE NOTE: Some dependencies may be listed under multiple licenses if they
are dual-licensed. This is especially true of anything listed as
"GNU General Public Library" below, as we actually does NOT allow for any
dependencies that are solely released under GPL terms.
---------------------------------------------------
<#list licenseMap as e>
<#assign license = e.getKey()/>
<#assign projects = e.getValue()/>
<#if projects?size &gt; 0>

${license}:

<#list projects as project>
* ${artifactFormat(project)}
</#list>
</#if>
</#list>
</#if>
45 changes: 45 additions & 0 deletions .github/LICENSE_MERGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Apache Software License, Version 2.0|The Apache Software License, Version 2.0|Apache License Version 2.0|Apache License, Version 2.0|Apache Public License 2.0|Apache License 2.0|Apache Software License - Version 2.0|Apache 2.0 License|Apache 2.0 license|Apache License V2.0|Apache 2|Apache License|Apache|ASF 2.0|Apache 2.0|Apache License v2|Apache License v2.0|Apache License, 2.0|Apache License, version 2.0|Apache-2.0|The Apache License, Version 2.0
----Ant-contrib is an Apache License------------------------------------------------------------------------------------
Apache Software License, Version 2.0|http://ant-contrib.sourceforge.net/tasks/LICENSE.txt
----XML Commons claims these licenses, but it's really Apache License: https://xerces.apache.org/xml-commons/licenses.html
Apache Software License, Version 2.0|The SAX License|The W3C License
----JDOM uses this license, but it's essentially just Apache------------------------------------------------------------
Apache Software License, Version 2.0|Similar to Apache License but with the acknowledgment clause removed 2-Clause license|3-Clause BSD License|BSD 2-Clause|BSD 3-clause New License|BSD Licence 3|BSD-2-Clause|BSD-3-Clause|Modified BSD
----Coverity uses modified BSD: https://github.com/coverity/coverity-security-library-----------------------------------
BSD License|BSD style modified by Coverity
----Jaxen claims this license, but it's really BSD: http://jaxen.codehaus.org/license.html------------------------------
BSD License|http://jaxen.codehaus.org/license.html
----Java Advanced Imaging Image I/O Tools API core is just a BSD: https://github.com/jai-imageio/jai-imageio-core/blob/master/LICENSE.txt
BSD License|BSD 3-clause License w/nuclear disclaimer
Common Development and Distribution License (CDDL)|Common Development and Distribution License (CDDL) v1.0|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0|Common Development and Distribution License|CDDL, v1.0|CDDL 1.0 license|CDDL 1.0|CDDL 1.1|CDDL|Dual license consisting of the CDDL v1.1 and GPL v2
----Jersey / Java Servlet API claims this license, but is actually CDDL 1.0: http://servlet-spec.java.net---------------
Common Development and Distribution License (CDDL)|CDDL + GPLv2 with classpath exception
----Jersey claims this license, but it is dual licensed with CDDL 1.1 being one: https://jersey.java.net/license.html---
Common Development and Distribution License (CDDL)|CDDL+GPL License
----JavaMail claims this license, but it is dual licensed with CDDL being one: https://java.net/projects/javamail/pages/License
Common Development and Distribution License (CDDL)|GPLv2+CE|CDDL/GPLv2+CE
----JAXB claims this license, but it is dual licensed with CDDL being one: https://jaxb.java.net/-----------------------
Common Development and Distribution License (CDDL)|GPL2 w/ CPE
----JBoss Transaction API claims this license, but it is dual licensed with CDDL being one: https://github.com/jboss/jboss-transaction-api_spec
Common Development and Distribution License (CDDL)|GNU General Public License, Version 2 with the Classpath Exception
Eclipse Distribution License, Version 1.0|Eclipse Distribution License (EDL), Version 1.0|Eclipse Distribution License - v 1.0|Eclipse Distribution License v. 1.0|EDL 1.0
Eclipse Public License|Eclipse Public License - Version 1.0|Eclipse Public License - v 1.0|EPL 1.0 license|Eclipse Public License (EPL), Version 1.0|Eclipse Public License 1.0|Eclipse Public License v1.0|Eclipse Public License, Version 1.0|EPL 2.0
----JUnit claims this license but is actually Eclipse Public License: http://junit.org/license.html---------------------
Eclipse Public License|Common Public License Version 1.0
----Jersey is dual licensed as EPL but lists its main license as GPL: https://github.com/eclipse-ee4j/jersey#licensing-and-governance
Eclipse Public License|The GNU General Public License (GPL), Version 2, With Classpath Exception
GNU Lesser General Public License (LGPL)|The GNU Lesser General Public License, Version 2.1|GNU Lesser General Public License (LGPL), Version 2.1|GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1|GNU Lesser General Public License, version 2.1|GNU LESSER GENERAL PUBLIC LICENSE|GNU Lesser General Public License|GNU Lesser Public License|GNU Lesser General Public License, Version 2.1|Lesser General Public License (LGPL) v 2.1|LGPL 2.1|LGPL 2.1 license|LGPL 3.0 license|LGPL, v2.1 or later|LGPL|LGPL, version 2.1|lgpl
----Hibernate ORM claims this license, but it's really regular LGPL: https://hibernate.org/community/license/-----------
GNU Lesser General Public License (LGPL)|GNU Library General Public License v2.1 or later
MIT License|The MIT License|MIT LICENSE|MIT|MIT license|MIT License (MIT)
----BouncyCastle uses an MIT-style license: https://www.bouncycastle.org/licence.html-----------------------------------
MIT License|Bouncy Castle Licence
----netCDF tools uses an MIT-style license------------------------------------------------------------------------------
MIT License|(MIT-style) netCDF C library license
Mozilla Public License|Mozilla Public License version 1.1|Mozilla Public License 1.1 (MPL 1.1)|MPL 1.1|Mozilla Public License Version 2.0
----H2 Database claims this license, but for our purposes it's MPL: http://www.h2database.com---------------------------
Mozilla Public License|MPL 2.0, and EPL 1.0
----"concurrent.concurrent" claims this license, but is actually Public Domain: http://mvnrepository.com/artifact/concurrent/concurrent/
Public Domain|Public domain, Sun Microsoystems
----WTFPL is essentially Public Domain: http://www.wtfpl.net/-----------------------------------------------------------
Public Domain|WTFPL
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins:
- "CHANGELOG.md"
- - "@semantic-release/exec"
- prepareCmd: |
./mvnw -B license:format
./mvnw -B com.mycila:license-maven-plugin:4.1:format org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party
publishCmd: |
./mvnw -B clean license:check
- - "@semantic-release/git"
Expand Down
31 changes: 31 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,29 @@
</excludes>
</configuration>
</plugin>
<plugin>
<!-- https://www.mojohaus.org/license-maven-plugin/ -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<excludedScopes>test</excludedScopes>
<includeOptional>false</includeOptional>
<outputDirectory>${project.basedir}</outputDirectory>
<thirdPartyFilename>LICENSES_THIRD_PARTY.txt</thirdPartyFilename>
<!-- For Licenses which are "Unknown" by Maven, load them from a properties file -->
<useMissingFile>true</useMissingFile>
<missingFile>.github/LICENSES_THIRD_PARTY.properties</missingFile>
<!-- License names that should all be merged into the *first* listed name -->
<licenseMergesFile>.github/LICENSE_MERGES.txt</licenseMergesFile>
<!-- Use the template which groups all dependencies by their License type (easier to read!). -->
<!-- SEE: https://github.com/mojohaus/license-maven-plugin/tree/master/src/main/resources/org/codehaus/mojo/license -->
<fileTemplate>.github/LICENSES_THIRD_PARTY_groupByLicense.ftl</fileTemplate>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<!-- JUnit is a Java testing framework.
It is optional in the workflow of deploying with maven-semantic-release. -->
Expand All @@ -212,5 +233,15 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>io.ktor</groupId>
<artifactId>ktor-server-cio</artifactId>
<version>1.6.8</version>
</dependency>
</dependencies>
</project>

0 comments on commit 478529d

Please sign in to comment.