AsterixDB & Hyracks Source Assemblies, Licensing
- ASTERIXDB-1319: AsterixDB source release LICENSE issues
- Generate Asterix & Hyracks source assemblies as part of the build
- Generate LICENSE & NOTICE file for above assemblies into source tree.
- Move license automation plugin to Hyracks
Change-Id: I8bd8694ad85f25f9b61182ec18fdc39f74480685
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1439
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
diff --git a/hyracks-fullstack/LICENSE b/hyracks-fullstack/LICENSE
index e8ff1e1..fa9d611 100644
--- a/hyracks-fullstack/LICENSE
+++ b/hyracks-fullstack/LICENSE
@@ -1,4 +1,3 @@
-
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -200,17 +199,17 @@
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.
+===
+ AsterixDB Hyracks includes source code with separate copyright notices
+ and license terms. Your use of this source code is subject to the terms
+ and condition of the following licenses.
+===
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/flot/
-ASTERIXDB COMPONENTS:
-
-AsterixDB includes a number of subcomponents with separate copyright
-notices and license terms. Your use of the source code for these
-subcomponents is subject to the terms and condition of the following
-licenses.
-
-For portions of the Hyracks admin console at
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/flot/
-
+ are available under The MIT License:
+---
Copyright (c) 2007-2014 IOLA and Ole Laursen
Permission is hereby granted, free of charge, to any person
@@ -233,10 +232,13 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+---
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jsplumb/
-As well as the Hyracks adminconsole resources at:
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jsplumb/
-
+ are available under The MIT License:
+---
Copyright (c) 2010 - 2014 jsPlumb, http://jsplumbtoolkit.com/
Permission is hereby granted, free of charge, to any person obtaining
@@ -257,12 +259,15 @@
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+---
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery,
+ and
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery-ui
-and also the Hyracks adminconsole resources at:
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery
-and
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/stylesheet/jquery-ui
-
+ are available under The MIT License:
+---
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
@@ -299,20 +304,25 @@
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
+---
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery/plugins/jquery.getParams.js
-and also the Hyracks adminconsole resource at:
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery/plugins/jquery.getParams.js
-
-
+ are available under The MIT License:
+---
Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
+---
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery/plugins/jquery.timer.js
-and also the Hyracks adminconsole resource at:
-hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/jquery/plugins/jquery.timer.js
-
+ are available under The MIT License:
+---
jquery.timer.js
Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
@@ -338,309 +348,341 @@
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+---
+ Portions of the Hyracks admin console
+ located at:
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/stylesheet/json.human.css,
+ and
+ hyracks/hyracks-control/hyracks-control-cc/src/main/resources/static/javascript/adminconsole/json.human.js
-also the test data for the Hyracks textserver examples at
-hyracks/hyracks-examples/text-example/textserver/data/file1.txt and
-hyracks/hyracks-examples/text-example/textserver/data/file2.txt
+ are available under The MIT License:
+---
+ Copyright (c) 2015, Mariano Guerra
-THE FULL PROJECT GUTENBERG LICENSE
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
-PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
-To protect the Project Gutenberg-tm mission of promoting the free distribution
-of electronic works, by using or distributing this work (or any other work
-associated in any way with the phrase "Project Gutenberg"), you agree to comply
-with all the terms of the Full Project Gutenberg-tm License available with this
-file or online at www.gutenberg.org/license.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+---
+ Portions of the test data for the Hyracks textserver examples
+ located at:
+ hyracks/hyracks-examples/text-example/textserver/data/file1.txt,
+ and
+ hyracks/hyracks-examples/text-example/textserver/data/file2.txt
-Section 1.
-General Terms of Use and Redistributing Project Gutenberg-tm electronic works
+ are available under the following license:
+---
+ THE FULL PROJECT GUTENBERG LICENSE
-1.A. By reading or using any part of this Project Gutenberg-tm
-electronic work, you indicate that you have read, understand, agree to and
-accept all the terms of this license and intellectual property
-(trademark/copyright) agreement. If you do not agree to abide by all the terms
-of this agreement, you must cease using and return or destroy all copies of
-Project Gutenberg-tm electronic works in your possession. If you paid a fee for
-obtaining a copy of or access to a Project Gutenberg-tm electronic work and you
-do not agree to be bound by the terms of this agreement, you may obtain a
-refund from the person or entity to whom you paid the fee as set forth in
-paragraph 1.E.8.
+ PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
-1.B. "Project Gutenberg" is a registered trademark. It may only be used on or
-associated in any way with an electronic work by people who agree to be bound
-by the terms of this agreement. There are a few things that you can do with
-most Project Gutenberg-tm electronic works even without complying with the full
-terms of this agreement. See paragraph 1.C below. There are a lot of things you
-can do with Project Gutenberg-tm electronic works if you follow the terms of
-this agreement and help preserve free future access to Project Gutenberg-tm
-electronic works. See paragraph 1.E below.
+ To protect the Project Gutenberg-tm mission of promoting the free distribution
+ of electronic works, by using or distributing this work (or any other work
+ associated in any way with the phrase "Project Gutenberg"), you agree to comply
+ with all the terms of the Full Project Gutenberg-tm License available with this
+ file or online at www.gutenberg.org/license.
-1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" or
-PGLAF), owns a compilation copyright in the collection of Project Gutenberg-tm
-electronic works. Nearly all the individual works in the collection are in the
-public domain in the United States. If an individual work is unprotected by
-copyright law in the United States and you are located in the United States, we
-do not claim a right to prevent you from copying, distributing, performing,
-displaying or creating derivative works based on the work as long as all
-references to Project Gutenberg are removed. Of course, we hope that you will
-support the Project Gutenberg-tm mission of promoting free access to electronic
-works by freely sharing Project Gutenberg-tm works in compliance with the terms
-of this agreement for keeping the Project Gutenberg-tm name associated with the
-work. You can easily comply with the terms of this agreement by keeping this
-work in the same format with its attached full Project Gutenberg-tm License
-when you share it without charge with others.
+ Section 1.
+ General Terms of Use and Redistributing Project Gutenberg-tm electronic works
-[*] This particular work is one of the few individual works protected by
-copyright law in the United States and most of the remainder of the world,
-included in the Project Gutenberg collection with the permission of the
-copyright holder. Information on the copyright owner for this particular work
-and the terms of use imposed by the copyright holder on this work are set forth
-at the beginning of this work.
+ 1.A. By reading or using any part of this Project Gutenberg-tm
+ electronic work, you indicate that you have read, understand, agree to and
+ accept all the terms of this license and intellectual property
+ (trademark/copyright) agreement. If you do not agree to abide by all the terms
+ of this agreement, you must cease using and return or destroy all copies of
+ Project Gutenberg-tm electronic works in your possession. If you paid a fee for
+ obtaining a copy of or access to a Project Gutenberg-tm electronic work and you
+ do not agree to be bound by the terms of this agreement, you may obtain a
+ refund from the person or entity to whom you paid the fee as set forth in
+ paragraph 1.E.8.
-1.D. The copyright laws of the place where you are located also govern what you
-can do with this work. Copyright laws in most countries are in a constant state
-of change. If you are outside the United States, check the laws of your country
-in addition to the terms of this agreement before downloading, copying,
-displaying, performing, distributing or creating derivative works based on this
-work or any other Project Gutenberg-tm work. The Foundation makes no
-representations concerning the copyright status of any work in any country
-outside the United States.
+ 1.B. "Project Gutenberg" is a registered trademark. It may only be used on or
+ associated in any way with an electronic work by people who agree to be bound
+ by the terms of this agreement. There are a few things that you can do with
+ most Project Gutenberg-tm electronic works even without complying with the full
+ terms of this agreement. See paragraph 1.C below. There are a lot of things you
+ can do with Project Gutenberg-tm electronic works if you follow the terms of
+ this agreement and help preserve free future access to Project Gutenberg-tm
+ electronic works. See paragraph 1.E below.
-1.E. Unless you have removed all references to Project Gutenberg:
+ 1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" or
+ PGLAF), owns a compilation copyright in the collection of Project Gutenberg-tm
+ electronic works. Nearly all the individual works in the collection are in the
+ public domain in the United States. If an individual work is unprotected by
+ copyright law in the United States and you are located in the United States, we
+ do not claim a right to prevent you from copying, distributing, performing,
+ displaying or creating derivative works based on the work as long as all
+ references to Project Gutenberg are removed. Of course, we hope that you will
+ support the Project Gutenberg-tm mission of promoting free access to electronic
+ works by freely sharing Project Gutenberg-tm works in compliance with the terms
+ of this agreement for keeping the Project Gutenberg-tm name associated with the
+ work. You can easily comply with the terms of this agreement by keeping this
+ work in the same format with its attached full Project Gutenberg-tm License
+ when you share it without charge with others.
-1.E.1. The following sentence, with active links to, or other immediate access
-to, the full Project Gutenberg-tm License must appear prominently whenever any
-copy of a Project Gutenberg-tm work (any work on which the phrase "Project
-Gutenberg" appears, or with which the phrase "Project Gutenberg" is associated)
-is accessed, displayed, performed, viewed, copied or distributed:
+ [*] This particular work is one of the few individual works protected by
+ copyright law in the United States and most of the remainder of the world,
+ included in the Project Gutenberg collection with the permission of the
+ copyright holder. Information on the copyright owner for this particular work
+ and the terms of use imposed by the copyright holder on this work are set forth
+ at the beginning of this work.
-This eBook is for the use of anyone anywhere in the United States and most
-other parts of the world at no cost and with almost no restrictions whatsoever.
-You may copy it, give it away or re-use it under the terms of the Project
-Gutenberg License included with this eBook or online at www.gutenberg.org. If
-you are not located in the United States, you'll have to check the laws of the
-country where you are located before using this ebook.
+ 1.D. The copyright laws of the place where you are located also govern what you
+ can do with this work. Copyright laws in most countries are in a constant state
+ of change. If you are outside the United States, check the laws of your country
+ in addition to the terms of this agreement before downloading, copying,
+ displaying, performing, distributing or creating derivative works based on this
+ work or any other Project Gutenberg-tm work. The Foundation makes no
+ representations concerning the copyright status of any work in any country
+ outside the United States.
-1.E.2. If an individual Project Gutenberg-tm electronic work is derived from
-texts not protected by U.S. copyright law (does not contain a notice indicating
-that it is posted with permission of the copyright holder), the work can be
-copied and distributed to anyone in the United States without paying any fees
-or charges. If you are redistributing or providing access to a work with the
-phrase "Project Gutenberg" associated with or appearing on the work, you must
-comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain
-permission for the use of the work and the Project Gutenberg-tm trademark as
-set forth in paragraphs 1.E.8 or 1.E.9.
+ 1.E. Unless you have removed all references to Project Gutenberg:
-1.E.3. If an individual Project Gutenberg-tm electronic work is posted with the
-permission of the copyright holder, your use and distribution must comply with
-both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the
-copyright holder. Additional terms will be linked to the Project Gutenberg-tm
-License for all works posted with the permission of the copyright holder found
-at the beginning of this work.
+ 1.E.1. The following sentence, with active links to, or other immediate access
+ to, the full Project Gutenberg-tm License must appear prominently whenever any
+ copy of a Project Gutenberg-tm work (any work on which the phrase "Project
+ Gutenberg" appears, or with which the phrase "Project Gutenberg" is associated)
+ is accessed, displayed, performed, viewed, copied or distributed:
-1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm License
-terms from this work, or any files containing a part of this work or any other
-work associated with Project Gutenberg-tm.
+ This eBook is for the use of anyone anywhere in the United States and most
+ other parts of the world at no cost and with almost no restrictions whatsoever.
+ You may copy it, give it away or re-use it under the terms of the Project
+ Gutenberg License included with this eBook or online at www.gutenberg.org. If
+ you are not located in the United States, you'll have to check the laws of the
+ country where you are located before using this ebook.
-1.E.5. Do not copy, display, perform, distribute or redistribute this
-electronic work, or any part of this electronic work, without prominently
-displaying the sentence set forth in paragraph 1.E.1 with active links or
-immediate access to the full terms of the Project Gutenberg-tm License.
+ 1.E.2. If an individual Project Gutenberg-tm electronic work is derived from
+ texts not protected by U.S. copyright law (does not contain a notice indicating
+ that it is posted with permission of the copyright holder), the work can be
+ copied and distributed to anyone in the United States without paying any fees
+ or charges. If you are redistributing or providing access to a work with the
+ phrase "Project Gutenberg" associated with or appearing on the work, you must
+ comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain
+ permission for the use of the work and the Project Gutenberg-tm trademark as
+ set forth in paragraphs 1.E.8 or 1.E.9.
-1.E.6. You may convert to and distribute this work in any binary, compressed,
-marked up, nonproprietary or proprietary form, including any word processing or
-hypertext form. However, if you provide access to or distribute copies of a
-Project Gutenberg-tm work in a format other than "Plain Vanilla ASCII" or other
-format used in the official version posted on the official Project Gutenberg-tm
-web site (www.gutenberg.org), you must, at no additional cost, fee or expense
-to the user, provide a copy, a means of exporting a copy, or a means of
-obtaining a copy upon request, of the work in its original "Plain Vanilla
-ASCII" or other form. Any alternate format must include the full Project
-Gutenberg-tm License as specified in paragraph 1.E.1.
+ 1.E.3. If an individual Project Gutenberg-tm electronic work is posted with the
+ permission of the copyright holder, your use and distribution must comply with
+ both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the
+ copyright holder. Additional terms will be linked to the Project Gutenberg-tm
+ License for all works posted with the permission of the copyright holder found
+ at the beginning of this work.
-1.E.7. Do not charge a fee for access to, viewing, displaying, performing,
-copying or distributing any Project Gutenberg-tm works unless you comply with
-paragraph 1.E.8 or 1.E.9.
+ 1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm License
+ terms from this work, or any files containing a part of this work or any other
+ work associated with Project Gutenberg-tm.
-1.E.8. You may charge a reasonable fee for copies of or providing access to or
-distributing Project Gutenberg-tm electronic works provided that
+ 1.E.5. Do not copy, display, perform, distribute or redistribute this
+ electronic work, or any part of this electronic work, without prominently
+ displaying the sentence set forth in paragraph 1.E.1 with active links or
+ immediate access to the full terms of the Project Gutenberg-tm License.
-You pay a royalty fee of 20% of the gross profits you derive from the use of
-Project Gutenberg-tm works calculated using the method you already use to
-calculate your applicable taxes. The fee is owed to the owner of the Project
-Gutenberg-tm trademark, but he has agreed to donate royalties under this
-paragraph to the Project Gutenberg Literary Archive Foundation. Royalty
-payments must be paid within 60 days following each date on which you prepare
-(or are legally required to prepare) your periodic tax returns. Royalty
-payments should be clearly marked as such and sent to the Project Gutenberg
-Literary Archive Foundation at the address specified in Section 4, "Information
-about donations to the Project Gutenberg Literary Archive Foundation." You
-provide a full refund of any money paid by a user who notifies you in writing
-(or by e-mail) within 30 days of receipt that s/he does not agree to the terms
-of the full Project Gutenberg-tm License. You must require such a user to
-return or destroy all copies of the works possessed in a physical medium and
-discontinue all use of and all access to other copies of Project Gutenberg-tm
-works. You provide, in accordance with paragraph 1.F.3, a full refund of any
-money paid for a work or a replacement copy, if a defect in the electronic work
-is discovered and reported to you within 90 days of receipt of the work. You
-comply with all other terms of this agreement for free distribution of Project
-Gutenberg-tm works. 1.E.9. If you wish to charge a fee or distribute a Project
-Gutenberg-tm electronic work or group of works on different terms than are set
-forth in this agreement, you must obtain permission in writing from both the
-Project Gutenberg Literary Archive Foundation and The Project Gutenberg
-Trademark LLC, the owner of the Project Gutenberg-tm trademark. Contact the
-Foundation as set forth in Section 3 below.
+ 1.E.6. You may convert to and distribute this work in any binary, compressed,
+ marked up, nonproprietary or proprietary form, including any word processing or
+ hypertext form. However, if you provide access to or distribute copies of a
+ Project Gutenberg-tm work in a format other than "Plain Vanilla ASCII" or other
+ format used in the official version posted on the official Project Gutenberg-tm
+ web site (www.gutenberg.org), you must, at no additional cost, fee or expense
+ to the user, provide a copy, a means of exporting a copy, or a means of
+ obtaining a copy upon request, of the work in its original "Plain Vanilla
+ ASCII" or other form. Any alternate format must include the full Project
+ Gutenberg-tm License as specified in paragraph 1.E.1.
-1.F.
+ 1.E.7. Do not charge a fee for access to, viewing, displaying, performing,
+ copying or distributing any Project Gutenberg-tm works unless you comply with
+ paragraph 1.E.8 or 1.E.9.
-1.F.1. Project Gutenberg volunteers and employees expend considerable effort to
-identify, do copyright research on, transcribe and proofread works not
-protected by U.S. copyright law in creating the Project Gutenberg-tm
-collection. Despite these efforts, Project Gutenberg-tm electronic works, and
-the medium on which they may be stored, may contain "Defects," such as, but not
-limited to, incomplete, inaccurate or corrupt data, transcription errors, a
-copyright or other intellectual property infringement, a defective or damaged
-disk or other medium, a computer virus, or computer codes that damage or cannot
-be read by your equipment.
+ 1.E.8. You may charge a reasonable fee for copies of or providing access to or
+ distributing Project Gutenberg-tm electronic works provided that
-1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right of
-Replacement or Refund" described in paragraph 1.F.3, the Project Gutenberg
-Literary Archive Foundation, the owner of the Project Gutenberg-tm trademark,
-and any other party distributing a Project Gutenberg-tm electronic work under
-this agreement, disclaim all liability to you for damages, costs and expenses,
-including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
-STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
-PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
-OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
-ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
-YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
+ You pay a royalty fee of 20% of the gross profits you derive from the use of
+ Project Gutenberg-tm works calculated using the method you already use to
+ calculate your applicable taxes. The fee is owed to the owner of the Project
+ Gutenberg-tm trademark, but he has agreed to donate royalties under this
+ paragraph to the Project Gutenberg Literary Archive Foundation. Royalty
+ payments must be paid within 60 days following each date on which you prepare
+ (or are legally required to prepare) your periodic tax returns. Royalty
+ payments should be clearly marked as such and sent to the Project Gutenberg
+ Literary Archive Foundation at the address specified in Section 4, "Information
+ about donations to the Project Gutenberg Literary Archive Foundation." You
+ provide a full refund of any money paid by a user who notifies you in writing
+ (or by e-mail) within 30 days of receipt that s/he does not agree to the terms
+ of the full Project Gutenberg-tm License. You must require such a user to
+ return or destroy all copies of the works possessed in a physical medium and
+ discontinue all use of and all access to other copies of Project Gutenberg-tm
+ works. You provide, in accordance with paragraph 1.F.3, a full refund of any
+ money paid for a work or a replacement copy, if a defect in the electronic work
+ is discovered and reported to you within 90 days of receipt of the work. You
+ comply with all other terms of this agreement for free distribution of Project
+ Gutenberg-tm works. 1.E.9. If you wish to charge a fee or distribute a Project
+ Gutenberg-tm electronic work or group of works on different terms than are set
+ forth in this agreement, you must obtain permission in writing from both the
+ Project Gutenberg Literary Archive Foundation and The Project Gutenberg
+ Trademark LLC, the owner of the Project Gutenberg-tm trademark. Contact the
+ Foundation as set forth in Section 3 below.
-1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in
-this electronic work within 90 days of receiving it, you can receive a refund
-of the money (if any) you paid for it by sending a written explanation to the
-person you received the work from. If you received the work on a physical
-medium, you must return the medium with your written explanation. The person or
-entity that provided you with the defective work may elect to provide a
-replacement copy in lieu of a refund. If you received the work electronically,
-the person or entity providing it to you may choose to give you a second
-opportunity to receive the work electronically in lieu of a refund. If the
-second copy is also defective, you may demand a refund in writing without
-further opportunities to fix the problem.
+ 1.F.
-1.F.4. Except for the limited right of replacement or refund set forth in
-paragraph 1.F.3, this work is provided to you 'AS-IS', WITH NO OTHER WARRANTIES
-OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
+ 1.F.1. Project Gutenberg volunteers and employees expend considerable effort to
+ identify, do copyright research on, transcribe and proofread works not
+ protected by U.S. copyright law in creating the Project Gutenberg-tm
+ collection. Despite these efforts, Project Gutenberg-tm electronic works, and
+ the medium on which they may be stored, may contain "Defects," such as, but not
+ limited to, incomplete, inaccurate or corrupt data, transcription errors, a
+ copyright or other intellectual property infringement, a defective or damaged
+ disk or other medium, a computer virus, or computer codes that damage or cannot
+ be read by your equipment.
-1.F.5. Some states do not allow disclaimers of certain implied warranties or
-the exclusion or limitation of certain types of damages. If any disclaimer or
-limitation set forth in this agreement violates the law of the state applicable
-to this agreement, the agreement shall be interpreted to make the maximum
-disclaimer or limitation permitted by the applicable state law. The invalidity
-or unenforceability of any provision of this agreement shall not void the
-remaining provisions.
+ 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right of
+ Replacement or Refund" described in paragraph 1.F.3, the Project Gutenberg
+ Literary Archive Foundation, the owner of the Project Gutenberg-tm trademark,
+ and any other party distributing a Project Gutenberg-tm electronic work under
+ this agreement, disclaim all liability to you for damages, costs and expenses,
+ including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
+ STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
+ PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
+ OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
+ ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
+ YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
-1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the
-trademark owner, any agent or employee of the Foundation, anyone providing
-copies of Project Gutenberg-tm electronic works in accordance with this
-agreement, and any volunteers associated with the production, promotion and
-distribution of Project Gutenberg-tm electronic works, harmless from all
-liability, costs and expenses, including legal fees, that arise directly or
-indirectly from any of the following which you do or cause to occur: (a)
-distribution of this or any Project Gutenberg-tm work, (b) alteration,
-modification, or additions or deletions to any Project Gutenberg-tm work, and
-(c) any Defect you cause.
+ 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in
+ this electronic work within 90 days of receiving it, you can receive a refund
+ of the money (if any) you paid for it by sending a written explanation to the
+ person you received the work from. If you received the work on a physical
+ medium, you must return the medium with your written explanation. The person or
+ entity that provided you with the defective work may elect to provide a
+ replacement copy in lieu of a refund. If you received the work electronically,
+ the person or entity providing it to you may choose to give you a second
+ opportunity to receive the work electronically in lieu of a refund. If the
+ second copy is also defective, you may demand a refund in writing without
+ further opportunities to fix the problem.
-Section 2.
-Information about the Mission of Project Gutenberg-tm Project
+ 1.F.4. Except for the limited right of replacement or refund set forth in
+ paragraph 1.F.3, this work is provided to you 'AS-IS', WITH NO OTHER WARRANTIES
+ OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
-Gutenberg-tm is synonymous with the free distribution of electronic works in
-formats readable by the widest variety of computers including obsolete, old,
-middle-aged and new computers. It exists because of the efforts of hundreds of
-volunteers and donations from people in all walks of life.
+ 1.F.5. Some states do not allow disclaimers of certain implied warranties or
+ the exclusion or limitation of certain types of damages. If any disclaimer or
+ limitation set forth in this agreement violates the law of the state applicable
+ to this agreement, the agreement shall be interpreted to make the maximum
+ disclaimer or limitation permitted by the applicable state law. The invalidity
+ or unenforceability of any provision of this agreement shall not void the
+ remaining provisions.
-Volunteers and financial support to provide volunteers with the assistance they
-need are critical to reaching Project Gutenberg-tm's goals and ensuring that
-the Project Gutenberg-tm collection will remain freely available for
-generations to come. In 2001, the Project Gutenberg Literary Archive Foundation
-was created to provide a secure and permanent future for Project Gutenberg-tm
-and future generations. To learn more about the Project Gutenberg Literary
-Archive Foundation and how your efforts and donations can help, see Sections 3
-and 4 and the Foundation information page at www.gutenberg.org
+ 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the
+ trademark owner, any agent or employee of the Foundation, anyone providing
+ copies of Project Gutenberg-tm electronic works in accordance with this
+ agreement, and any volunteers associated with the production, promotion and
+ distribution of Project Gutenberg-tm electronic works, harmless from all
+ liability, costs and expenses, including legal fees, that arise directly or
+ indirectly from any of the following which you do or cause to occur: (a)
+ distribution of this or any Project Gutenberg-tm work, (b) alteration,
+ modification, or additions or deletions to any Project Gutenberg-tm work, and
+ (c) any Defect you cause.
-Section 3.
-Information about the Project Gutenberg Literary Archive Foundation
+ Section 2.
+ Information about the Mission of Project Gutenberg-tm Project
-The Project Gutenberg Literary Archive Foundation is a non profit 501(c)(3)
-educational corporation organized under the laws of the state of Mississippi
-and granted tax exempt status by the Internal Revenue Service. The Foundation's
-EIN or federal tax identification number is 64-6221541. Contributions to the
-Project Gutenberg Literary Archive Foundation are tax deductible to the full
-extent permitted by U.S. federal laws and your state's laws.
+ Gutenberg-tm is synonymous with the free distribution of electronic works in
+ formats readable by the widest variety of computers including obsolete, old,
+ middle-aged and new computers. It exists because of the efforts of hundreds of
+ volunteers and donations from people in all walks of life.
-The Foundation's principal office is located at 4557 Melan Dr. S. Fairbanks,
-AK, 99712., but its volunteers and employees are scattered throughout numerous
-locations. Its business office is located at 809 North 1500 West, Salt Lake
-City, UT 84116, (801) 596-1887. Email contact links and up to date contact
-information can be found at the Foundation's web site and official page at
-www.gutenberg.org/contact
+ Volunteers and financial support to provide volunteers with the assistance they
+ need are critical to reaching Project Gutenberg-tm's goals and ensuring that
+ the Project Gutenberg-tm collection will remain freely available for
+ generations to come. In 2001, the Project Gutenberg Literary Archive Foundation
+ was created to provide a secure and permanent future for Project Gutenberg-tm
+ and future generations. To learn more about the Project Gutenberg Literary
+ Archive Foundation and how your efforts and donations can help, see Sections 3
+ and 4 and the Foundation information page at www.gutenberg.org
-For additional contact information:
- Dr. Gregory B. Newby Chief Executive and Director
- gbnewby@pglaf.org
+ Section 3.
+ Information about the Project Gutenberg Literary Archive Foundation
-Section 4.
-Information about Donations to the Project Gutenberg Literary Archive
+ The Project Gutenberg Literary Archive Foundation is a non profit 501(c)(3)
+ educational corporation organized under the laws of the state of Mississippi
+ and granted tax exempt status by the Internal Revenue Service. The Foundation's
+ EIN or federal tax identification number is 64-6221541. Contributions to the
+ Project Gutenberg Literary Archive Foundation are tax deductible to the full
+ extent permitted by U.S. federal laws and your state's laws.
-Foundation Project Gutenberg-tm depends upon and cannot survive without
-wide spread public support and donations to carry out its mission of
-increasing the number of public domain and licensed works that can be
-freely distributed in machine readable form accessible by the widest array
-of equipment including outdated equipment. Many small donations ($1 to
-$5,000) are particularly important to maintaining tax exempt status with
-the IRS.
+ The Foundation's principal office is located at 4557 Melan Dr. S. Fairbanks,
+ AK, 99712., but its volunteers and employees are scattered throughout numerous
+ locations. Its business office is located at 809 North 1500 West, Salt Lake
+ City, UT 84116, (801) 596-1887. Email contact links and up to date contact
+ information can be found at the Foundation's web site and official page at
+ www.gutenberg.org/contact
-The Foundation is committed to complying with the laws regulating charities and
-charitable donations in all 50 states of the United States. Compliance
-requirements are not uniform and it takes a considerable effort, much paperwork
-and many fees to meet and keep up with these requirements. We do not solicit
-donations in locations where we have not received written confirmation of
-compliance. To SEND DONATIONS or determine the status of compliance for any
-particular state visit www.gutenberg.org/donate
+ For additional contact information:
+ Dr. Gregory B. Newby Chief Executive and Director
+ gbnewby@pglaf.org
-While we cannot and do not solicit contributions from states where we have not
-met the solicitation requirements, we know of no prohibition against accepting
-unsolicited donations from donors in such states who approach us with offers to
-donate.
+ Section 4.
+ Information about Donations to the Project Gutenberg Literary Archive
-International donations are gratefully accepted, but we cannot make any
-statements concerning tax treatment of donations received from outside the
-United States. U.S. laws alone swamp our small staff.
+ Foundation Project Gutenberg-tm depends upon and cannot survive without
+ wide spread public support and donations to carry out its mission of
+ increasing the number of public domain and licensed works that can be
+ freely distributed in machine readable form accessible by the widest array
+ of equipment including outdated equipment. Many small donations ($1 to
+ $5,000) are particularly important to maintaining tax exempt status with
+ the IRS.
-Please check the Project Gutenberg Web pages for current donation methods and
-addresses. Donations are accepted in a number of other ways including checks,
-online payments and credit card donations. To donate, please visit:
-www.gutenberg.org/donate
+ The Foundation is committed to complying with the laws regulating charities and
+ charitable donations in all 50 states of the United States. Compliance
+ requirements are not uniform and it takes a considerable effort, much paperwork
+ and many fees to meet and keep up with these requirements. We do not solicit
+ donations in locations where we have not received written confirmation of
+ compliance. To SEND DONATIONS or determine the status of compliance for any
+ particular state visit www.gutenberg.org/donate
-Section 5.
-General Information About Project Gutenberg-tm electronic works.
+ While we cannot and do not solicit contributions from states where we have not
+ met the solicitation requirements, we know of no prohibition against accepting
+ unsolicited donations from donors in such states who approach us with offers to
+ donate.
-Professor Michael S. Hart was the originator of the Project Gutenberg-tm
-concept of a library of electronic works that could be freely shared with
-anyone. For forty years, he produced and distributed Project Gutenberg-tm
-eBooks with only a loose network of volunteer support.
+ International donations are gratefully accepted, but we cannot make any
+ statements concerning tax treatment of donations received from outside the
+ United States. U.S. laws alone swamp our small staff.
-Project Gutenberg-tm eBooks are often created from several printed editions,
-all of which are confirmed as not protected by copyright in the U.S. unless a
-copyright notice is included. Thus, we do not necessarily keep eBooks in
-compliance with any particular paper edition.
+ Please check the Project Gutenberg Web pages for current donation methods and
+ addresses. Donations are accepted in a number of other ways including checks,
+ online payments and credit card donations. To donate, please visit:
+ www.gutenberg.org/donate
-Most people start at our Web site which has the main PG search facility:
-www.gutenberg.org
+ Section 5.
+ General Information About Project Gutenberg-tm electronic works.
-This Web site includes information about Project Gutenberg-tm, including how to
-make donations to the Project Gutenberg Literary Archive Foundation, how to
-help produce our new eBooks, and how to subscribe to our email newsletter to
-hear about new eBooks.
+ Professor Michael S. Hart was the originator of the Project Gutenberg-tm
+ concept of a library of electronic works that could be freely shared with
+ anyone. For forty years, he produced and distributed Project Gutenberg-tm
+ eBooks with only a loose network of volunteer support.
+ Project Gutenberg-tm eBooks are often created from several printed editions,
+ all of which are confirmed as not protected by copyright in the U.S. unless a
+ copyright notice is included. Thus, we do not necessarily keep eBooks in
+ compliance with any particular paper edition.
+
+ Most people start at our Web site which has the main PG search facility:
+ www.gutenberg.org
+
+ This Web site includes information about Project Gutenberg-tm, including how to
+ make donations to the Project Gutenberg Literary Archive Foundation, how to
+ help produce our new eBooks, and how to subscribe to our email newsletter to
+ hear about new eBooks.
+---
diff --git a/hyracks-fullstack/NOTICE b/hyracks-fullstack/NOTICE
index 723b9bd..4888468 100644
--- a/hyracks-fullstack/NOTICE
+++ b/hyracks-fullstack/NOTICE
@@ -1,5 +1,5 @@
Apache AsterixDB Hyracks and Algebricks
-Copyright 2015 The Apache Software Foundation
+Copyright 2015-2017 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff --git a/hyracks-fullstack/algebricks/algebricks-compiler/pom.xml b/hyracks-fullstack/algebricks/algebricks-compiler/pom.xml
index 3b23f75..951fe0f 100644
--- a/hyracks-fullstack/algebricks/algebricks-compiler/pom.xml
+++ b/hyracks-fullstack/algebricks/algebricks-compiler/pom.xml
@@ -65,7 +65,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
</dependencies>
</project>
diff --git a/hyracks-fullstack/algebricks/algebricks-core/pom.xml b/hyracks-fullstack/algebricks/algebricks-core/pom.xml
index 5829ac5..d3c9172 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/pom.xml
+++ b/hyracks-fullstack/algebricks/algebricks-core/pom.xml
@@ -84,7 +84,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>com.e-movimento.tinytools</groupId>
diff --git a/hyracks-fullstack/algebricks/algebricks-examples/piglet-example/pom.xml b/hyracks-fullstack/algebricks/algebricks-examples/piglet-example/pom.xml
index c3179da..3bb2b76 100644
--- a/hyracks-fullstack/algebricks/algebricks-examples/piglet-example/pom.xml
+++ b/hyracks-fullstack/algebricks/algebricks-examples/piglet-example/pom.xml
@@ -165,7 +165,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
</dependencies>
</project>
diff --git a/hyracks-fullstack/algebricks/algebricks-rewriter/pom.xml b/hyracks-fullstack/algebricks/algebricks-rewriter/pom.xml
index 3f5e5f4..15b326e 100644
--- a/hyracks-fullstack/algebricks/algebricks-rewriter/pom.xml
+++ b/hyracks-fullstack/algebricks/algebricks-rewriter/pom.xml
@@ -60,7 +60,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
</dependencies>
</project>
diff --git a/hyracks-fullstack/hyracks-fullstack-license/pom.xml b/hyracks-fullstack/hyracks-fullstack-license/pom.xml
new file mode 100644
index 0000000..a25c0d6
--- /dev/null
+++ b/hyracks-fullstack/hyracks-fullstack-license/pom.xml
@@ -0,0 +1,119 @@
+<!--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+ !-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>hyracks-fullstack-license</artifactId>
+ <name>hyracks-fullstack-license</name>
+ <parent>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>apache-asterixdb-hyracks</artifactId>
+ <version>0.2.18-SNAPSHOT</version>
+ </parent>
+
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ <comments>A business-friendly OSS license</comments>
+ </license>
+ </licenses>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>license-automation-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <templateRootDir>${basedir}</templateRootDir>
+ <outputDir>${basedir}/..</outputDir>
+ <location>ignored</location>
+ <generatedFiles>
+ <generatedFile>
+ <template>src/main/licenses/templates/hyracks-source-license.ftl</template>
+ <outputFile>LICENSE</outputFile>
+ </generatedFile>
+ <generatedFile>
+ <template>src/main/licenses/templates/asterix-notice.ftl</template>
+ <outputFile>NOTICE</outputFile>
+ </generatedFile>
+ </generatedFiles>
+ <excludedScopes>
+ <excludedScope>test</excludedScope>
+ </excludedScopes>
+ <licenseDirectory>${basedir}/src/main/licenses/content</licenseDirectory>
+ <licenses>
+ <license>
+ <displayName>The Apache Software License, Version 2.0</displayName>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <aliasUrls>
+ <aliasUrl>http://www.apache.org/licenses/LICENSE-2.0</aliasUrl>
+ <aliasUrl>https://www.apache.org/licenses/LICENSE-2.0.txt</aliasUrl>
+ <aliasUrl>http://www.apache.org/licenses/LICENSE-2.0.html</aliasUrl>
+ </aliasUrls>
+ <metric>1</metric>
+ </license>
+ </licenses>
+ <templateProperties>
+ <hyracksControlCcLocation/>
+ <hyracksControlCcResourcesPrefix>hyracks/hyracks-control/hyracks-control-cc/src/main/resources/</hyracksControlCcResourcesPrefix>
+ <packageName>Hyracks and Algebricks</packageName>
+ </templateProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.asterix</groupId>
+ <artifactId>license-automation-plugin</artifactId>
+ <versionRange>${project.version}</versionRange>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
diff --git a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/content/www.apache.org_licenses_LICENSE-2.0.txt b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/content/www.apache.org_licenses_LICENSE-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/content/www.apache.org_licenses_LICENSE-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. 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 by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright 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 Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable 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, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this 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 licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks 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 grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the 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 this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/asterix-notice.ftl b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/asterix-notice.ftl
new file mode 100644
index 0000000..61f732e
--- /dev/null
+++ b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/asterix-notice.ftl
@@ -0,0 +1,46 @@
+<#--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+-->
+<#if packageName?has_content>
+Apache AsterixDB ${packageName!}
+<#else>
+Apache AsterixDB
+</#if>
+Copyright 2015-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+<#list noticeMap>
+
+AsterixDB utilizes many libraries, which come with the following applicable NOTICE(s):
+
+<#items as e>
+ <#assign noticeText = e.getKey()/>
+ <#assign projects = e.getValue()/>
+ <#list projects as p>
+ <#list p.locations as loc>
+- ${loc}${p.artifactId}-${p.version}.jar
+ </#list>
+ </#list>
+
+<@indent spaces=6>
+${noticeText}
+</@indent>
+
+</#items>
+</#list>
diff --git a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-source-license.ftl b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-source-license.ftl
new file mode 100644
index 0000000..b542891
--- /dev/null
+++ b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-source-license.ftl
@@ -0,0 +1,33 @@
+<#--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+-->
+<@indent spaces=3>
+<#list licenses as license>
+ <#if license.url == "http://www.apache.org/licenses/LICENSE-2.0.txt">
+${license.content}
+ <#break>
+ </#if>
+</#list>
+</@indent>
+===
+ AsterixDB Hyracks includes source code with separate copyright notices
+ and license terms. Your use of this source code is subject to the terms
+ and condition of the following licenses.
+===
+<#include "source_licenses.ftl">
+<#include "source_only_licenses.ftl">
diff --git a/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_licenses.ftl
similarity index 72%
rename from hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl
rename to hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_licenses.ftl
index 6fd73bd..24a47c6 100644
--- a/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl
+++ b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_licenses.ftl
@@ -1,8 +1,50 @@
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
+<#--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+-->
+<#macro license files component="Hyracks admin console" location="${hyracksControlCcLocation!}"
+ filePrefix="${hyracksControlCcResourcesPrefix!}"
+ licenseName="the following license">
+ Portions of the ${component}
+<#if location?has_content>
+ in: ${location}
+</#if>
located at:
- static/javascript/flot/
+<#if files?is_sequence>
+<#list files as file>
+<#if file?counter < files?size>
+ ${filePrefix}${file},
+<#else>
+ and
+ ${filePrefix}${file}
+</#if>
+</#list>
+<#else>
+ ${filePrefix}${files}
+</#if>
+
+ are available under ${licenseName}:
---
+<@indent spaces=3 unpad=true wrap=true>
+<#nested>
+</@indent>
+---
+</#macro>
+<@license files="static/javascript/flot/" licenseName="The MIT License">
Copyright (c) 2007-2014 IOLA and Ole Laursen
Permission is hereby granted, free of charge, to any person
@@ -25,12 +67,8 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/javascript/jsplumb/
----
+</@license>
+<@license files="static/javascript/jsplumb/" licenseName="The MIT License">
Copyright (c) 2010 - 2014 jsPlumb, http://jsplumbtoolkit.com/
Permission is hereby granted, free of charge, to any person obtaining
@@ -51,14 +89,8 @@
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/javascript/jquery
- and
- static/stylesheet/jquery-ui
----
+</@license>
+<@license files=["static/javascript/jquery", "static/javascript/jquery-ui"] licenseName="The MIT License">
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
@@ -95,23 +127,15 @@
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/javascript/jquery/plugins/jquery.getParams.js
----
+</@license>
+<@license files="static/javascript/jquery/plugins/jquery.getParams.js" licenseName="The MIT License">
Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/javascript/jquery/plugins/jquery.timer.js
----
+</@license>
+<@license files="static/javascript/jquery/plugins/jquery.timer.js" licenseName="The MIT License">
jquery.timer.js
Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
@@ -137,16 +161,9 @@
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/stylesheet/json.human.css
----
- json.human.css
-
- MIT License:
-
+</@license>
+<@license files=["static/stylesheet/json.human.css", "static/javascript/adminconsole/json.human.js"]
+ licenseName="The MIT License">
Copyright (c) 2015, Mariano Guerra
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -166,32 +183,4 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----
- Portions of the Hyracks admin console in:
- repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
- located at:
- static/javascript/adminconsole/json.human.js
----
- json.human.js
-
- MIT License:
-
- Copyright (c) 2015, Mariano Guerra
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
+</@license>
diff --git a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_only_licenses.ftl b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_only_licenses.ftl
new file mode 100644
index 0000000..c4bc541
--- /dev/null
+++ b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_only_licenses.ftl
@@ -0,0 +1,392 @@
+<#--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+-->
+<#macro license files component="AsterixDB WebUI"
+ licenseName="the following license">
+ Portions of the ${component}
+ located at:
+<#if files?is_sequence>
+<#list files as file>
+<#if file?counter < files?size>
+ ${file},
+<#else>
+ and
+ ${file}
+</#if>
+</#list>
+<#else>
+ ${files}
+</#if>
+
+ are available under ${licenseName}:
+---
+<@indent spaces=3 unpad=true wrap=true>
+<#nested>
+</@indent>
+---
+</#macro>
+<#--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+-->
+<#macro license files component="AsterixDB WebUI"
+ licenseName="the following license">
+ Portions of the ${component}
+ located at:
+<#assign isare="is"/>
+<#if files?is_sequence>
+<#list files as file>
+<#if file?counter < files?size>
+ ${file},
+<#else>
+ and
+ ${file}
+</#if>
+<#sep>
+<#assign isare="are"/>
+</#sep>
+</#list>
+<#else>
+ ${files}
+</#if>
+
+ ${isare} available under ${licenseName}:
+---
+<@indent spaces=3 unpad=true wrap=true>
+<#nested>
+</@indent>
+---
+</#macro>
+<@license files=["hyracks/hyracks-examples/text-example/textserver/data/file1.txt", "hyracks/hyracks-examples/text-example/textserver/data/file2.txt"]
+ component="test data for the Hyracks textserver examples">
+
+THE FULL PROJECT GUTENBERG LICENSE
+
+PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
+
+To protect the Project Gutenberg-tm mission of promoting the free distribution
+of electronic works, by using or distributing this work (or any other work
+associated in any way with the phrase "Project Gutenberg"), you agree to comply
+with all the terms of the Full Project Gutenberg-tm License available with this
+file or online at www.gutenberg.org/license.
+
+Section 1.
+General Terms of Use and Redistributing Project Gutenberg-tm electronic works
+
+1.A. By reading or using any part of this Project Gutenberg-tm
+electronic work, you indicate that you have read, understand, agree to and
+accept all the terms of this license and intellectual property
+(trademark/copyright) agreement. If you do not agree to abide by all the terms
+of this agreement, you must cease using and return or destroy all copies of
+Project Gutenberg-tm electronic works in your possession. If you paid a fee for
+obtaining a copy of or access to a Project Gutenberg-tm electronic work and you
+do not agree to be bound by the terms of this agreement, you may obtain a
+refund from the person or entity to whom you paid the fee as set forth in
+paragraph 1.E.8.
+
+1.B. "Project Gutenberg" is a registered trademark. It may only be used on or
+associated in any way with an electronic work by people who agree to be bound
+by the terms of this agreement. There are a few things that you can do with
+most Project Gutenberg-tm electronic works even without complying with the full
+terms of this agreement. See paragraph 1.C below. There are a lot of things you
+can do with Project Gutenberg-tm electronic works if you follow the terms of
+this agreement and help preserve free future access to Project Gutenberg-tm
+electronic works. See paragraph 1.E below.
+
+1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" or
+PGLAF), owns a compilation copyright in the collection of Project Gutenberg-tm
+electronic works. Nearly all the individual works in the collection are in the
+public domain in the United States. If an individual work is unprotected by
+copyright law in the United States and you are located in the United States, we
+do not claim a right to prevent you from copying, distributing, performing,
+displaying or creating derivative works based on the work as long as all
+references to Project Gutenberg are removed. Of course, we hope that you will
+support the Project Gutenberg-tm mission of promoting free access to electronic
+works by freely sharing Project Gutenberg-tm works in compliance with the terms
+of this agreement for keeping the Project Gutenberg-tm name associated with the
+work. You can easily comply with the terms of this agreement by keeping this
+work in the same format with its attached full Project Gutenberg-tm License
+when you share it without charge with others.
+
+[*] This particular work is one of the few individual works protected by
+copyright law in the United States and most of the remainder of the world,
+included in the Project Gutenberg collection with the permission of the
+copyright holder. Information on the copyright owner for this particular work
+and the terms of use imposed by the copyright holder on this work are set forth
+at the beginning of this work.
+
+1.D. The copyright laws of the place where you are located also govern what you
+can do with this work. Copyright laws in most countries are in a constant state
+of change. If you are outside the United States, check the laws of your country
+in addition to the terms of this agreement before downloading, copying,
+displaying, performing, distributing or creating derivative works based on this
+work or any other Project Gutenberg-tm work. The Foundation makes no
+representations concerning the copyright status of any work in any country
+outside the United States.
+
+1.E. Unless you have removed all references to Project Gutenberg:
+
+1.E.1. The following sentence, with active links to, or other immediate access
+to, the full Project Gutenberg-tm License must appear prominently whenever any
+copy of a Project Gutenberg-tm work (any work on which the phrase "Project
+Gutenberg" appears, or with which the phrase "Project Gutenberg" is associated)
+is accessed, displayed, performed, viewed, copied or distributed:
+
+This eBook is for the use of anyone anywhere in the United States and most
+other parts of the world at no cost and with almost no restrictions whatsoever.
+You may copy it, give it away or re-use it under the terms of the Project
+Gutenberg License included with this eBook or online at www.gutenberg.org. If
+you are not located in the United States, you'll have to check the laws of the
+country where you are located before using this ebook.
+
+1.E.2. If an individual Project Gutenberg-tm electronic work is derived from
+texts not protected by U.S. copyright law (does not contain a notice indicating
+that it is posted with permission of the copyright holder), the work can be
+copied and distributed to anyone in the United States without paying any fees
+or charges. If you are redistributing or providing access to a work with the
+phrase "Project Gutenberg" associated with or appearing on the work, you must
+comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain
+permission for the use of the work and the Project Gutenberg-tm trademark as
+set forth in paragraphs 1.E.8 or 1.E.9.
+
+1.E.3. If an individual Project Gutenberg-tm electronic work is posted with the
+permission of the copyright holder, your use and distribution must comply with
+both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the
+copyright holder. Additional terms will be linked to the Project Gutenberg-tm
+License for all works posted with the permission of the copyright holder found
+at the beginning of this work.
+
+1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm License
+terms from this work, or any files containing a part of this work or any other
+work associated with Project Gutenberg-tm.
+
+1.E.5. Do not copy, display, perform, distribute or redistribute this
+electronic work, or any part of this electronic work, without prominently
+displaying the sentence set forth in paragraph 1.E.1 with active links or
+immediate access to the full terms of the Project Gutenberg-tm License.
+
+1.E.6. You may convert to and distribute this work in any binary, compressed,
+marked up, nonproprietary or proprietary form, including any word processing or
+hypertext form. However, if you provide access to or distribute copies of a
+Project Gutenberg-tm work in a format other than "Plain Vanilla ASCII" or other
+format used in the official version posted on the official Project Gutenberg-tm
+web site (www.gutenberg.org), you must, at no additional cost, fee or expense
+to the user, provide a copy, a means of exporting a copy, or a means of
+obtaining a copy upon request, of the work in its original "Plain Vanilla
+ASCII" or other form. Any alternate format must include the full Project
+Gutenberg-tm License as specified in paragraph 1.E.1.
+
+1.E.7. Do not charge a fee for access to, viewing, displaying, performing,
+copying or distributing any Project Gutenberg-tm works unless you comply with
+paragraph 1.E.8 or 1.E.9.
+
+1.E.8. You may charge a reasonable fee for copies of or providing access to or
+distributing Project Gutenberg-tm electronic works provided that
+
+You pay a royalty fee of 20% of the gross profits you derive from the use of
+Project Gutenberg-tm works calculated using the method you already use to
+calculate your applicable taxes. The fee is owed to the owner of the Project
+Gutenberg-tm trademark, but he has agreed to donate royalties under this
+paragraph to the Project Gutenberg Literary Archive Foundation. Royalty
+payments must be paid within 60 days following each date on which you prepare
+(or are legally required to prepare) your periodic tax returns. Royalty
+payments should be clearly marked as such and sent to the Project Gutenberg
+Literary Archive Foundation at the address specified in Section 4, "Information
+about donations to the Project Gutenberg Literary Archive Foundation." You
+provide a full refund of any money paid by a user who notifies you in writing
+(or by e-mail) within 30 days of receipt that s/he does not agree to the terms
+of the full Project Gutenberg-tm License. You must require such a user to
+return or destroy all copies of the works possessed in a physical medium and
+discontinue all use of and all access to other copies of Project Gutenberg-tm
+works. You provide, in accordance with paragraph 1.F.3, a full refund of any
+money paid for a work or a replacement copy, if a defect in the electronic work
+is discovered and reported to you within 90 days of receipt of the work. You
+comply with all other terms of this agreement for free distribution of Project
+Gutenberg-tm works. 1.E.9. If you wish to charge a fee or distribute a Project
+Gutenberg-tm electronic work or group of works on different terms than are set
+forth in this agreement, you must obtain permission in writing from both the
+Project Gutenberg Literary Archive Foundation and The Project Gutenberg
+Trademark LLC, the owner of the Project Gutenberg-tm trademark. Contact the
+Foundation as set forth in Section 3 below.
+
+1.F.
+
+1.F.1. Project Gutenberg volunteers and employees expend considerable effort to
+identify, do copyright research on, transcribe and proofread works not
+protected by U.S. copyright law in creating the Project Gutenberg-tm
+collection. Despite these efforts, Project Gutenberg-tm electronic works, and
+the medium on which they may be stored, may contain "Defects," such as, but not
+limited to, incomplete, inaccurate or corrupt data, transcription errors, a
+copyright or other intellectual property infringement, a defective or damaged
+disk or other medium, a computer virus, or computer codes that damage or cannot
+be read by your equipment.
+
+1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right of
+Replacement or Refund" described in paragraph 1.F.3, the Project Gutenberg
+Literary Archive Foundation, the owner of the Project Gutenberg-tm trademark,
+and any other party distributing a Project Gutenberg-tm electronic work under
+this agreement, disclaim all liability to you for damages, costs and expenses,
+including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
+STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
+PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
+OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
+ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
+YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
+
+1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in
+this electronic work within 90 days of receiving it, you can receive a refund
+of the money (if any) you paid for it by sending a written explanation to the
+person you received the work from. If you received the work on a physical
+medium, you must return the medium with your written explanation. The person or
+entity that provided you with the defective work may elect to provide a
+replacement copy in lieu of a refund. If you received the work electronically,
+the person or entity providing it to you may choose to give you a second
+opportunity to receive the work electronically in lieu of a refund. If the
+second copy is also defective, you may demand a refund in writing without
+further opportunities to fix the problem.
+
+1.F.4. Except for the limited right of replacement or refund set forth in
+paragraph 1.F.3, this work is provided to you 'AS-IS', WITH NO OTHER WARRANTIES
+OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
+
+1.F.5. Some states do not allow disclaimers of certain implied warranties or
+the exclusion or limitation of certain types of damages. If any disclaimer or
+limitation set forth in this agreement violates the law of the state applicable
+to this agreement, the agreement shall be interpreted to make the maximum
+disclaimer or limitation permitted by the applicable state law. The invalidity
+or unenforceability of any provision of this agreement shall not void the
+remaining provisions.
+
+1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the
+trademark owner, any agent or employee of the Foundation, anyone providing
+copies of Project Gutenberg-tm electronic works in accordance with this
+agreement, and any volunteers associated with the production, promotion and
+distribution of Project Gutenberg-tm electronic works, harmless from all
+liability, costs and expenses, including legal fees, that arise directly or
+indirectly from any of the following which you do or cause to occur: (a)
+distribution of this or any Project Gutenberg-tm work, (b) alteration,
+modification, or additions or deletions to any Project Gutenberg-tm work, and
+(c) any Defect you cause.
+
+Section 2.
+Information about the Mission of Project Gutenberg-tm Project
+
+Gutenberg-tm is synonymous with the free distribution of electronic works in
+formats readable by the widest variety of computers including obsolete, old,
+middle-aged and new computers. It exists because of the efforts of hundreds of
+volunteers and donations from people in all walks of life.
+
+Volunteers and financial support to provide volunteers with the assistance they
+need are critical to reaching Project Gutenberg-tm's goals and ensuring that
+the Project Gutenberg-tm collection will remain freely available for
+generations to come. In 2001, the Project Gutenberg Literary Archive Foundation
+was created to provide a secure and permanent future for Project Gutenberg-tm
+and future generations. To learn more about the Project Gutenberg Literary
+Archive Foundation and how your efforts and donations can help, see Sections 3
+and 4 and the Foundation information page at www.gutenberg.org
+
+Section 3.
+Information about the Project Gutenberg Literary Archive Foundation
+
+The Project Gutenberg Literary Archive Foundation is a non profit 501(c)(3)
+educational corporation organized under the laws of the state of Mississippi
+and granted tax exempt status by the Internal Revenue Service. The Foundation's
+EIN or federal tax identification number is 64-6221541. Contributions to the
+Project Gutenberg Literary Archive Foundation are tax deductible to the full
+extent permitted by U.S. federal laws and your state's laws.
+
+The Foundation's principal office is located at 4557 Melan Dr. S. Fairbanks,
+AK, 99712., but its volunteers and employees are scattered throughout numerous
+locations. Its business office is located at 809 North 1500 West, Salt Lake
+City, UT 84116, (801) 596-1887. Email contact links and up to date contact
+information can be found at the Foundation's web site and official page at
+www.gutenberg.org/contact
+
+For additional contact information:
+ Dr. Gregory B. Newby Chief Executive and Director
+ gbnewby@pglaf.org
+
+Section 4.
+Information about Donations to the Project Gutenberg Literary Archive
+
+Foundation Project Gutenberg-tm depends upon and cannot survive without
+wide spread public support and donations to carry out its mission of
+increasing the number of public domain and licensed works that can be
+freely distributed in machine readable form accessible by the widest array
+of equipment including outdated equipment. Many small donations ($1 to
+$5,000) are particularly important to maintaining tax exempt status with
+the IRS.
+
+The Foundation is committed to complying with the laws regulating charities and
+charitable donations in all 50 states of the United States. Compliance
+requirements are not uniform and it takes a considerable effort, much paperwork
+and many fees to meet and keep up with these requirements. We do not solicit
+donations in locations where we have not received written confirmation of
+compliance. To SEND DONATIONS or determine the status of compliance for any
+particular state visit www.gutenberg.org/donate
+
+While we cannot and do not solicit contributions from states where we have not
+met the solicitation requirements, we know of no prohibition against accepting
+unsolicited donations from donors in such states who approach us with offers to
+donate.
+
+International donations are gratefully accepted, but we cannot make any
+statements concerning tax treatment of donations received from outside the
+United States. U.S. laws alone swamp our small staff.
+
+Please check the Project Gutenberg Web pages for current donation methods and
+addresses. Donations are accepted in a number of other ways including checks,
+online payments and credit card donations. To donate, please visit:
+www.gutenberg.org/donate
+
+Section 5.
+General Information About Project Gutenberg-tm electronic works.
+
+Professor Michael S. Hart was the originator of the Project Gutenberg-tm
+concept of a library of electronic works that could be freely shared with
+anyone. For forty years, he produced and distributed Project Gutenberg-tm
+eBooks with only a loose network of volunteer support.
+
+Project Gutenberg-tm eBooks are often created from several printed editions,
+all of which are confirmed as not protected by copyright in the U.S. unless a
+copyright notice is included. Thus, we do not necessarily keep eBooks in
+compliance with any particular paper edition.
+
+Most people start at our Web site which has the main PG search facility:
+www.gutenberg.org
+
+This Web site includes information about Project Gutenberg-tm, including how to
+make donations to the Project Gutenberg Literary Archive Foundation, how to
+help produce our new eBooks, and how to subscribe to our email newsletter to
+hear about new eBooks.
+</@license>
diff --git a/hyracks-fullstack/hyracks/hyracks-api/pom.xml b/hyracks-fullstack/hyracks/hyracks-api/pom.xml
index 2c00862..f61a4b0 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-api/pom.xml
@@ -72,7 +72,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
index 63c6047..eafc8d2 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
@@ -98,7 +98,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/pom.xml
index 73ed8b2..72fbc53 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/pom.xml
@@ -70,7 +70,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
</dependencies>
</project>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/pom.xml
index 2f966a3..0e2fd27 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/pom.xml
@@ -58,12 +58,11 @@
<dependency>
<groupId>org.apache.hyracks</groupId>
<artifactId>hyracks-control-common</artifactId>
- <version>0.2.18-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>com.e-movimento.tinytools</groupId>
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/pom.xml b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/pom.xml
index 8e62184..6d4ed61 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/pom.xml
@@ -34,7 +34,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.hyracks</groupId>
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/pom.xml b/hyracks-fullstack/hyracks/hyracks-dataflow-std/pom.xml
index 0158068..a4ac6db 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/pom.xml
@@ -55,21 +55,16 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.hyracks</groupId>
<artifactId>hyracks-api</artifactId>
<version>${project.version}</version>
- <type>jar</type>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hyracks</groupId>
<artifactId>hyracks-dataflow-common</artifactId>
<version>${project.version}</version>
- <type>jar</type>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml
new file mode 100644
index 0000000..5190bbb
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements. See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership. The ASF licenses this file
+ ! to you 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.
+ !-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-maven-plugins</artifactId>
+ <version>0.2.18-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>maven-plugin</packaging>
+
+ <artifactId>license-automation-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.3.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.23</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.8.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>3.3.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.0.22</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DependencySet.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DependencySet.java
new file mode 100644
index 0000000..8e91be4
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DependencySet.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+public class DependencySet {
+
+ @SuppressWarnings("unused") // set by Maven configuration
+ private String location;
+
+ @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) // set by Maven configuration
+ private List<String> includes;
+
+ private List<Pattern> patterns;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public List<Pattern> getPatterns() {
+ if (patterns == null) {
+ patterns = includes.stream().map(LicenseMojo::compileGAWildcardPattern).collect(Collectors.toList());
+ }
+ return patterns;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java
new file mode 100644
index 0000000..8219dfc
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.ProjectBuildingException;
+
+@Mojo(name = "licensedownload",
+ requiresProject = true,
+ requiresDependencyResolution = ResolutionScope.TEST,
+ defaultPhase = LifecyclePhase.GENERATE_RESOURCES)
+public class DownloadLicensesMojo extends LicenseMojo {
+
+ @Parameter(required = true)
+ private File downloadDir;
+
+ @Parameter(defaultValue = "30")
+ private int timeoutSecs;
+
+ @java.lang.Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ try {
+ init();
+ addDependenciesToLicenseMap();
+ final int timeoutMillis = (int) TimeUnit.SECONDS.toMillis(timeoutSecs);
+ //noinspection ResultOfMethodCallIgnored
+ downloadDir.mkdirs();
+ AtomicInteger counter = new AtomicInteger();
+ getLicenseMap().values().parallelStream().forEach(entry -> {
+ final int i = counter.incrementAndGet();
+ final String url = entry.getLicense().getUrl();
+ String fileName = entry.getLicense().getContentFile(false);
+ doDownload(timeoutMillis, i, url, fileName);
+ });
+ } catch (IOException | ProjectBuildingException e) {
+ throw new MojoExecutionException("Unexpected exception: " + e, e);
+ }
+ }
+
+ private void doDownload(int timeoutMillis, int id, String url, String fileName) {
+ try {
+ HttpURLConnection conn = (HttpURLConnection)new URL(url).openConnection();
+ conn.setConnectTimeout(timeoutMillis);
+ conn.setReadTimeout(timeoutMillis);
+ conn.setRequestMethod("GET");
+ final File outFile = new File(downloadDir, fileName);
+ getLog().info("[" + id + "] " + url + " -> " + outFile);
+ final InputStream is = conn.getInputStream();
+ FileWriter writer = new FileWriter(outFile);
+ IOUtils.copy(is, writer, conn.getContentEncoding());
+ writer.close();
+ getLog().info("[" + id + "] ...done!");
+ } catch (IOException e) {
+ getLog().warn("[" + id + "] ...error downloading " + url + ": " + e);
+ }
+ }
+}
+
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ExtraLicenseFile.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ExtraLicenseFile.java
new file mode 100644
index 0000000..025260b
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ExtraLicenseFile.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.File;
+
+public class ExtraLicenseFile {
+ private File file;
+ private String location;
+ private boolean additive = true;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public File getFile() {
+ return file;
+ }
+
+ public void setFile(File file) {
+ this.file = file;
+ }
+
+ public boolean isAdditive() {
+ return additive;
+ }
+
+ public void setAdditive(boolean additive) {
+ this.additive = additive;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java
new file mode 100644
index 0000000..3dfbb1a
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java
@@ -0,0 +1,344 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.SortedSet;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.function.BiConsumer;
+import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.regex.Pattern;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SequenceWriter;
+import freemarker.cache.FileTemplateLoader;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+import org.apache.hyracks.maven.license.freemarker.IndentDirective;
+import org.apache.hyracks.maven.license.freemarker.LoadFileDirective;
+import org.apache.hyracks.maven.license.project.LicensedProjects;
+import org.apache.hyracks.maven.license.project.Project;
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.ProjectBuildingException;
+
+@Mojo(name = "generate",
+ requiresProject = true,
+ requiresDependencyResolution = ResolutionScope.TEST)
+public class GenerateFileMojo extends LicenseMojo {
+
+ public static final Pattern FOUNDATION_PATTERN = Pattern.compile("^\\s*This product includes software developed " +
+ "(at|by) The Apache Software Foundation \\(http://www.apache.org/\\).\\s*$".replace(" ", "\\s+"),
+ Pattern.DOTALL | Pattern.MULTILINE);
+
+ public static final Comparator<String> WHITESPACE_NORMALIZED_COMPARATOR =
+ (o1, o2) -> o1.replaceAll("\\s+", " ").compareTo(o2.replaceAll("\\s+", " "));
+
+ @Parameter(required = true)
+ private File templateRootDir;
+
+ @Parameter(defaultValue = "${project.build.directory}/generated-sources")
+ private File outputDir;
+
+ @Parameter
+ private List<GeneratedFile> generatedFiles = new ArrayList<>();
+
+ @Parameter(defaultValue = "${project.build.sourceEncoding}")
+ private String encoding;
+
+ @Parameter
+ private File licenseMapOutputFile;
+
+ @Parameter
+ private List<ExtraLicenseFile> extraLicenseMaps = new ArrayList<>();
+
+ @Parameter
+ protected Map<String, String> templateProperties = new HashMap<>();
+
+ @Parameter
+ private boolean stripFoundationAssertionFromNotices = true;
+
+ private SortedMap<String, SortedSet<Project>> noticeMap;
+
+ @java.lang.Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ try {
+ init();
+ readExtraMaps();
+ addDependenciesToLicenseMap();
+ resolveLicenseContent();
+ resolveNoticeFiles();
+ resolveLicenseFiles();
+ rebuildLicenseContentProjectMap();
+ buildNoticeProjectMap();
+ persistLicenseMap();
+ combineCommonGavs();
+ generateFiles();
+ } catch (IOException | TemplateException | ProjectBuildingException e) {
+ throw new MojoExecutionException("Unexpected exception: " + e, e);
+ }
+ }
+
+ private void resolveLicenseContent() throws IOException {
+ Set<LicenseSpec> licenseSpecs = new HashSet<>();
+ for (LicensedProjects licensedProjects : licenseMap.values()) {
+ licenseSpecs.add(licensedProjects.getLicense());
+ }
+ licenseSpecs.addAll(urlToLicenseMap.values());
+ for (LicenseSpec license : licenseSpecs) {
+ if (license.getContent() == null) {
+ getLog().debug("Resolving content for " + license.getUrl() + " (" + license.getContentFile() + ")");
+ File cFile = new File(license.getContentFile());
+ if (!cFile.isAbsolute()) {
+ cFile = new File(licenseDirectory, license.getContentFile());
+ }
+ if (!cFile.exists()) {
+ getLog().warn("MISSING: license content file (" + cFile + ") for url: " + license.getUrl());
+ license.setContent("MISSING: " + license.getContentFile() + " (" + license.getUrl() + ")");
+ } else {
+ StringWriter sw = new StringWriter();
+ LicenseUtil.readAndTrim(sw, cFile);
+ license.setContent(sw.toString());
+ }
+ }
+ }
+ }
+
+ private void combineCommonGavs() {
+ for (LicensedProjects licensedProjects : licenseMap.values()) {
+ Map<String, Project> projectMap = new HashMap<>();
+ for (Iterator<Project> iter = licensedProjects.getProjects().iterator(); iter.hasNext(); ) {
+ Project project = iter.next();
+ if (projectMap.containsKey(project.gav())) {
+ Project first = projectMap.get(project.gav());
+ first.setLocation(first.getLocation() + "," + project.getLocation());
+ iter.remove();
+ } else {
+ projectMap.put(project.gav(), project);
+ }
+ }
+ }
+ }
+
+ private void generateFiles() throws TemplateException, IOException {
+ Map<String, Object> props = getProperties();
+
+ Configuration config = new Configuration();
+ config.setTemplateLoader(new FileTemplateLoader(templateRootDir));
+ for (GeneratedFile generation : generatedFiles) {
+ Template template = config.getTemplate(generation.getTemplate());
+
+ if (template == null) {
+ throw new IOException("Could not load template " + generation.getTemplate());
+ }
+
+ outputDir.mkdirs();
+ final File file = new File(outputDir, generation.getOutputFile());
+ getLog().info("Writing " + file + "...");
+ try (final FileWriter writer = new FileWriter(file)) {
+ template.process(props, writer);
+ }
+ }
+ }
+
+ protected Map<String, Object> getProperties() {
+ Map<String, Object> props = new HashMap<>();
+ props.put("indent", new IndentDirective());
+ props.put("loadfile", new LoadFileDirective());
+ props.put("project", project);
+ props.put("noticeMap", noticeMap.entrySet());
+ props.put("licenseMap", licenseMap.entrySet());
+ props.put("licenses", urlToLicenseMap.values());
+ props.putAll(templateProperties);
+ return props;
+ }
+
+ private void readExtraMaps() throws IOException {
+ final ObjectMapper objectMapper = new ObjectMapper();
+ for (ExtraLicenseFile extraLicenseFile : extraLicenseMaps) {
+ for (LicensedProjects projects :
+ objectMapper.readValue(extraLicenseFile.getFile(), LicensedProjects[].class)) {
+ LicenseSpec spec = urlToLicenseMap.get(projects.getLicense().getUrl());
+ if (spec != null) {
+ // TODO(mblow): probably we should always favor the extra map...
+ // propagate any license content we may have with what already has been loaded
+ if (projects.getLicense().getContent() != null &&
+ spec.getContent() == null) {
+ spec.setContent(projects.getLicense().getContent());
+ }
+ // propagate any license displayName we may have with what already has been loaded
+ if (projects.getLicense().getDisplayName() != null &&
+ spec.getDisplayName() == null) {
+ spec.setDisplayName(projects.getLicense().getDisplayName());
+ }
+ }
+ for (Project project : projects.getProjects()) {
+ project.setLocation(extraLicenseFile.getLocation());
+ addProject(project, projects.getLicense(), extraLicenseFile.isAdditive());
+ }
+ }
+ }
+ }
+
+ private void persistLicenseMap() throws IOException {
+ if (licenseMapOutputFile != null) {
+ licenseMapOutputFile.getParentFile().mkdirs();
+ SequenceWriter sw = new ObjectMapper().writerWithDefaultPrettyPrinter()
+ .writeValues(licenseMapOutputFile).init(true);
+ for (LicensedProjects entry : licenseMap.values()) {
+ sw.write(entry);
+ }
+ sw.close();
+ }
+ }
+
+ private void rebuildLicenseContentProjectMap() {
+ int counter = 0;
+ Map<String, LicensedProjects> licenseMap2 = new TreeMap<>(WHITESPACE_NORMALIZED_COMPARATOR);
+ for (LicensedProjects lps : licenseMap.values()) {
+ for (Project project : lps.getProjects()) {
+ String licenseText = project.getLicenseText();
+ if (licenseText == null) {
+ getLog().warn("Using license other than from within artifact: " + project.gav());
+ licenseText = lps.getLicense().getContent();
+ }
+ if (!licenseMap2.containsKey(licenseText)) {
+ LicenseSpec spec = lps.getLicense();
+ if (!licenseText.equals(lps.getLicense().getContent())) {
+ spec = new LicenseSpec(new ArrayList<>(), licenseText, null, spec.getDisplayName(),
+ spec.getMetric(), spec.getUrl() + (counter++));
+ }
+ licenseMap2.put(licenseText, new LicensedProjects(spec));
+ }
+ licenseMap2.get(licenseText).addProject(project);
+ }
+ }
+ licenseMap = licenseMap2;
+ }
+
+ private Set<Project> getProjects() {
+ Set<Project> projects = new HashSet<>();
+ licenseMap.values().forEach(p -> projects.addAll(p.getProjects()));
+ return projects;
+ }
+
+ private void buildNoticeProjectMap() {
+ noticeMap = new TreeMap<>(WHITESPACE_NORMALIZED_COMPARATOR);
+ for (Project project : getProjects()) {
+ final String noticeText = project.getNoticeText();
+ if (noticeText == null) {
+ continue;
+ }
+ if (!noticeMap.containsKey(noticeText)) {
+ noticeMap.put(noticeText, new TreeSet<>(Project.PROJECT_COMPARATOR));
+ }
+ noticeMap.get(noticeText).add(project);
+ }
+ }
+
+ private void resolveNoticeFiles() throws MojoExecutionException, IOException {
+ resolveArtifactFiles("NOTICE", entry -> entry.getName().matches("(.*/|^)" + "NOTICE" + "(.txt)?"),
+ Project::setNoticeText,
+ text -> stripFoundationAssertionFromNotices ? FOUNDATION_PATTERN.matcher(text).replaceAll("") : text);
+ }
+
+ private void resolveLicenseFiles() throws MojoExecutionException, IOException {
+ resolveArtifactFiles("LICENSE", entry -> entry.getName().matches("(.*/|^)" + "LICENSE" + "(.txt)?"),
+ Project::setLicenseText, UnaryOperator.identity());
+ }
+
+ private void resolveArtifactFiles(final String name, Predicate<JarEntry> filter,
+ BiConsumer<Project, String> consumer, UnaryOperator<String> contentTransformer)
+ throws MojoExecutionException, IOException {
+ for (Project project : getProjects()) {
+ File artifactFile = new File(project.getArtifactPath());
+ if (!artifactFile.exists()) {
+ throw new MojoExecutionException("Artifact file " + artifactFile + " does not exist!");
+ } else if (!artifactFile.getName().endsWith(".jar")) {
+ getLog().info("Skipping unknown artifact file type: " + artifactFile);
+ continue;
+ }
+ try (JarFile jarFile = new JarFile(artifactFile)) {
+ SortedMap<String, JarEntry> matches = gatherMatchingEntries(jarFile,
+ filter);
+ if (matches.isEmpty()) {
+ getLog().warn("No " + name + " file found for " + project.gav());
+ } else {
+ if (matches.size() > 1) {
+ getLog().warn("Multiple " + name + " files found for " + project.gav() + ": " + matches.keySet()
+ + "; taking first");
+ } else {
+ getLog().info(project.gav() + " has " + name + " file: " + matches.keySet());
+ }
+ resolveContent(project, jarFile, matches.values().iterator().next(),
+ contentTransformer, consumer, name);
+ }
+ }
+ }
+ }
+
+ private void resolveContent(Project project, JarFile jarFile, JarEntry entry, UnaryOperator<String> transformer,
+ BiConsumer<Project, String> contentConsumer, final String name) throws IOException {
+ String text = IOUtils.toString(jarFile.getInputStream(entry), StandardCharsets.UTF_8);
+ text = transformer.apply(text);
+ text = LicenseUtil.trim(text);
+ if (text.length() == 0) {
+ getLog().warn("Ignoring empty " + name + " file ( " + entry + ") for " + project.gav());
+ } else {
+ contentConsumer.accept(project, text);
+ getLog().debug("Resolved " + name + " text for " + project.gav() + ": \n" + text);
+ }
+ }
+
+ private SortedMap<String, JarEntry> gatherMatchingEntries(JarFile jarFile, Predicate<JarEntry> filter) {
+ SortedMap<String, JarEntry> matches = new TreeMap<>();
+ Enumeration<JarEntry> entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry entry = entries.nextElement();
+ if (filter.test(entry)) {
+ matches.put(entry.getName(), entry);
+ }
+ }
+ return matches;
+ }
+}
+
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GeneratedFile.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GeneratedFile.java
new file mode 100644
index 0000000..1b36109
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GeneratedFile.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+public class GeneratedFile {
+
+ @SuppressWarnings("unused") // set by Maven plugin configuration
+ private String template;
+
+ @SuppressWarnings("unused") // set by Maven plugin configuration
+ private String outputFile;
+
+ public String getOutputFile() {
+ return outputFile;
+ }
+
+ public String getTemplate() {
+ return template;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java
new file mode 100644
index 0000000..ea5c878
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java
@@ -0,0 +1,322 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.File;
+import java.lang.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import org.apache.hyracks.maven.license.project.LicensedProjects;
+import org.apache.hyracks.maven.license.project.Project;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.License;
+import org.apache.maven.model.Model;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
+
+public abstract class LicenseMojo extends AbstractMojo {
+
+ @Parameter
+ protected List<Override> overrides = new ArrayList<>();
+
+ @Parameter
+ protected String [] models = new String [0];
+
+ @Parameter
+ protected List<LicenseSpec> licenses = new ArrayList<>();
+
+ @Parameter
+ protected Set<String> excludedScopes = new HashSet<>();
+
+ @Parameter
+ protected List<String> excludes = new ArrayList<>();
+
+ @Parameter
+ protected List<DependencySet> dependencySets = new ArrayList<>();
+
+ @Parameter( defaultValue = "${project}", readonly = true )
+ protected MavenProject project;
+
+ @Parameter( property = "localRepository", required = true, readonly = true )
+ private ArtifactRepository localRepository;
+
+ @Parameter( property = "project.remoteArtifactRepositories", required = true, readonly = true )
+ private List<ArtifactRepository> remoteRepositories;
+
+ @Component( role = MavenProjectBuilder.class )
+ protected MavenProjectBuilder projectBuilder;
+
+ @Component
+ private ModelInheritanceAssembler assembler;
+
+ @Parameter ( required = true )
+ private String location;
+
+ @Parameter ( required = true )
+ protected File licenseDirectory;
+
+ private Map<String, MavenProject> projectCache = new HashMap<>();
+
+ private Map<String, Model> supplementModels;
+
+ private List<Pattern> excludePatterns;
+
+ Map<String, LicenseSpec> urlToLicenseMap = new HashMap<>();
+ Map<String, LicensedProjects> licenseMap = new TreeMap<>();
+
+ protected Map<String, LicensedProjects> getLicenseMap() {
+ return licenseMap;
+ }
+
+ protected void init() throws MojoExecutionException, MalformedURLException,
+ ProjectBuildingException {
+ excludedScopes.add("system");
+ excludePatterns = compileExcludePatterns();
+ supplementModels = SupplementalModelHelper.loadSupplements(getLog(), models);
+ buildUrlLicenseMap();
+ }
+
+ protected void addDependenciesToLicenseMap() throws ProjectBuildingException {
+ Map<MavenProject, List<Pair<String, String>>> dependencyLicenseMap = gatherDependencies();
+ for (Map.Entry<MavenProject, List<Pair<String, String>>> dep : dependencyLicenseMap.entrySet()) {
+ final MavenProject depProject = dep.getKey();
+ String depLocation = dependencySets.isEmpty() ? location : getIncludedLocation(depProject.getArtifact());
+ if (isExcluded(depProject.getArtifact())) {
+ getLog().debug("skipping " + depProject + " [excluded]");
+ } else if (depLocation == null) {
+ getLog().debug("skipping " + depProject + " [not included in dependency sets]");
+ } else {
+ addDependencyToLicenseMap(depProject, dep.getValue(), depLocation);
+ }
+ }
+ }
+
+ private void addDependencyToLicenseMap(MavenProject depProject, List<Pair<String, String>> depLicenses,
+ String depLocation) {
+ final String depGav = toGav(depProject);
+ getLog().debug("adding " + depGav + ", location: " + depLocation);
+ if (depLicenses.size() > 1) {
+ Collections.sort(depLicenses, (o1, o2) -> {
+ final LicenseSpec l1 = urlToLicenseMap.get(o1.getLeft());
+ final LicenseSpec l2 = urlToLicenseMap.get(o2.getLeft());
+ return Integer.compare(l1 != null ? l1.getMetric() : LicenseSpec.UNDEFINED_LICENSE_METRIC,
+ l2 != null ? l2.getMetric() : LicenseSpec.UNDEFINED_LICENSE_METRIC);
+ });
+ getLog().warn("Multiple licenses for " + depGav + ": " + depLicenses
+ + "; taking first or lowest metric.");
+ } else if (depLicenses.isEmpty()) {
+ getLog().error("No license defined for " + depGav);
+ depLicenses.add(new ImmutablePair<>("MISSING_LICENSE", "MISSING LICENSE"));
+ }
+ Pair<String, String> key = depLicenses.get(0);
+ String licenseUrl = key.getLeft();
+ final String displayName = key.getRight();
+ if (!urlToLicenseMap.containsKey(licenseUrl)) {
+ // assuming we've not already mapped it, annotate the URL with artifact info, if not an actual URL
+ try {
+ getLog().debug("- URL: " + new URL(licenseUrl));
+ // life is good
+ } catch (MalformedURLException e) {
+ // we encounter this a lot. Log a warning, and use an annotated key
+ final String fakeLicenseUrl = depGav.replaceAll(":", "--") + "_" + licenseUrl;
+ getLog().warn("- URL for " + depGav + " is malformed: " + licenseUrl + "; using: "
+ + fakeLicenseUrl);
+ licenseUrl = fakeLicenseUrl;
+ }
+ }
+ addProject(new Project(depProject, depLocation, depProject.getArtifact().getFile()),
+ new LicenseSpec(licenseUrl, displayName), true);
+ }
+
+ protected void addProject(Project project, LicenseSpec spec, boolean additive) {
+ String licenseUrl = spec.getUrl();
+ LicenseSpec license = urlToLicenseMap.get(licenseUrl);
+ if (license == null) {
+ license = spec;
+ urlToLicenseMap.put(licenseUrl, license);
+ for (String alias : license.getAliasUrls()) {
+ if (!urlToLicenseMap.containsKey(alias)) {
+ urlToLicenseMap.put(alias ,license);
+ }
+ }
+ }
+ licenseUrl = license.getUrl();
+ LicensedProjects entry = licenseMap.get(licenseUrl);
+ if (entry == null) {
+ entry = new LicensedProjects(license);
+ licenseMap.put(licenseUrl, entry);
+ }
+ if (additive || entry.getProjects().contains(project)) {
+ entry.addProject(project);
+ }
+ }
+
+ private void buildUrlLicenseMap() throws MojoExecutionException {
+ for (LicenseSpec license : licenses) {
+ if (urlToLicenseMap.put(license.getUrl() ,license) != null) {
+ throw new MojoExecutionException("Duplicate URL mapping: " + license.getUrl());
+ }
+ for (String alias : license.getAliasUrls()) {
+ if (urlToLicenseMap.put(alias ,license) != null) {
+ throw new MojoExecutionException("Duplicate URL mapping: " + alias);
+ }
+ }
+ }
+ }
+
+ protected Map<MavenProject, List<Pair<String, String>>> gatherDependencies() throws ProjectBuildingException {
+ Map<MavenProject, List<Pair<String, String>>> dependencyLicenseMap = new HashMap<>();
+ Map<String, MavenProject> dependencyGavMap = new HashMap<>();
+
+ gatherProjectDependencies(project, dependencyLicenseMap, dependencyGavMap);
+ for (Override override : overrides) {
+ String gav = override.getGav();
+ MavenProject dep = dependencyGavMap.get(gav);
+ if (dep == null) {
+ getLog().warn("Unused override dependency " + gav + "; ignoring...");
+ } else {
+ final List<Pair<String, String>> newUrl = Collections.singletonList(
+ new ImmutablePair<>(override.getUrl(), override.getName()));
+ List<Pair<String, String>> prev = dependencyLicenseMap.put(dep, newUrl);
+ if (!prev.isEmpty()) {
+ getLog().warn("NOTICE: replacing license(s) " + prev + " for dependency " + gav + " with "
+ + newUrl);
+ }
+ }
+ }
+ return dependencyLicenseMap;
+ }
+
+ private void gatherProjectDependencies(MavenProject project, Map<MavenProject,
+ List<Pair<String, String>>> dependencyLicenseMap, Map<String, MavenProject> dependencyGavMap)
+ throws ProjectBuildingException {
+ final Set dependencyArtifacts = project.getArtifacts();
+ if (dependencyArtifacts != null) {
+ for (Object depArtifactObj : dependencyArtifacts) {
+ final Artifact depArtifact = (Artifact) depArtifactObj;
+ if (!excludedScopes.contains(depArtifact.getScope())) {
+ MavenProject dep = resolveDependency(depArtifact);
+ dep.setArtifact(depArtifact);
+ dependencyGavMap.put(toGav(dep), dep);
+ List<Pair<String, String>> licenseUrls = new ArrayList<>();
+ for (Object license : dep.getLicenses()) {
+ final License license1 = (License) license;
+ String url = license1.getUrl() != null ? license1.getUrl()
+ : (license1.getName() != null ? license1.getName()
+ : "LICENSE_EMPTY_NAME_URL");
+ licenseUrls.add(new ImmutablePair<>(url, license1.getName()));
+ }
+ dependencyLicenseMap.put(dep, licenseUrls);
+ }
+ }
+ }
+ }
+
+ protected MavenProject resolveDependency(Artifact depObj) throws ProjectBuildingException {
+ String key = depObj.getGroupId() + ":" + depObj.getArtifactId() + ":" + depObj.getVersion();
+
+ MavenProject depProj = projectCache.get(key);
+
+ if (depProj == null) {
+ try {
+ depProj = projectBuilder.buildFromRepository(depObj, remoteRepositories, localRepository, false);
+ } catch (ProjectBuildingException e) {
+ throw new ProjectBuildingException(key, "Error creating dependent artifacts", e);
+ }
+
+ Model supplement = supplementModels.get(
+ SupplementalModelHelper.generateSupplementMapKey(depObj.getGroupId(), depObj.getArtifactId()));
+ if (supplement != null) {
+ Model merged = SupplementalModelHelper.mergeModels(assembler, depProj.getModel(), supplement);
+ Set<String> origLicenses = depProj.getModel().getLicenses().stream().map(License::getUrl)
+ .collect(Collectors.toSet());
+ Set<String> newLicenses = merged.getLicenses().stream().map(License::getUrl)
+ .collect(Collectors.toSet());
+ if (!origLicenses.equals(newLicenses)) {
+ getLog().warn("license list for " + toGav(depProj)
+ + " changed with supplemental model; was: " + origLicenses
+ + ", now: " + newLicenses);
+ }
+ depProj = new MavenProject(merged);
+ depProj.setArtifact( depObj );
+ depProj.setVersion( depObj.getVersion() );
+ }
+ depProj.getArtifact().setScope(depObj.getScope());
+ projectCache.put(key, depProj);
+ }
+ return depProj;
+ }
+
+ private String toGav(MavenProject dep) {
+ return dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion();
+ }
+
+ protected List<Pattern> compileExcludePatterns() {
+ List<Pattern> patterns = new ArrayList<>();
+ for (String exclude : excludes) {
+ patterns.add(compileGAWildcardPattern(exclude));
+ }
+ return patterns;
+ }
+
+ public static Pattern compileGAWildcardPattern(String spec) {
+ return Pattern.compile(spec.replace(".", "\\.").replace("*", "[^:]*"));
+ }
+
+ protected boolean isExcluded(Artifact artifact) {
+ for (Pattern exclude : excludePatterns) {
+ if (exclude.matcher(artifact.getGroupId() + ":" + artifact.getArtifactId()).matches()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected String getIncludedLocation(Artifact artifact) {
+ for (DependencySet set : dependencySets) {
+ for (Pattern include : set.getPatterns()) {
+ if (include.matcher(artifact.getGroupId() + ":" + artifact.getArtifactId()).matches()) {
+ return set.getLocation();
+ }
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java
new file mode 100644
index 0000000..f2ff5dd
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class LicenseSpec {
+
+ public static final int DEFAULT_METRIC = 100;
+ public static final int UNDEFINED_LICENSE_METRIC = 999;
+
+ public static final String BAD_CHARS = "[ \"#$%&'()*+,/:;<=>\\[\\]^`\\{\\|\\}~]";
+ private String url;
+ private String contentFile;
+ private List<String> aliasUrls = new ArrayList<>();
+ private String displayName;
+ private int metric = DEFAULT_METRIC;
+ private String content;
+
+ @SuppressWarnings("unused")
+ public LicenseSpec() {
+ // called by Maven configuration
+ }
+
+ @JsonCreator
+ public LicenseSpec(@JsonProperty("aliasUrls") List<String> aliasUrls, @JsonProperty("content") String content,
+ @JsonProperty("contentFile") String contentFile, @JsonProperty("displayName") String displayName,
+ @JsonProperty("metric") int metric, @JsonProperty("url") String url) {
+ this.aliasUrls = aliasUrls;
+ this.content = content;
+ this.contentFile = contentFile;
+ this.displayName = displayName;
+ this.metric = metric;
+ this.url = url;
+ }
+
+ public LicenseSpec(String url, String displayName) {
+ this.url = url;
+ if (displayName != null) {
+ this.displayName = displayName;
+ }
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getContentFile() {
+ return getContentFile(true);
+ }
+
+ @SuppressWarnings("squid:S1166")
+ public String getContentFile(boolean fixupExtension) {
+ if (contentFile == null) {
+ String file;
+ try {
+ URI uri = new URI(url);
+ file = ((uri.getHost() != null ? uri.getHost() : "")
+ + uri.getPath()).replaceAll(BAD_CHARS, "_");
+ } catch (URISyntaxException e) {
+ file = url.replaceAll(BAD_CHARS, "_");
+ }
+ return (!fixupExtension || file.endsWith(".txt")) ? file : file + ".txt";
+ } else {
+ return contentFile;
+ }
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public List<String> getAliasUrls() {
+ return aliasUrls;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public int getMetric() {
+ return metric;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java
new file mode 100644
index 0000000..8983160
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+
+public class LicenseUtil {
+
+ private static int wrapLength = 80;
+ private static int wrapThreshold = 100;
+
+ private LicenseUtil() {
+ }
+
+ public static void setWrapLength(int wrapLength) {
+ LicenseUtil.wrapLength = wrapLength;
+ }
+
+ public static void setWrapThreshold(int wrapThreshold) {
+ LicenseUtil.wrapThreshold = wrapThreshold;
+ }
+
+ public static String trim(String input) throws IOException {
+ try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
+ reader.mark(input.length() + 1);
+ StringWriter sw = new StringWriter();
+ trim(sw, reader);
+ return sw.toString();
+ }
+ }
+
+ public static String process(String input, boolean unpad, boolean wrap) throws IOException {
+ try (BufferedReader reader = new BufferedReader(new StringReader(input))) {
+ reader.mark(input.length() + 1);
+ StringWriter sw = new StringWriter();
+ trim(sw, reader, unpad, wrap);
+ sw.append('\n');
+ return sw.toString();
+ }
+ }
+
+ public static void readAndTrim(Writer out, File file) throws IOException {
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
+ reader.mark((int) file.length() * 2);
+ trim(out, reader);
+ }
+ }
+
+ private static void trim(Writer out, BufferedReader reader) throws IOException {
+ trim(out, reader, true, true);
+ }
+
+ private static void trim(Writer out, BufferedReader reader, boolean unpad, boolean wrap) throws IOException {
+ Pair<Integer, Integer> result = null;
+ if (unpad || wrap) {
+ result = analyze(reader);
+ reader.reset();
+ }
+ doTrim(out, reader, unpad ? result.getLeft() : 0,
+ wrap && (result.getRight() > wrapThreshold) ? wrapLength : Integer.MAX_VALUE);
+ }
+
+ private static void doTrim(Writer out, BufferedReader reader, int extraPadding, int wrapLength) throws IOException {
+ boolean head = true;
+ int empty = 0;
+ for (String line = reader.readLine(); line != null; line = reader.readLine() ) {
+ if ("".equals(line.trim())) {
+ if (!head) {
+ empty++;
+ }
+ } else {
+ head = false;
+ for (; empty > 0; empty--) {
+ out.append('\n');
+ }
+ String trimmed = line.substring(extraPadding);
+ int leadingWS = trimmed.length() - trimmed.trim().length();
+ while (trimmed.length() > wrapLength) {
+ int cut = trimmed.lastIndexOf(' ', wrapLength);
+ cut = Math.max(cut, trimmed.lastIndexOf('\t', wrapLength));
+ if (cut != -1) {
+ out.append(trimmed.substring(0, cut));
+ out.append('\n');
+ trimmed = trimmed.substring(cut + 1);
+ } else {
+ out.append(trimmed.substring(0, wrapLength));
+ out.append('\n');
+ trimmed = trimmed.substring(wrapLength);
+ }
+ for (int i = 0; i < leadingWS; i++) {
+ trimmed = ' ' + trimmed;
+ }
+ }
+ out.append(trimmed);
+ empty++;
+ }
+ }
+ }
+
+ private static Pair<Integer, Integer> analyze(BufferedReader reader) throws IOException {
+ int freeSpaces = Integer.MAX_VALUE;
+ int maxLineLength = 0;
+ for (String line = reader.readLine(); line != null; line = reader.readLine()) {
+ // trim trailing WS
+ String rightTrimmed = line.replaceFirst("\\s*$", "");
+ if ("".equals(rightTrimmed)) {
+ // ignore empty lines
+ continue;
+ }
+ String fullyTrimmed = line.trim();
+ freeSpaces = Math.min(freeSpaces, rightTrimmed.length() - fullyTrimmed.length());
+ maxLineLength = Math.max(maxLineLength, fullyTrimmed.length());
+ }
+ return new ImmutablePair<>(freeSpaces, maxLineLength);
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/Override.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/Override.java
new file mode 100644
index 0000000..c99a047
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/Override.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+public class Override {
+
+ @SuppressWarnings("unused") // set by Maven plugin configuration
+ private String url;
+
+ @SuppressWarnings("unused") // set by Maven plugin configuration
+ private String gav;
+
+ @SuppressWarnings("unused") // set by Maven plugin configuration
+ private String name;
+
+ public String getGav() {
+ return gav;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/SupplementalModelHelper.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/SupplementalModelHelper.java
new file mode 100644
index 0000000..5ba525a
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/SupplementalModelHelper.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugin.resources.remote.Supplement;
+import org.apache.maven.plugin.resources.remote.SupplementalDataModel;
+import org.apache.maven.plugin.resources.remote.io.xpp3.SupplementalDataModelXpp3Reader;
+import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+public class SupplementalModelHelper {
+
+ private SupplementalModelHelper() {
+ }
+
+ // following code taken from ProcessRemoteResourcesMojo (org.apache.maven.plugins:maven-remote-resources-plugin:1.5)
+
+ static String generateSupplementMapKey(String groupId, String artifactId) {
+ return groupId.trim() + ":" + artifactId.trim();
+ }
+
+ static Map<String, Model> loadSupplements(Log log, String[] models) throws MojoExecutionException {
+ if (models == null) {
+ log.debug("Supplemental data models won't be loaded. " + "No models specified.");
+ return Collections.emptyMap();
+ }
+
+ List<Supplement> supplements = new ArrayList<>();
+ for (String set : models) {
+ log.debug("Preparing ruleset: " + set);
+ try {
+ File f = new File(set);
+
+ if (!f.exists()) {
+ throw new MojoExecutionException("Cold not resolve " + set);
+ }
+ if (!f.canRead()) {
+ throw new MojoExecutionException("Supplemental data models won't be loaded. " + "File "
+ + f.getAbsolutePath() + " cannot be read, check permissions on the file.");
+ }
+
+ log.debug("Loading supplemental models from " + f.getAbsolutePath());
+
+ SupplementalDataModelXpp3Reader reader = new SupplementalDataModelXpp3Reader();
+ SupplementalDataModel supplementalModel = reader.read(new FileReader(f));
+ supplements.addAll(supplementalModel.getSupplement());
+ } catch (Exception e) {
+ String msg = "Error loading supplemental data models: " + e.getMessage();
+ log.error(msg, e);
+ throw new MojoExecutionException(msg, e);
+ }
+ }
+
+ log.debug("Loading supplements complete.");
+
+ Map<String, Model> supplementMap = new HashMap<>();
+ for (Supplement sd : supplements) {
+ Xpp3Dom dom = (Xpp3Dom) sd.getProject();
+
+ Model m = getSupplement(log, dom);
+ supplementMap.put(generateSupplementMapKey(m.getGroupId(), m.getArtifactId()), m);
+ }
+
+ return supplementMap;
+ }
+
+ protected static Model getSupplement(Log log, Xpp3Dom supplementModelXml) throws MojoExecutionException {
+ MavenXpp3Reader modelReader = new MavenXpp3Reader();
+ Model model = null;
+
+ try {
+ model = modelReader.read(new StringReader(supplementModelXml.toString()));
+ String groupId = model.getGroupId();
+ String artifactId = model.getArtifactId();
+
+ if (groupId == null || "".equals(groupId.trim())) {
+ throw new MojoExecutionException(
+ "Supplemental project XML requires that a <groupId> element be present.");
+ }
+
+ if (artifactId == null || "".equals(artifactId.trim())) {
+ throw new MojoExecutionException(
+ "Supplemental project XML requires that a <artifactId> element be present.");
+ }
+ } catch (IOException e) {
+ log.warn("Unable to read supplemental XML: " + e.getMessage(), e);
+ } catch (XmlPullParserException e) {
+ log.warn("Unable to parse supplemental XML: " + e.getMessage(), e);
+ }
+
+ return model;
+ }
+
+ protected static Model mergeModels(ModelInheritanceAssembler assembler, Model parent, Model child) {
+ assembler.assembleModelInheritance(child, parent);
+ // ModelInheritanceAssembler doesn't push the name, do it here
+ if (child.getName() == null) {
+ child.setName(parent.getName());
+ }
+ return child;
+ }
+
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/IndentDirective.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/IndentDirective.java
new file mode 100644
index 0000000..77b8afd
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/IndentDirective.java
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license.freemarker;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.Map;
+
+import freemarker.core.Environment;
+import freemarker.template.TemplateBooleanModel;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateDirectiveModel;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateNumberModel;
+import org.apache.commons.io.IOUtils;
+import org.apache.hyracks.maven.license.LicenseUtil;
+
+public class IndentDirective implements TemplateDirectiveModel {
+
+ private static final String PARAM_NAME_SPACES = "spaces";
+ private static final String PARAM_NAME_UNPAD = "unpad";
+ private static final String PARAM_NAME_WRAP = "wrap";
+
+ @Override
+ public void execute(Environment env, Map params, TemplateModel [] loopVars, TemplateDirectiveBody body)
+ throws TemplateException, IOException {
+
+ int numSpaces = -1;
+ boolean unpad = false;
+ boolean wrap = false;
+
+ for (Object o : params.entrySet()) {
+ Map.Entry ent = (Map.Entry) o;
+
+ String paramName = (String) ent.getKey();
+ TemplateModel paramValue = (TemplateModel) ent.getValue();
+
+ switch (paramName) {
+ case PARAM_NAME_SPACES:
+ numSpaces = getIntParam(paramName, paramValue);
+ break;
+ case PARAM_NAME_UNPAD:
+ unpad = getBooleanParam(paramName, paramValue);
+ break;
+ case PARAM_NAME_WRAP:
+ wrap = getBooleanParam(paramName, paramValue);
+ break;
+ default:
+ throw new TemplateModelException("Unsupported parameter: " + paramName);
+ }
+ }
+ if (numSpaces < 0) {
+ throw new TemplateModelException("The required \"" + PARAM_NAME_SPACES + "\" parameter is missing.");
+ }
+
+ if (body == null) {
+ throw new TemplateModelException("Indent requires a body");
+ } else {
+ // Executes the nested body (same as <#nested> in FTL). In this
+ // case we don't provide a special writer as the parameter:
+ StringWriter sw = new StringWriter();
+ body.render(sw);
+ String fixedup = LicenseUtil.process(sw.toString(), unpad, wrap);
+ IOUtils.copy(new StringReader(fixedup), new IndentingWriter(env.getOut(), numSpaces));
+ }
+ }
+
+ private int getIntParam(String paramName, TemplateModel paramValue) throws TemplateModelException {
+ int spacesParam;
+ if (!(paramValue instanceof TemplateNumberModel)) {
+ throw paramException(paramName, "must be a number");
+ }
+ spacesParam = ((TemplateNumberModel) paramValue).getAsNumber().intValue();
+ if (spacesParam < 0) {
+ throw paramException(paramName, "can't be negative");
+ }
+ return spacesParam;
+ }
+
+ private boolean getBooleanParam(String paramName, TemplateModel paramValue) throws TemplateModelException {
+ if (!(paramValue instanceof TemplateBooleanModel)) {
+ throw paramException(paramName, "must be a boolean");
+ }
+ return ((TemplateBooleanModel) paramValue).getAsBoolean();
+ }
+
+ private TemplateModelException paramException(String paramName, String message) throws TemplateModelException {
+ return new TemplateModelException(
+ "The '" + paramName + "' parameter " + message);
+ }
+
+ private static class IndentingWriter extends Writer {
+ private final Writer out;
+ private final char[] padChars;
+ boolean needsToPad;
+
+ public IndentingWriter(Writer out, int numSpaces) {
+ this.out = out;
+ padChars = new char[numSpaces];
+ Arrays.fill(padChars, ' ');
+ needsToPad = true;
+ }
+
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ for (int i = off; i < len; i++) {
+ if (cbuf[i] == '\n') {
+ out.write(cbuf[i]);
+ needsToPad = true;
+ } else {
+ if (needsToPad) {
+ out.write(padChars);
+ needsToPad = false;
+ }
+ out.write(cbuf[i]);
+ }
+ }
+ }
+
+ @Override
+ public void flush() throws IOException {
+ out.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ out.flush();
+ }
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/LoadFileDirective.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/LoadFileDirective.java
new file mode 100644
index 0000000..61d84f1
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/LoadFileDirective.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license.freemarker;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import freemarker.cache.FileTemplateLoader;
+import freemarker.core.Environment;
+import freemarker.template.Configuration;
+import freemarker.template.TemplateBooleanModel;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateDirectiveModel;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateScalarModel;
+import org.apache.hyracks.maven.license.LicenseUtil;
+import org.apache.commons.io.IOUtils;
+
+public class LoadFileDirective implements TemplateDirectiveModel {
+
+ private static final String PARAM_FILE = "file";
+ private static final String PARAM_TRIM = "trim";
+ private static final String PARAM_DEFAULT_TEXT = "defaultOnMissing";
+
+ @Override
+ public void execute(Environment env,
+ Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body)
+ throws TemplateException, IOException {
+
+ String fileParam = null;
+ String defaultParam = null;
+ boolean trimParam = false;
+
+ for (Object paramObj : params.entrySet()) {
+ Map.Entry param = (Map.Entry) paramObj;
+
+ String paramName = (String) param.getKey();
+ TemplateModel paramValue = (TemplateModel) param.getValue();
+
+ switch (paramName) {
+ case PARAM_FILE:
+ if (paramValue instanceof TemplateScalarModel) {
+ fileParam = ((TemplateScalarModel) paramValue).getAsString();
+ } else {
+ throw new TemplateModelException(PARAM_FILE + " must be a string");
+ }
+ break;
+
+ case PARAM_DEFAULT_TEXT:
+ if (paramValue instanceof TemplateScalarModel) {
+ defaultParam = ((TemplateScalarModel) paramValue).getAsString();
+ } else {
+ throw new TemplateModelException(PARAM_DEFAULT_TEXT + " must be a string");
+ }
+ break;
+
+ case PARAM_TRIM:
+ if (paramValue instanceof TemplateBooleanModel) {
+ trimParam = ((TemplateBooleanModel) paramValue).getAsBoolean();
+ } else {
+ throw new TemplateModelException(PARAM_TRIM + " must be a boolean");
+ }
+ break;
+
+ default:
+ throw new TemplateModelException("Unknown param: " + paramName);
+ }
+ }
+ if (fileParam == null) {
+ throw new TemplateModelException(
+ "The required \"" + PARAM_FILE + "\" parameter"
+ + "is missing.");
+ }
+ if (body != null) {
+ throw new TemplateModelException("Body is not supported by this directive");
+ }
+ Writer out = env.getOut();
+ File baseDir = ((FileTemplateLoader)((Configuration)env.getTemplate().getParent()).getTemplateLoader()).baseDir;
+ File file = new File(baseDir, fileParam);
+ if (file.exists()) {
+ if (trimParam) {
+ LicenseUtil.readAndTrim(out, file);
+ out.write('\n');
+ } else {
+ IOUtils.copy(new FileReader(file), out);
+ }
+ } else if (defaultParam != null ) {
+ out.append(defaultParam).append("\n");
+ } else {
+ throw new IOException("File not found: " + file);
+ }
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
new file mode 100644
index 0000000..952b91a
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license.project;
+
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.hyracks.maven.license.LicenseSpec;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class LicensedProjects {
+ private LicenseSpec license;
+
+ private SortedSet<Project> projects = new TreeSet<>(Project.PROJECT_COMPARATOR);
+
+ public LicensedProjects(LicenseSpec license) {
+ this.license = license;
+ }
+
+ @JsonCreator
+ public LicensedProjects(@JsonProperty("license") LicenseSpec license,
+ @JsonProperty("projects") Set<Project> projects) {
+ this.license = license;
+ this.projects.addAll(projects);
+ }
+
+ public LicenseSpec getLicense() {
+ return license;
+ }
+
+ public SortedSet<Project> getProjects() {
+ return projects;
+ }
+
+ public void addProject(Project project) {
+ projects.add(project);
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/Project.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/Project.java
new file mode 100644
index 0000000..e5e57ad
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/Project.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.hyracks.maven.license.project;
+
+import java.io.File;
+import java.util.Comparator;
+
+import org.apache.maven.project.MavenProject;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Project {
+ private String name;
+ private String groupId;
+ private String artifactId;
+ private String url;
+ private String version;
+ private String location;
+ private String artifactPath;
+ private String noticeText;
+ private String licenseText;
+
+ @JsonIgnore
+ private MavenProject mavenProject;
+
+ public static final Comparator<Project> PROJECT_COMPARATOR = (o1, o2) ->
+ o1.compareToken().compareTo(o2.compareToken());
+
+ public Project(MavenProject project, String location, File artifactPath) {
+ mavenProject = project;
+ name = project.getName();
+ groupId = project.getGroupId();
+ artifactId = project.getArtifactId();
+ version = project.getVersion();
+ url = project.getUrl();
+ this.artifactPath = artifactPath.getPath();
+ setLocation(location);
+ }
+
+ @JsonCreator
+ public Project(@JsonProperty("name") String name, @JsonProperty("groupId") String groupId,
+ @JsonProperty("artifactId") String artifactId, @JsonProperty("url") String url,
+ @JsonProperty("version") String version, @JsonProperty("location") String location,
+ @JsonProperty("artifactPath") String artifactPath, @JsonProperty("noticeText") String noticeText,
+ @JsonProperty("licenseText") String licenseText) {
+ this.name = name;
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.url = url;
+ this.version = version;
+ this.location = location;
+ this.artifactPath = artifactPath;
+ this.noticeText = noticeText;
+ this.licenseText = licenseText;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ if (location != null && !location.endsWith("/")) {
+ this.location = location + "/";
+ } else {
+ this.location = location;
+ }
+ }
+
+ @JsonIgnore
+ public String [] getLocations() {
+ return getLocation().split(",");
+ }
+
+ public void setArtifactId(String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getArtifactPath() {
+ return artifactPath;
+ }
+
+ public void setNoticeText(String noticeText) {
+ this.noticeText = noticeText;
+ }
+
+ public String getNoticeText() {
+ return noticeText;
+ }
+
+ public String gav() {
+ return getGroupId() + ":" + getArtifactId() + ":" + getVersion();
+ }
+
+ private String compareToken() {
+ return getName() + getArtifactId() + getVersion() + ":" + getLocation();
+ }
+
+ public String getLicenseText() {
+ return licenseText;
+ }
+
+ public void setLicenseText(String licenseText) {
+ this.licenseText = licenseText;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/pom.xml b/hyracks-fullstack/hyracks/hyracks-maven-plugins/pom.xml
index 176f1d9..474618b 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/pom.xml
@@ -47,12 +47,11 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.3.9</version>
- <type>jar</type>
- <scope>compile</scope>
</dependency>
</dependencies>
<modules>
<module>hyracks-virtualcluster-maven-plugin</module>
+ <module>license-automation-plugin</module>
</modules>
</project>
diff --git a/hyracks-fullstack/hyracks/hyracks-server/pom.xml b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
index 3667951..4f34e52 100644
--- a/hyracks-fullstack/hyracks/hyracks-server/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
@@ -171,7 +171,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.hyracks</groupId>
diff --git a/hyracks-fullstack/pom.xml b/hyracks-fullstack/pom.xml
index efad75b..4473802 100644
--- a/hyracks-fullstack/pom.xml
+++ b/hyracks-fullstack/pom.xml
@@ -137,6 +137,11 @@
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.5</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -471,7 +476,6 @@
</goals>
<!-- combine.self should be override to replace the configuration in the parent POM -->
<configuration combine.self="override">
- <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
<descriptors>
<descriptor>src/main/assembly/source.xml</descriptor>
</descriptors>
@@ -547,5 +551,6 @@
<modules>
<module>hyracks</module>
<module>algebricks</module>
+ <module>hyracks-fullstack-license</module>
</modules>
</project>