[NO ISSUE] Fix license generation

Change-Id: I97d005052202b3053ab0ad1be3ad2858c16757c4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb-clients/+/15423
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-license.ftl b/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-license.ftl
new file mode 100644
index 0000000..abc19f6
--- /dev/null
+++ b/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-license.ftl
@@ -0,0 +1,62 @@
+<#--
+ ! 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 JDBC DRIVER COMPONENTS:
+
+   AsterixDB JDBC Driver includes a number of subcomponents with separate copyright
+   notices and license terms. Your use of these subcomponents is subject
+   to the terms and condition of the following licenses.
+===
+<#list licenseMap as e>
+   <#assign licenseUrl = e.getKey()/>
+   <#assign entry = e.getValue()/>
+   <#assign projects = entry.projects/>
+   <#assign license = entry.getLicense()/>
+   <#if projects?size == 1>
+   Component:
+     <#assign isare = "is"/>
+   <#else>
+   Components:
+     <#assign isare = "are"/>
+   </#if>
+   <#list projects as p>
+   * ${p.name} (${p.groupId}:${p.artifactId}:${p.version})
+   </#list>
+
+   <#if license.url == "PUBLIC_DOMAIN">
+   ${isare} in the public domain.
+   <#elseif license.url == "http://www.apache.org/licenses/LICENSE-2.0.txt">
+   ${isare} available under ${license.displayName}.
+   <#else>
+   ${isare} available under ${license.displayName!"the following license"}:
+---
+<@indent spaces=6>
+${license.content}
+</@indent>
+   </#if>
+---
+</#list>
diff --git a/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-notice.ftl b/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-notice.ftl
new file mode 100644
index 0000000..8308379
--- /dev/null
+++ b/asterixdb-jdbc/src/main/licenses/templates/asterix-jdbc-driver-notice.ftl
@@ -0,0 +1,47 @@
+<#--
+ ! 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.
+-->
+<#-- TODO(mblow): share notice file template with hyracks via maven artifact -->
+<#if packageName?has_content>
+${packageName!}
+<#else>
+Apache AsterixDB JDBC Driver
+</#if>
+Copyright 2021-${.now?string('yyyy')} The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+The Initial Developer of the driver software is Couchbase, Inc.
+Copyright 2021 Couchbase, Inc.
+<#list noticeMap>
+
+AsterixDB JDBC Driver utilizes several libraries, which come with the following applicable NOTICE(s):
+<#items as e>
+   <#assign noticeText = e.getKey()/>
+   <#assign projects = e.getValue()/>
+
+   <#list projects as p>
+   * ${p.name} (${p.groupId}:${p.artifactId}:${p.version})
+   </#list>
+
+<@indent spaces=6>
+${noticeText}
+</@indent>
+</#items>
+</#list>