asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject [4/5] asterixdb git commit: AsterixDB & Hyracks Source Assemblies, Licensing
Date Sun, 15 Jan 2017 01:33:36 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseSpec.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseSpec.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseSpec.java
deleted file mode 100644
index 885a5bc..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseSpec.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.asterix.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;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseUtil.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseUtil.java
deleted file mode 100644
index 8d09a81..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseUtil.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.asterix.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 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 {
-        Pair<Integer, Integer> result = analyze(reader);
-        reader.reset();
-        doTrim(out, reader, result.getLeft(), 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);
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/Override.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/Override.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/Override.java
deleted file mode 100644
index 4d1bbbe..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/Override.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.asterix.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;
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/SupplementalModelHelper.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/SupplementalModelHelper.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/SupplementalModelHelper.java
deleted file mode 100644
index 9059d07..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/SupplementalModelHelper.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.asterix.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;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/IndentDirective.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/IndentDirective.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/IndentDirective.java
deleted file mode 100644
index fed2a12..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/IndentDirective.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.asterix.license.freemarker;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Map;
-
-import freemarker.core.Environment;
-import freemarker.template.TemplateDirectiveBody;
-import freemarker.template.TemplateDirectiveModel;
-import freemarker.template.TemplateException;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
-import freemarker.template.TemplateNumberModel;
-
-public class IndentDirective implements TemplateDirectiveModel {
-
-    private static final String PARAM_NAME_SPACES = "spaces";
-
-    @Override
-    public void execute(Environment env, Map params, TemplateModel [] loopVars, TemplateDirectiveBody body)
-            throws TemplateException, IOException {
-
-        int spacesParam = -1;
-
-        for (Object o : params.entrySet()) {
-            Map.Entry ent = (Map.Entry) o;
-
-            String paramName = (String) ent.getKey();
-            TemplateModel paramValue = (TemplateModel) ent.getValue();
-
-            if (paramName.equals(PARAM_NAME_SPACES)) {
-                if (!(paramValue instanceof TemplateNumberModel)) {
-                    throw new TemplateModelException(
-                            "The \"" + PARAM_NAME_SPACES + "\" parameter must be a number.");
-                }
-                spacesParam = ((TemplateNumberModel) paramValue).getAsNumber().intValue();
-                if (spacesParam < 0) {
-                    throw new TemplateModelException(
-                            "The \"" + PARAM_NAME_SPACES + "\" parameter can't be negative.");
-                }
-            } else {
-                throw new TemplateModelException("Unsupported parameter: " + paramName);
-            }
-        }
-        if (spacesParam < 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:
-            body.render(new IndentingWriter(env.getOut(), spacesParam));
-        }
-    }
-
-    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();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/LoadFileDirective.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/LoadFileDirective.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/LoadFileDirective.java
deleted file mode 100644
index 603c6bc..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/freemarker/LoadFileDirective.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.asterix.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.asterix.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);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/LicensedProjects.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/LicensedProjects.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/LicensedProjects.java
deleted file mode 100644
index 5b1aa22..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/LicensedProjects.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.asterix.license.project;
-
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.apache.asterix.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);
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/Project.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/Project.java b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/Project.java
deleted file mode 100644
index ce5417e..0000000
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/project/Project.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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.asterix.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;
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-maven-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/pom.xml b/asterixdb/asterix-maven-plugins/pom.xml
index 9da5759..9207abe 100644
--- a/asterixdb/asterix-maven-plugins/pom.xml
+++ b/asterixdb/asterix-maven-plugins/pom.xml
@@ -57,6 +57,5 @@
     <module>asterix-evaluator-generator-maven-plugin</module>
     <module>asterix-test-datagenerator-maven-plugin</module>
     <module>asterix-grammar-extension-maven-plugin</module>
-    <module>license-automation-plugin</module>
   </modules>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-server/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/pom.xml b/asterixdb/asterix-server/pom.xml
index 8cf52d1..ad783a7 100644
--- a/asterixdb/asterix-server/pom.xml
+++ b/asterixdb/asterix-server/pom.xml
@@ -42,9 +42,9 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.asterix</groupId>
+        <groupId>org.apache.hyracks</groupId>
         <artifactId>license-automation-plugin</artifactId>
-        <version>${project.version}</version>
+        <version>${hyracks.version}</version>
         <executions>
           <execution>
             <phase>generate-resources</phase>
@@ -61,7 +61,7 @@
               <outputFile>LICENSE</outputFile>
             </generatedFile>
             <generatedFile>
-              <template>asterixdb/src/main/licenses/templates/asterix-notice.ftl</template>
+              <template>hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/asterix-notice.ftl</template>
               <outputFile>NOTICE</outputFile>
             </generatedFile>
           </generatedFiles>
@@ -219,8 +219,9 @@
             </license>
           </licenses>
           <templateProperties>
-            <assembly>this assembly</assembly>
             <packageName>Server Install</packageName>
+            <asterixAppLocation>repo/asterix-app-${project.version}.jar, within this assembly</asterixAppLocation>
+            <hyracksControlCcLocation>repo/hyracks-control-cc-${project.version}.jar, within this assembly</hyracksControlCcLocation>
           </templateProperties>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/asterix-yarn/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-yarn/pom.xml b/asterixdb/asterix-yarn/pom.xml
index ed476ca..03e62ea 100644
--- a/asterixdb/asterix-yarn/pom.xml
+++ b/asterixdb/asterix-yarn/pom.xml
@@ -86,9 +86,9 @@
         </executions>
       </plugin>
       <plugin>
-        <groupId>org.apache.asterix</groupId>
+        <groupId>org.apache.hyracks</groupId>
         <artifactId>license-automation-plugin</artifactId>
-        <version>${project.version}</version>
+        <version>${hyracks.version}</version>
         <executions>
           <execution>
             <phase>generate-resources</phase>
@@ -104,7 +104,7 @@
               <outputFile>LICENSE</outputFile>
             </generatedFile>
             <generatedFile>
-              <template>asterixdb/src/main/licenses/templates/asterix-notice.ftl</template>
+              <template>hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/asterix-notice.ftl</template>
               <outputFile>NOTICE</outputFile>
             </generatedFile>
           </generatedFiles>
@@ -187,8 +187,9 @@
             </license>
           </licenses>
           <templateProperties>
-            <assembly>asterix/asterix-server-${project.version}-binary-assembly.zip</assembly>
             <packageName>YARN Install</packageName>
+            <asterixAppLocation>repo/asterix-app-${project.version}.jar, within asterix/asterix-server-${project.version}-binary-assembly.zip</asterixAppLocation>
+            <hyracksControlCcLocation>repo/hyracks-control-cc-${project.version}.jar, within asterix/asterix-server-${project.version}-binary-assembly.zip</hyracksControlCcLocation>
           </templateProperties>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 043f801..af301b0 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -473,7 +473,7 @@
       </properties>
     </profile>
     <profile>
-      <id>asterix-release</id>
+      <id>source-assembly</id>
       <activation>
         <file>
           <exists>src/main/assembly/source.xml</exists>
@@ -498,7 +498,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>
@@ -617,6 +616,7 @@
     <module>asterix-coverage</module>
     <module>asterix-active</module>
     <module>asterix-client-helper</module>
+    <module>asterix-license</module>
   </modules>
 
   <repositories>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/src/main/licenses/templates/asterix-license.ftl
----------------------------------------------------------------------
diff --git a/asterixdb/src/main/licenses/templates/asterix-license.ftl b/asterixdb/src/main/licenses/templates/asterix-license.ftl
index 140b365..8b83c1f 100644
--- a/asterixdb/src/main/licenses/templates/asterix-license.ftl
+++ b/asterixdb/src/main/licenses/templates/asterix-license.ftl
@@ -30,9 +30,8 @@ ${license.content}
    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.
+   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()/>
@@ -66,5 +65,10 @@ ${license.content}
    </#if>
 ---
 </#list>
+===
+   AsterixDB 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 "../../../../../hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl">
+<#include "../../../../../hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/source_licenses.ftl">

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/src/main/licenses/templates/asterix-notice.ftl
----------------------------------------------------------------------
diff --git a/asterixdb/src/main/licenses/templates/asterix-notice.ftl b/asterixdb/src/main/licenses/templates/asterix-notice.ftl
deleted file mode 100644
index add0a35..0000000
--- a/asterixdb/src/main/licenses/templates/asterix-notice.ftl
+++ /dev/null
@@ -1,40 +0,0 @@
-<#--
- ! 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.
--->
-Apache AsterixDB ${packageName}
-Copyright 2015-2017 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-AsterixDB utilizes many libraries, which come with the following applicable NOTICE(s):
-
-<#list noticeMap 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>
-
-</#list>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/src/main/licenses/templates/asterix-source-license.ftl
----------------------------------------------------------------------
diff --git a/asterixdb/src/main/licenses/templates/asterix-source-license.ftl b/asterixdb/src/main/licenses/templates/asterix-source-license.ftl
new file mode 100644
index 0000000..f157446
--- /dev/null
+++ b/asterixdb/src/main/licenses/templates/asterix-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 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">

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/src/main/licenses/templates/source_licenses.ftl
----------------------------------------------------------------------
diff --git a/asterixdb/src/main/licenses/templates/source_licenses.ftl b/asterixdb/src/main/licenses/templates/source_licenses.ftl
index 47af1e5..475c6ac 100644
--- a/asterixdb/src/main/licenses/templates/source_licenses.ftl
+++ b/asterixdb/src/main/licenses/templates/source_licenses.ftl
@@ -1,12 +1,51 @@
-   Portions of the AsterixDB WebUI in:
-       repo/asterix-app-${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="AsterixDB WebUI" location="${asterixAppLocation!}"
+                filePrefix="${asterixAppResourcesPrefix!}"
+                licenseName="the following license">
+   Portions of the ${component}
+<#if location?has_content>
+       in: ${location}
+</#if>
        located at:
-         webui/static/js/jquery.min.js
+<#if files?is_sequence>
+<#list files as file>
+<#if file?counter < files?size>
+         ${filePrefix}${file},
+<#else>
        and
-         webui/static/js/jquery.autosize-min.js
-
-   are available under an MIT-style license:
+         ${filePrefix}${file}
+</#if>
+</#list>
+<#else>
+         ${filePrefix}${files}
+</#if>
+
+   are available under ${licenseName}:
+---
+<@indent spaces=3 unpad=true wrap=true>
+<#nested>
+</@indent>
 ---
+</#macro>
+<@license files=["webui/static/js/jquery.min.js", "webui/static/js/jquery.autosize-min.js", "queryui/js/jquery-1.12.4.min.js"]
+          licenseName="an MIT-style license">
    Copyright jQuery Foundation and other contributors, https://jquery.org/
 
    This software consists of voluntary contributions made by many
@@ -43,64 +82,143 @@
    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 AsterixDB WebUI in:
-       repo/asterix-app-${project.version}.jar, within ${assembly}
-       located at:
-         webui/static/js/bootstrap.min.js
-
-   are available under an MIT-style license:
----
-   The MIT License (MIT)
-
-   Copyright (c) 2011-2015 Twitter, Inc
-
-   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.
----
-   Portions of the AsterixDB WebUI in:
-       repo/asterix-app-${project.version}.jar, within ${assembly}
-       located at:
-         webui/static/js/smoothie.js
-
-   are available under an MIT-style license:
----
-   MIT License
-   -----------
-
-   Copyright (c) 2010-2013, Joe Walnes
-                 2013-2014, Drew Noakes
-
-                 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>
+<@license files=["webui/static/js/bootstrap.min.js", "webui/static/css/bootstrap-responsive.min.css", "webui/static/css/bootstrap.min.css"]>
+   Copyright 2012 Twitter, Inc.
+   http://www.apache.org/licenses/LICENSE-2.0.txt
+</@license>
+<@license files=["webui/static/js/smoothie.js", "feed/smoothie.js"]>
+Copyright (c) 2010-2013, Joe Walnes
+
+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>
+<@license component="AsterixDB QueryUI" files=["queryui/js/json-formatter.min.js", "queryui/css/json-formatter.min.css"]>
+    Copyright 2014 Mohsen Azimi
+
+    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.
+</@license>
+<@license component="AsterixDB QueryUI" files=["queryui/js/bootstrap.min.js", "queryui/css/bootstrap.min.css", "queryui/css/bootstrap-theme.min.css"]>
+The MIT License (MIT)
+
+Copyright (c) 2011-2015 Twitter, Inc
+
+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.
+
+queryui/css/bootstrap.min.css also contains normalize.css v3.0.3 (http://github.com/necolas/normalize.css), having the following copyright:
+
+Copyright © Nicolas Gallagher and Jonathan Neal
+
+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>
+
+<@license component="AsterixDB QueryUI" files="queryui/js/angular.min.js" licenseName="The MIT License">
+    Copyright (c) 2010-2016 Google, Inc. http://angularjs.org
+
+    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>
+<@license component="AsterixDB QueryUI" licenseName="The MIT License"
+          files=["queryui/js/codemirror.js", "queryui/js/javascript.js", "queryui/css/codemirror.css"]>
+    Copyright (C) 2016 by Marijn Haverbeke <marijnh@gmail.com> and others
+
+    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>
+<@license component="AsterixDB QueryUI" files="queryui/js/ui-codemirror.js" licenseName="The MIT License">
+    Copyright (c) 2012 the AngularUI Team, http://angular-ui.github.com
+
+    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>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/asterixdb/src/main/licenses/templates/source_only_licenses.ftl
----------------------------------------------------------------------
diff --git a/asterixdb/src/main/licenses/templates/source_only_licenses.ftl b/asterixdb/src/main/licenses/templates/source_only_licenses.ftl
new file mode 100644
index 0000000..376b1bf
--- /dev/null
+++ b/asterixdb/src/main/licenses/templates/source_only_licenses.ftl
@@ -0,0 +1,80 @@
+<#--
+ ! 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>
+<@license files="asterix-examples/src/main/resources/admaql101-demo/bottle.py"
+          component="AsterixDB API examples" licenseName="The MIT License">
+    Copyright (c) 2014, Marcel Hellkamp.
+
+    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>
+<@license files="asterix-examples/src/main/resources/tweetbook-demo/static/js/geostats.js"
+          component="AsterixDB API examples" licenseName="The MIT License">
+Copyright (c) 2011 Simon Georget
+
+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>
+<@license files="asterix-examples/src/main/resources/tweetbook-demo/static/js/rainbowvis.js"
+          component="AsterixDB API examples" licenseName="The MIT License">
+
+See https://opensource.org/licenses/mit-license.php
+
+</@license>


Mime
View raw message