asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Minor Improvements To License Generation Plugin
Date Thu, 05 Jan 2017 02:23:57 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1419

Change subject: Minor Improvements To License Generation Plugin
......................................................................

Minor Improvements To License Generation Plugin

- also move stax:stax overrides to supplemental-models.xml

Change-Id: I6ede22dd7e79571133033975901bdacc22d5befe
---
M asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/ExtraLicenseFile.java
M asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/GenerateFileMojo.java
M asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseMojo.java
M asterixdb/asterix-server/pom.xml
M asterixdb/src/main/appended-resources/supplemental-models.xml
5 files changed, 37 insertions(+), 15 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/19/1419/1

diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/ExtraLicenseFile.java
b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/ExtraLicenseFile.java
index 3b3e190..6a0c163 100644
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/ExtraLicenseFile.java
+++ b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/ExtraLicenseFile.java
@@ -23,6 +23,7 @@
 public class ExtraLicenseFile {
     private File file;
     private String location;
+    private boolean additive = true;
 
     public String getLocation() {
         return location;
@@ -39,4 +40,12 @@
     public void setFile(File file) {
         this.file = file;
     }
+
+    public boolean isAdditive() {
+        return additive;
+    }
+
+    public void setAdditive(boolean additive) {
+        this.additive = additive;
+    }
 }
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/GenerateFileMojo.java
b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/GenerateFileMojo.java
index 894b73d..a9cb174 100644
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/GenerateFileMojo.java
+++ b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/GenerateFileMojo.java
@@ -207,7 +207,7 @@
                 }
                 for (Project project : projects.getProjects()) {
                     project.setLocation(extraLicenseFile.getLocation());
-                    addProject(project, projects.getLicense());
+                    addProject(project, projects.getLicense(), extraLicenseFile.isAdditive());
                 }
             }
         }
diff --git a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseMojo.java
b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseMojo.java
index 846c9b6..debb06f 100644
--- a/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseMojo.java
+++ b/asterixdb/asterix-maven-plugins/license-automation-plugin/src/main/java/org/apache/asterix/license/LicenseMojo.java
@@ -160,15 +160,20 @@
             }
         }
         File path = new File(localRepository.getBasedir(), localRepository.pathOf(depProject.getArtifact()));
-        addProject(new Project(depProject, depLocation, path), new LicenseSpec(licenseUrl,
displayName));
+        addProject(new Project(depProject, depLocation, path), new LicenseSpec(licenseUrl,
displayName), true);
     }
 
-    protected void addProject(Project project, LicenseSpec licenseSpecNew) {
-        String licenseUrl = licenseSpecNew.getUrl();
+    protected void addProject(Project project, LicenseSpec spec, boolean additive) {
+        String licenseUrl = spec.getUrl();
         LicenseSpec license = urlToLicenseMap.get(licenseUrl);
         if (license == null) {
-            license = licenseSpecNew;
+            license = spec;
             urlToLicenseMap.put(licenseUrl, license);
+            for (String alias : license.getAliasUrls()) {
+                if (!urlToLicenseMap.containsKey(alias)) {
+                    urlToLicenseMap.put(alias ,license);
+                }
+            }
         }
         licenseUrl = license.getUrl();
         LicensedProjects entry = licenseMap.get(licenseUrl);
@@ -176,7 +181,9 @@
             entry = new LicensedProjects(license);
             licenseMap.put(licenseUrl, entry);
         }
-        entry.addProject(project);
+        if (additive || entry.getProjects().contains(project)) {
+            entry.addProject(project);
+        }
     }
 
     private void buildUrlLicenseMap() throws MojoExecutionException {
@@ -188,7 +195,6 @@
                 if (urlToLicenseMap.put(alias ,license) != null) {
                     throw new MojoExecutionException("Duplicate URL mapping: " + alias);
                 }
-
             }
         }
     }
diff --git a/asterixdb/asterix-server/pom.xml b/asterixdb/asterix-server/pom.xml
index 1f8c79c..1049088 100644
--- a/asterixdb/asterix-server/pom.xml
+++ b/asterixdb/asterix-server/pom.xml
@@ -82,14 +82,6 @@
           </models>
           <overrides>
             <override>
-              <gav>stax:stax:1.1.1-dev</gav>
-              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            </override>
-            <override>
-              <gav>stax:stax:1.2.0</gav>
-              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            </override>
-            <override>
               <gav>org.tukaani:xz:1.0</gav>
               <url>PUBLIC_DOMAIN</url>
             </override>
diff --git a/asterixdb/src/main/appended-resources/supplemental-models.xml b/asterixdb/src/main/appended-resources/supplemental-models.xml
index 10d7290..93a0740 100644
--- a/asterixdb/src/main/appended-resources/supplemental-models.xml
+++ b/asterixdb/src/main/appended-resources/supplemental-models.xml
@@ -162,6 +162,21 @@
   </supplement>
   <supplement>
     <project>
+      <groupId>stax</groupId>
+      <artifactId>stax</artifactId>
+      <licenses>
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+      <properties>
+        <verifiedVersions>1.1.1-dev,1.2.0</verifiedVersions>
+      </properties>
+    </project>
+  </supplement>
+  <supplement>
+    <project>
       <groupId>wss4j</groupId>
       <artifactId>wss4j</artifactId>
       <name>Apache WSS4J</name>

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1419
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ede22dd7e79571133033975901bdacc22d5befe
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message