asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject [1/5] asterixdb git commit: AsterixDB & Hyracks Source Assemblies, Licensing
Date Sun, 15 Jan 2017 01:33:33 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 5226ca874 -> 43b40b68a


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/SupplementalModelHelper.java
----------------------------------------------------------------------
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;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/IndentDirective.java
----------------------------------------------------------------------
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();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/freemarker/LoadFileDirective.java
----------------------------------------------------------------------
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);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
----------------------------------------------------------------------
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);
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/Project.java
----------------------------------------------------------------------
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;
+    }
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-maven-plugins/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/hyracks/hyracks-server/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/43b40b68/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl b/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl
deleted file mode 100644
index 6fd73bd..0000000
--- a/hyracks-fullstack/src/main/licenses/templates/source_licenses.ftl
+++ /dev/null
@@ -1,197 +0,0 @@
-   Portions of the Hyracks admin console in:
-       repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
-       located at:
-         static/javascript/flot/
----
-   Copyright (c) 2007-2014 IOLA and Ole Laursen
-
-   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 Hyracks admin console in:
-       repo/hyracks-control-cc-${project.version}.jar, within ${assembly}
-       located at:
-         static/javascript/jsplumb/
----
-   Copyright (c) 2010 - 2014 jsPlumb, http://jsplumbtoolkit.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.
----
-   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
----
-   Copyright jQuery Foundation and other contributors, https://jquery.org/
-
-   This software consists of voluntary contributions made by many
-   individuals. For exact contribution history, see the revision history
-   available at https://github.com/jquery/jquery
-
-   The following license applies to all parts of this software except as
-   documented below:
-
-   ====
-
-   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.
-
-   ====
-
-   All files located in the node_modules and external directories are
-   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
----
-   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
----
-   jquery.timer.js
-
-   Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
-
-   http://jchavannes.com/jquery-timer
-
-   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 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:
-
-   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.
----
-   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.


Mime
View raw message