From 85f00a7a58131060a161e907d35d1a1ce1cd7ca5 Mon Sep 17 00:00:00 2001 From: Huang Yunkun Date: Sun, 21 Apr 2019 14:56:34 +0800 Subject: [PATCH 1/5] add plugin to do dependencies check --- THIRD-PARTY.properties | 2 ++ pom.xml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 THIRD-PARTY.properties diff --git a/THIRD-PARTY.properties b/THIRD-PARTY.properties new file mode 100644 index 00000000000..d5288934143 --- /dev/null +++ b/THIRD-PARTY.properties @@ -0,0 +1,2 @@ +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 +net.jcip--jcip-annotations--1.0=BEA licensed \ No newline at end of file diff --git a/pom.xml b/pom.xml index a1f7b56820d..65a89c029e7 100644 --- a/pom.xml +++ b/pom.xml @@ -302,6 +302,42 @@ + + licenseCheck + + + + org.codehaus.mojo + license-maven-plugin + 1.20 + + + license-check + generate-sources + + aggregate-add-third-party + + + false + true + true + ${user.dir}/THIRD-PARTY.properties + + Apache License, Version 2.0|The Apache Software License, Version + 2.0|ASF 2.0|Apache 2|Apache License 2.0|The Apache License, Version 2.0 + + The MIT License|MIT License + The 3-Clause BSD License|New BSD License|3-Clause BSD + License|BSD + + + + + + + + + From 867709c4f44bcde7bd82b13b9e723d0bda5478d7 Mon Sep 17 00:00:00 2001 From: Huang Yunkun Date: Sat, 27 Apr 2019 20:12:45 +0800 Subject: [PATCH 2/5] remove third-party properties file --- THIRD-PARTY.properties | 2 -- pom.xml | 1 - 2 files changed, 3 deletions(-) delete mode 100644 THIRD-PARTY.properties diff --git a/THIRD-PARTY.properties b/THIRD-PARTY.properties deleted file mode 100644 index d5288934143..00000000000 --- a/THIRD-PARTY.properties +++ /dev/null @@ -1,2 +0,0 @@ -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 -net.jcip--jcip-annotations--1.0=BEA licensed \ No newline at end of file diff --git a/pom.xml b/pom.xml index 65a89c029e7..bb0020d22ba 100644 --- a/pom.xml +++ b/pom.xml @@ -321,7 +321,6 @@ false true true - ${user.dir}/THIRD-PARTY.properties Apache License, Version 2.0|The Apache Software License, Version 2.0|ASF 2.0|Apache 2|Apache License 2.0|The Apache License, Version 2.0 From 49c4dcd5de7056e6c8659d696eddb867f4a68b10 Mon Sep 17 00:00:00 2001 From: Huang Yunkun Date: Sat, 27 Apr 2019 20:34:51 +0800 Subject: [PATCH 3/5] polish config --- .gitignore | 5 ++- .../src/license/THIRD-PARTY.properties | 20 +++++++++ .../src/license/THIRD-PARTY.properties | 21 ++++++++++ .../src/license/THIRD-PARTY.properties | 33 +++++++++++++++ .../src/license/THIRD-PARTY.properties | 24 +++++++++++ licenseCheck.sh | 41 +++++++++++++++++++ pom.xml | 4 +- 7 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties create mode 100644 dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties create mode 100644 dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties create mode 100644 dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties create mode 100755 licenseCheck.sh diff --git a/.gitignore b/.gitignore index 0938f7891e2..89899353305 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,7 @@ Thumbs.db *.orig # flatten ignore -.flattened-pom.xml \ No newline at end of file +.flattened-pom.xml + +# license check result +license-list.txt \ No newline at end of file diff --git a/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties b/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..5fca47b51fd --- /dev/null +++ b/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties @@ -0,0 +1,20 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - 3-Clause BSD License +# - Apache License, Version 2.0 +# - Apache License, version 2.0 +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - Eclipse Public License v2.0 +# - GPL2 w/ CPE +# - LGPL 2.1 +# - MPL 1.1 +# - The 3-Clause BSD License +# - The MIT License +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:20:46 CST 2019 +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 diff --git a/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..e9b7baf77a8 --- /dev/null +++ b/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties @@ -0,0 +1,21 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - 3-Clause BSD License +# - Apache License, Version 2.0 +# - Apache Software License - Version 2.0 +# - CDDL + GPLv2 with classpath exception +# - Eclipse Public License - Version 1.0 +# - Eclipse Public License v2.0 +# - LGPL 2.1 +# - MPL 1.1 +# - Public domain +# - The 3-Clause BSD License +# - The MIT License +# - The MIT License (MIT) +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:24:22 CST 2019 +javax.portlet--portlet-api--2.0=Apache License, Version 2.0 diff --git a/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..6e35699bf5c --- /dev/null +++ b/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties @@ -0,0 +1,33 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - 3-Clause BSD License +# - Apache 2.0 +# - Apache License, Version 2.0 +# - Apache License, version 2.0 +# - Apache Software License - Version 2.0 +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - CDDL or GPLv2 with exceptions +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Common Development and Distribution License +# - Eclipse Public License - Version 1.0 +# - Eclipse Public License v2.0 +# - GNU General Public License, Version 2 with the Classpath Exception +# - GNU Lesser General Public License (LGPL), Version 2.1 +# - GPL2 w/ CPE +# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification +# License +# - LGPL 2.1 +# - MPL 1.1 +# - The 3-Clause BSD License +# - The MIT License +# - The New BSD License +# - WTFPL +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:31:46 CST 2019 +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 +net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..5110ea0e912 --- /dev/null +++ b/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties @@ -0,0 +1,24 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - 3-Clause BSD License +# - Apache License, Version 2.0 +# - Apache Software License - Version 2.0 +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - CDDL/GPLv2+CE +# - CPL +# - Eclipse Public License - Version 1.0 +# - Eclipse Public License v2.0 +# - GPL2 w/ CPE +# - LGPL 2.1 +# - MPL 1.1 +# - The 3-Clause BSD License +# - The BSD License +# - The MIT License +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:26:46 CST 2019 +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 diff --git a/licenseCheck.sh b/licenseCheck.sh new file mode 100755 index 00000000000..853f704bcb5 --- /dev/null +++ b/licenseCheck.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +APPEND_ARG="" +FOLDER="./" +LINE_FLAG="==============================================" + +if [ -n "$1" ]; then + echo "checking module $1" + APPEND_ARG="-f $1" + FOLDER="$1" +else + echo "checking whole project" +fi + +echo "Running command: ./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG" + +./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG + +status=$? +if [ $status -eq 0 ]; then + echo "mvn command exec success" +else + echo "mvn command exec fail" + exit 1 +fi + +rm -rf ./license-list.txt +LICENSE_FILES=`find $FOLDER -type f -name "THIRD-PARTY.txt"|grep generated-sources` + +echo "Find license files: \n $LICENSE_FILES" + +for i in $LICENSE_FILES + do + echo "$LINE_FLAG" >> ./license-list.txt + echo $i >> ./license-list.txt + cat $i >> ./license-list.txt + done + +echo "license files generated at ./license-list.txt" + +cat ./license-list.txt diff --git a/pom.xml b/pom.xml index bb0020d22ba..9ea623177ad 100644 --- a/pom.xml +++ b/pom.xml @@ -315,7 +315,7 @@ license-check generate-sources - aggregate-add-third-party + add-third-party false @@ -323,7 +323,7 @@ true Apache License, Version 2.0|The Apache Software License, Version - 2.0|ASF 2.0|Apache 2|Apache License 2.0|The Apache License, Version 2.0 + 2.0|ASF 2.0|Apache 2|Apache License 2.0|The Apache License, Version 2.0|The Apache Software License, Version 2.0 The MIT License|MIT License The 3-Clause BSD License|New BSD License|3-Clause BSD From 50e56131a719751e8840438ab557d201a9afa1eb Mon Sep 17 00:00:00 2001 From: Huang Yunkun Date: Sat, 27 Apr 2019 21:37:38 +0800 Subject: [PATCH 4/5] polish config --- .../src/license/THIRD-PARTY.properties | 34 ++++++++++++++++++ .../src/license/THIRD-PARTY.properties | 35 +++++++++++++++++++ pom.xml | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 dubbo-compatible/src/license/THIRD-PARTY.properties create mode 100644 dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties diff --git a/dubbo-compatible/src/license/THIRD-PARTY.properties b/dubbo-compatible/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..e627b692b38 --- /dev/null +++ b/dubbo-compatible/src/license/THIRD-PARTY.properties @@ -0,0 +1,34 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - 3-Clause BSD License +# - Apache 2.0 +# - Apache License, Version 2.0 +# - Apache License, version 2.0 +# - Apache Software License - Version 2.0 +# - BEA licensed +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - CDDL or GPLv2 with exceptions +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Common Development and Distribution License +# - Eclipse Public License - Version 1.0 +# - Eclipse Public License v2.0 +# - GNU General Public License, Version 2 with the Classpath Exception +# - GNU Lesser General Public License (LGPL), Version 2.1 +# - GPL2 w/ CPE +# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification +# License +# - LGPL 2.1 +# - MPL 1.1 +# - The 3-Clause BSD License +# - The MIT License +# - The New BSD License +# - WTFPL +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:35:39 CST 2019 +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 +net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties b/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties new file mode 100644 index 00000000000..739db1e9c63 --- /dev/null +++ b/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties @@ -0,0 +1,35 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache 2.0 +# - Apache License, Version 2.0 +# - Apache License, version 2.0 +# - Apache Software License - Version 2.0 +# - BEA licensed +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - CDDL or GPLv2 with exceptions +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Common Development and Distribution License +# - Eclipse Public License - Version 1.0 +# - Eclipse Public License - v 1.0 +# - Eclipse Public License v2.0 +# - GNU General Public License, Version 2 with the Classpath Exception +# - GNU Lesser General Public License +# - GNU Lesser General Public License (LGPL), Version 2.1 +# - GPL2 w/ CPE +# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification +# License +# - LGPL 2.1 +# - MPL 1.1 +# - The 3-Clause BSD License +# - The MIT License +# - The New BSD License +# - WTFPL +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat Apr 27 21:34:44 CST 2019 +javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 +net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/pom.xml b/pom.xml index 9ea623177ad..cdaca665d54 100644 --- a/pom.xml +++ b/pom.xml @@ -327,7 +327,7 @@ The MIT License|MIT License The 3-Clause BSD License|New BSD License|3-Clause BSD - License|BSD + License|BSD|3-Clause BSD License From 19472480fca02b478df37160dc77cf379c8b0b54 Mon Sep 17 00:00:00 2001 From: Huang Yunkun Date: Wed, 1 May 2019 19:20:30 +0800 Subject: [PATCH 5/5] use missing info in bash --- .../src/license/THIRD-PARTY.properties | 34 --------- .../src/license/THIRD-PARTY.properties | 20 ------ .../src/license/THIRD-PARTY.properties | 35 --------- .../src/license/THIRD-PARTY.properties | 21 ------ .../src/license/THIRD-PARTY.properties | 33 --------- .../src/license/THIRD-PARTY.properties | 24 ------- licenseCheck.sh | 71 ++++++++++++++++--- pom.xml | 8 +-- 8 files changed, 67 insertions(+), 179 deletions(-) delete mode 100644 dubbo-compatible/src/license/THIRD-PARTY.properties delete mode 100644 dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties delete mode 100644 dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties delete mode 100644 dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties delete mode 100644 dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties delete mode 100644 dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties diff --git a/dubbo-compatible/src/license/THIRD-PARTY.properties b/dubbo-compatible/src/license/THIRD-PARTY.properties deleted file mode 100644 index e627b692b38..00000000000 --- a/dubbo-compatible/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - 3-Clause BSD License -# - Apache 2.0 -# - Apache License, Version 2.0 -# - Apache License, version 2.0 -# - Apache Software License - Version 2.0 -# - BEA licensed -# - CDDL + GPLv2 with classpath exception -# - CDDL 1.1 -# - CDDL or GPLv2 with exceptions -# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -# - Common Development and Distribution License -# - Eclipse Public License - Version 1.0 -# - Eclipse Public License v2.0 -# - GNU General Public License, Version 2 with the Classpath Exception -# - GNU Lesser General Public License (LGPL), Version 2.1 -# - GPL2 w/ CPE -# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification -# License -# - LGPL 2.1 -# - MPL 1.1 -# - The 3-Clause BSD License -# - The MIT License -# - The New BSD License -# - WTFPL -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:35:39 CST 2019 -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 -net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties b/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties deleted file mode 100644 index 5fca47b51fd..00000000000 --- a/dubbo-filter/dubbo-filter-validation/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - 3-Clause BSD License -# - Apache License, Version 2.0 -# - Apache License, version 2.0 -# - CDDL + GPLv2 with classpath exception -# - CDDL 1.1 -# - Eclipse Public License v2.0 -# - GPL2 w/ CPE -# - LGPL 2.1 -# - MPL 1.1 -# - The 3-Clause BSD License -# - The MIT License -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:20:46 CST 2019 -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 diff --git a/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties b/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties deleted file mode 100644 index 739db1e9c63..00000000000 --- a/dubbo-registry/dubbo-registry-nacos/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - Apache 2.0 -# - Apache License, Version 2.0 -# - Apache License, version 2.0 -# - Apache Software License - Version 2.0 -# - BEA licensed -# - CDDL + GPLv2 with classpath exception -# - CDDL 1.1 -# - CDDL or GPLv2 with exceptions -# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -# - Common Development and Distribution License -# - Eclipse Public License - Version 1.0 -# - Eclipse Public License - v 1.0 -# - Eclipse Public License v2.0 -# - GNU General Public License, Version 2 with the Classpath Exception -# - GNU Lesser General Public License -# - GNU Lesser General Public License (LGPL), Version 2.1 -# - GPL2 w/ CPE -# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification -# License -# - LGPL 2.1 -# - MPL 1.1 -# - The 3-Clause BSD License -# - The MIT License -# - The New BSD License -# - WTFPL -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:34:44 CST 2019 -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 -net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties deleted file mode 100644 index e9b7baf77a8..00000000000 --- a/dubbo-rpc/dubbo-rpc-jsonrpc/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - 3-Clause BSD License -# - Apache License, Version 2.0 -# - Apache Software License - Version 2.0 -# - CDDL + GPLv2 with classpath exception -# - Eclipse Public License - Version 1.0 -# - Eclipse Public License v2.0 -# - LGPL 2.1 -# - MPL 1.1 -# - Public domain -# - The 3-Clause BSD License -# - The MIT License -# - The MIT License (MIT) -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:24:22 CST 2019 -javax.portlet--portlet-api--2.0=Apache License, Version 2.0 diff --git a/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties deleted file mode 100644 index 6e35699bf5c..00000000000 --- a/dubbo-rpc/dubbo-rpc-rest/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - 3-Clause BSD License -# - Apache 2.0 -# - Apache License, Version 2.0 -# - Apache License, version 2.0 -# - Apache Software License - Version 2.0 -# - CDDL + GPLv2 with classpath exception -# - CDDL 1.1 -# - CDDL or GPLv2 with exceptions -# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -# - Common Development and Distribution License -# - Eclipse Public License - Version 1.0 -# - Eclipse Public License v2.0 -# - GNU General Public License, Version 2 with the Classpath Exception -# - GNU Lesser General Public License (LGPL), Version 2.1 -# - GPL2 w/ CPE -# - JSR-000107 JCACHE 2.9 Public Review - Updated Specification -# License -# - LGPL 2.1 -# - MPL 1.1 -# - The 3-Clause BSD License -# - The MIT License -# - The New BSD License -# - WTFPL -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:31:46 CST 2019 -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 -net.jcip--jcip-annotations--1.0=BEA licensed diff --git a/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties b/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties deleted file mode 100644 index 5110ea0e912..00000000000 --- a/dubbo-rpc/dubbo-rpc-webservice/src/license/THIRD-PARTY.properties +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by org.codehaus.mojo.license.AddThirdPartyMojo -#------------------------------------------------------------------------------- -# Already used licenses in project : -# - 3-Clause BSD License -# - Apache License, Version 2.0 -# - Apache Software License - Version 2.0 -# - CDDL + GPLv2 with classpath exception -# - CDDL 1.1 -# - CDDL/GPLv2+CE -# - CPL -# - Eclipse Public License - Version 1.0 -# - Eclipse Public License v2.0 -# - GPL2 w/ CPE -# - LGPL 2.1 -# - MPL 1.1 -# - The 3-Clause BSD License -# - The BSD License -# - The MIT License -#------------------------------------------------------------------------------- -# Please fill the missing licenses for dependencies : -# -# -#Sat Apr 27 21:26:46 CST 2019 -javax.xml.bind--jsr173_api--1.0=Apache License, Version 2.0 diff --git a/licenseCheck.sh b/licenseCheck.sh index 853f704bcb5..9992f10040e 100755 --- a/licenseCheck.sh +++ b/licenseCheck.sh @@ -3,6 +3,12 @@ APPEND_ARG="" FOLDER="./" LINE_FLAG="==============================================" +TARGET_FILE="./license-list.txt" + +red=`tput setaf 1` +green=`tput setaf 2` +reset=`tput sgr0` + if [ -n "$1" ]; then echo "checking module $1" @@ -20,22 +26,71 @@ status=$? if [ $status -eq 0 ]; then echo "mvn command exec success" else - echo "mvn command exec fail" + echo "${red}mvn command exec fail${reset}" exit 1 fi -rm -rf ./license-list.txt + +#contact and generate license file +rm -rf $TARGET_FILE LICENSE_FILES=`find $FOLDER -type f -name "THIRD-PARTY.txt"|grep generated-sources` -echo "Find license files: \n $LICENSE_FILES" +echo "Find license files:" +echo "$LICENSE_FILES" for i in $LICENSE_FILES do - echo "$LINE_FLAG" >> ./license-list.txt - echo $i >> ./license-list.txt - cat $i >> ./license-list.txt + echo "$LINE_FLAG" >> $TARGET_FILE + echo $i >> $TARGET_FILE + cat $i >> $TARGET_FILE done -echo "license files generated at ./license-list.txt" +echo "license files generated at $TARGET_FILE" + +#fix missing license dependencies +missingLicense=( + "(Unknown license) jsr173_api:(Apache License, Version 2.0) jsr173_api" + "(Unknown license) \"Java Concurrency in Practice\" book annotations:(BEA licensed) \"Java Concurrency in Practice\" book annotations" + "(Unknown license) Java Portlet Specification V2.0:(Apache License, Version 2.0) Java Portlet Specification V2.0" +) + +for i in "${missingLicense[@]}"; do + search=`echo $i |awk -F: '{print $1}'` + replace=`echo $i |awk -F: '{print $2}'` + sed -i -e 's/'"$search"'/'"$replace"'/g' $TARGET_FILE +done + +check_unknown_license=`cat $TARGET_FILE | grep "Unknown license"` -cat ./license-list.txt +#checking unknown license +if grep -q "Unknown license" $TARGET_FILE +then + echo "${red}Find unknown license${reset}" + echo "$check_unknown_license" + exit 1 +fi + +allowLicense=( + "CDDL" + "Apache" + "Common Development and Distribution License" + "Eclipse Public License" + "MIT" + "The 3-Clause BSD License" + "Public domain" +) + +#filter allow license +license_need_check=`cat $TARGET_FILE | grep -v "generated-sources/license/THIRD-PARTY.txt" | grep -v "third-party dependencies" | grep -v $LINE_FLAG` + +for i in "${allowLicense[@]}"; do + license_need_check=`echo "$license_need_check"|grep -vi "$i"` +done + +if test -z "$license_need_check" +then + echo "${green}All dependencies license looks good${reset}" +else + echo "${red}Please check below license${reset}" + echo "$license_need_check" +fi \ No newline at end of file diff --git a/pom.xml b/pom.xml index cdaca665d54..e9a1661e033 100644 --- a/pom.xml +++ b/pom.xml @@ -319,15 +319,15 @@ false - true - true + false + false Apache License, Version 2.0|The Apache Software License, Version - 2.0|ASF 2.0|Apache 2|Apache License 2.0|The Apache License, Version 2.0|The Apache Software License, Version 2.0 + 2.0|ASF 2.0|Apache 2|Apache-2.0|Apache 2.0 License|Apache 2.0|Apache License v2.0|Apache License 2.0|The Apache License, Version 2.0|The Apache Software License, Version 2.0 The MIT License|MIT License The 3-Clause BSD License|New BSD License|3-Clause BSD - License|BSD|3-Clause BSD License + License|BSD|3-Clause BSD License|The New BSD License