From 8be06a4db5eacddb127888ca7faa5e4e641eabc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 27 Jan 2018 08:36:52 +0100 Subject: [PATCH 1/6] Use correct ALv2 header for newly created files in nbbuild --- nbbuild/nbproject/project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbbuild/nbproject/project.xml b/nbbuild/nbproject/project.xml index bcccf0792a81..638eed94012b 100644 --- a/nbbuild/nbproject/project.xml +++ b/nbbuild/nbproject/project.xml @@ -200,7 +200,7 @@ - cddl-netbeans-sun + apache20-asf From f4e171c063a240ac1cf88061814c6cc31cf9572a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Fri, 26 Jan 2018 21:25:38 +0100 Subject: [PATCH 2/6] [NETBEANS-311] Add license infos for individual files to modules and integrate into build process This commit adds the option to add a licenseinfo.xml file to each netbeans module. This file holds for a set of source files the information: - license reference to one of the "well-known" licenses (not all file formats allow for license information) - addition license information (for example the eclipse distribution license requires the copyright to be present and not just the license text) - required addition to notice file - comment field for explanation why the file is present The LICENSE file get very big with this change. To make it still readable, the license texts are not put into the same file, but into the licenses subdirectory. --- .../nbbuild/extlibs/CreateLicenseSummary.java | 293 +++++++++++++----- .../extlibs/ExclusionsFromLicenseInfo.java | 74 +++++ .../extlibs/ReportFromLicenseinfo.java | 256 +++++++++++++++ .../extlibs/VerifyLibsAndLicenses.java | 62 ++++ .../extlibs/licenseinfo/CommentType.java | 36 +++ .../nbbuild/extlibs/licenseinfo/Fileset.java | 135 ++++++++ .../extlibs/licenseinfo/Licenseinfo.java | 84 +++++ .../extlibs/licenseinfo/Licenseinfos.java | 41 +++ nbbuild/build.xml | 75 +++-- nbbuild/rat-exclusions.txt | 1 + nbbuild/rat-licenseinfo-stub.txt | 11 + 11 files changed, 965 insertions(+), 103 deletions(-) create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ExclusionsFromLicenseInfo.java create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ReportFromLicenseinfo.java create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/CommentType.java create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Fileset.java create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfo.java create mode 100644 nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfos.java create mode 100644 nbbuild/rat-licenseinfo-stub.txt diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/CreateLicenseSummary.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/CreateLicenseSummary.java index da4f16901303..6e42e716c9d2 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/CreateLicenseSummary.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/CreateLicenseSummary.java @@ -28,6 +28,10 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; @@ -48,6 +52,8 @@ import org.apache.tools.ant.Task; import org.apache.tools.ant.types.selectors.SelectorUtils; import org.netbeans.nbbuild.JUnitReportWriter; +import org.netbeans.nbbuild.extlibs.licenseinfo.Fileset; +import org.netbeans.nbbuild.extlibs.licenseinfo.Licenseinfo; /** * Creates a list of external binaries and their licenses. @@ -95,66 +101,230 @@ public void setNoticeStub(File noticeStub) { public void setReport(File report) { this.reportFile = report; } + + private File licenseTargetDir = null; + + public void setLicenseTargetDir(File licenseTargetDir) { + this.licenseTargetDir = licenseTargetDir; + } + private Set modules; + public void setModules(String modules) { + if(modules == null) { + modules = ""; + } + this.modules = new TreeSet<>(); + this.modules.addAll(Arrays.asList(modules.split("[, ]+"))); + } + + private boolean binary; + public void setBinary(boolean binary) { + this.binary = binary; + } + private Map pseudoTests; public @Override void execute() throws BuildException { + if (modules == null || modules.isEmpty()) { + modules = new TreeSet<>(); + for (String cluster : getProject().getProperty("nb.clusters.list").split("[, ]+")) { + modules.addAll(Arrays.asList(getProject().getProperty(cluster).split("[, ]+"))); + } + modules.add("nbbuild"); + } + pseudoTests = new LinkedHashMap<>(); - try { - Map> crc2License = findCrc2LicenseHeaderMapping(); - Map> binaries2LicenseHeaders = new TreeMap<>(); - StringBuilder testBinariesAreUnique = new StringBuilder(); - List ignoredPatterns = VerifyLibsAndLicenses.loadPatterns("ignored-binary-overlaps"); - findBinaries(build, binaries2LicenseHeaders, crc2License, new HashMap<>(), "", testBinariesAreUnique, ignoredPatterns); - pseudoTests.put("testBinariesAreUnique", testBinariesAreUnique.length() > 0 ? "Some binaries are duplicated (edit nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binary-overlaps as needed)" + testBinariesAreUnique : null); - try (PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(license), "UTF-8")); - PrintWriter nw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(notice), "UTF-8"))) { - try (Reader r = new InputStreamReader(new FileInputStream(licenseStub), "UTF-8")) { - int read; - while ((read = r.read()) != (-1)) { - pw.write(read); - } + + try (PrintWriter licenseWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(license), "UTF-8")); + PrintWriter noticeWriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(notice), "UTF-8"))) { + + try (Reader r = new InputStreamReader(new FileInputStream(licenseStub), "UTF-8")) { + int read; + while ((read = r.read()) != (-1)) { + licenseWriter.write(read); } - pw.println(); - pw.println("********************************************************************************"); - pw.println("Apache NetBeans includes a number of components and libraries with separate"); - pw.println("copyright notices and license terms. Your use of those components are"); - pw.println("subject to the terms and conditions of the following licenses. "); - pw.println("********************************************************************************"); - pw.println(); - - try (Reader r = new InputStreamReader(new FileInputStream(noticeStub), "UTF-8")) { - int read; - while ((read = r.read()) != (-1)) { - nw.write(read); - } + } + + try (Reader r = new InputStreamReader(new FileInputStream(noticeStub), "UTF-8")) { + int read; + while ((read = r.read()) != (-1)) { + noticeWriter.write(read); } + } - Set licenseNames = new TreeSet<>(); - pw.printf("%-72s %s\n", "THIRD-PARTY COMPONENT FILE", "LICENSE"); - pw.printf("%-44s %s\n", "(path in the installation)", "(see license text reproduced below)"); - pw.println("--------------------------------------------------------------------------------"); - Set notices = new HashSet<>(); - for (Map.Entry> entry : binaries2LicenseHeaders.entrySet()) { - String binary = entry.getKey(); - Map headers = entry.getValue(); - pw.printf("%-69s %s\n", binary, getMaybeMissing(headers, "License")); - String license = headers.get("License"); - if (license != null) { - licenseNames.add(license); - } else { - //TODO: should be error/test failure, or something like that. - System.err.println("No license for: " + binary); + Set notices = new HashSet<>(); + Set licenseNames = new TreeSet<>(); + + if(binary) { + evaluateBinaries(licenseWriter, noticeWriter, notices, licenseNames); + } + evaluateLicenseInfo(licenseWriter, noticeWriter, notices, licenseNames); + + File licenses = new File(new File(nball, "nbbuild"), "licenses"); + if(licenseTargetDir != null) { + licenseTargetDir.mkdirs(); + } + for (String licenseName : licenseNames) { + if (licenseName == null) { + continue; + } + File license = new File(licenses, licenseName); + if (!license.isFile()) { + continue; + } + if (licenseTargetDir == null) { + licenseWriter.println(); + licenseWriter.println(); + licenseWriter.println("==="); + licenseWriter.println("======"); + licenseWriter.println("========================= " + licenseName + " ========================="); + licenseWriter.println(); + try (InputStream is = new FileInputStream(license)) { + BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8")); + String line; + while ((line = r.readLine()) != null) { + licenseWriter.println(line); + } + r.close(); } + } else { + File targetFile = new File(licenseTargetDir, licenseName); + Files.copy(license.toPath(), targetFile.toPath(), + StandardCopyOption.REPLACE_EXISTING); + } - String notice = headers.get("notice"); - if (notice != null && !notices.contains(notice.hashCode())) { - notices.add(notice.hashCode()); - addNotice(nw, notice); + } + + licenseWriter.flush(); + } catch (IOException x) { + throw new BuildException(x, getLocation()); + } + log(license + ": written"); + JUnitReportWriter.writeReport(this, null, reportFile, pseudoTests); + } + + private void evaluateLicenseInfo(final PrintWriter licenseWriter, final PrintWriter noticeWriter, Set notices, Set licenseNames) throws IOException { + + licenseWriter.println(); + licenseWriter.println("******************************************************************************************************************************************************"); + licenseWriter.println("Apache NetBeans includes a number of source files that are not covered by the apache license. The following files are part of this distribution."); + licenseWriter.println("******************************************************************************************************************************************************"); + licenseWriter.println(); + + licenseWriter.printf("%-100s%40s%10s\n", "Sourcefile", "LICENSE", "NOTES"); + if(licenseTargetDir != null) { + licenseWriter.printf("%-100s%40s\n", "(path in the source)", "(text is in file in licenses directory)"); + } else { + licenseWriter.printf("%-100s%40s\n", "(path in the source)", "(see license text reproduced below)"); + } + licenseWriter.println("------------------------------------------------------------------------------------------------------------------------------------------------------"); + + List footnotes = new ArrayList<>(); + + for(String module : modules) { + File moduleDir = new File(nball, module); + File licenseInfoFile = new File(moduleDir, "licenseinfo.xml"); + if(! licenseInfoFile.exists()) { + continue; + } + + Licenseinfo licenseInfo = Licenseinfo.parse(licenseInfoFile); + + for(Fileset fs: licenseInfo.getFilesets()) { + if("Apache-2.0".equals(fs.getLicenseRef())) { + continue; + } + if(binary && fs.isSourceOnly()) { + continue; + } + + String notes = ""; + if(fs.getLicenseInfo() != null) { + int idx = footnotes.indexOf(fs.getLicenseInfo()); + if(idx < 0) { + footnotes.add(fs.getLicenseInfo()); + idx = footnotes.size() - 1; } + notes = Integer.toString(idx + 1); + } + for(File f: fs.getFiles()) { + Path relativePath = nball.toPath().relativize(f.toPath()); + licenseWriter.printf("%-120s%20s%10s\n", relativePath, fs.getLicenseRef(), notes); + } + + if(fs.getLicenseRef() != null) { + licenseNames.add(fs.getLicenseRef()); + } + + String notice = fs.getNotice(); + if (notice != null) { + notice = notice.trim(); + if (!notices.contains(notice)) { + notices.add(notice); + addNotice(noticeWriter, notice); + } + } + } + } + + if (!footnotes.isEmpty()) { + licenseWriter.print("\n"); + licenseWriter.print("Notes\n"); + licenseWriter.print("-----\n"); + for (int i = 0; i < footnotes.size(); i++) { + String footnote = footnotes.get(i); + licenseWriter.printf("[%3d] %s\n\n", i + 1, footnote.trim()); + } + } + } + private void evaluateBinaries(final PrintWriter licenseWriter, final PrintWriter noticeWriter, Set notices, Set licenseNames) throws IOException { + Map> crc2License = findCrc2LicenseHeaderMapping(); + Map> binaries2LicenseHeaders = new TreeMap<>(); + StringBuilder testBinariesAreUnique = new StringBuilder(); + List ignoredPatterns = VerifyLibsAndLicenses.loadPatterns("ignored-binary-overlaps"); + findBinaries(build, binaries2LicenseHeaders, crc2License, new HashMap<>(), "", testBinariesAreUnique, ignoredPatterns); + pseudoTests.put("testBinariesAreUnique", testBinariesAreUnique.length() > 0 ? "Some binaries are duplicated (edit nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binary-overlaps as needed)" + testBinariesAreUnique : null); + + licenseWriter.println(); + licenseWriter.println("********************************************************************************"); + licenseWriter.println("Apache NetBeans includes a number of components and libraries with separate"); + licenseWriter.println("copyright notices and license terms. Your use of those components are"); + licenseWriter.println("subject to the terms and conditions of the following licenses. "); + licenseWriter.println("********************************************************************************"); + licenseWriter.println(); + + licenseWriter.printf("%-68s%12s\n", "THIRD-PARTY COMPONENT FILE", "LICENSE"); + if(licenseTargetDir != null) { + licenseWriter.printf("%-40s%40s\n", "(path in the installation)", "(text is in file in licenses directory)"); + } else { + licenseWriter.printf("%-40s%40s\n", "(path in the installation)", "(see license text reproduced below)"); + } + licenseWriter.println("--------------------------------------------------------------------------------"); + + for (Map.Entry> entry : binaries2LicenseHeaders.entrySet()) { + String binary = entry.getKey(); + Map headers = entry.getValue(); + licenseWriter.printf("%-69s %s\n", binary, getMaybeMissing(headers, "License")); + String license = headers.get("License"); + if (license != null) { + licenseNames.add(license); + } else { + //TODO: should be error/test failure, or something like that. + System.err.println("No license for: " + binary); + } + + String notice = headers.get("notice"); + if (notice != null) { + notice = notice.trim(); + if (!notices.contains(notice)) { + notices.add(notice); + addNotice(noticeWriter, notice); } + } + + } // String[] otherHeaders = {"Name", "Version", "Description", "Origin"}; // Map,Set> licenseHeaders2Binaries = new LinkedHashMap,Set>(); // for (Map.Entry> entry : binaries2LicenseHeaders.entrySet()) { @@ -177,37 +347,6 @@ void execute() throws BuildException { // pw.println(binary); // } // } - File licenses = new File(new File(nball, "nbbuild"), "licenses"); - for (String licenseName : licenseNames) { - if (licenseName == null) { - continue; - } - File license = new File(licenses, licenseName); - if (!license.isFile()) { - continue; - } - pw.println(); - pw.println(); - pw.println("==="); - pw.println("======"); - pw.println("========================= " + licenseName + " ========================="); - pw.println(); - try (InputStream is = new FileInputStream(license)) { - BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8")); - String line; - while ((line = r.readLine()) != null) { - pw.println(line); - } - r.close(); - } - } - pw.flush(); - } - log(license + ": written"); - } catch (IOException x) { - throw new BuildException(x, getLocation()); - } - JUnitReportWriter.writeReport(this, null, reportFile, pseudoTests); } private String getMaybeMissing(Map headers, String headerName) { diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ExclusionsFromLicenseInfo.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ExclusionsFromLicenseInfo.java new file mode 100644 index 000000000000..31b901c4d743 --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ExclusionsFromLicenseInfo.java @@ -0,0 +1,74 @@ +/* + * 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.netbeans.nbbuild.extlibs; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.types.FileSet; +import org.netbeans.nbbuild.extlibs.licenseinfo.Fileset; +import org.netbeans.nbbuild.extlibs.licenseinfo.Licenseinfo; + +public class ExclusionsFromLicenseInfo extends Task { + + private File nball; + public void setNball(File nball) { + this.nball = nball; + } + + private String licenseinfoFileset; + public void setLicenseinfoFileset(String licenseinfoFileset) { + this.licenseinfoFileset = licenseinfoFileset; + } + + public @Override void execute() throws BuildException { + try { + Path nballPath = nball.toPath(); + List licenseinfofiles = Files.walk(nballPath) + .filter(p -> p.endsWith("licenseinfo.xml")) + .map(p -> p.toFile()) + .collect(Collectors.toList()); + + FileSet licenseinfoFileset = new FileSet(); + licenseinfoFileset.setProject(getProject()); + licenseinfoFileset.setDir(nball.getAbsoluteFile()); + + for(File licenseInfoFile: licenseinfofiles) { + Licenseinfo li = Licenseinfo.parse(licenseInfoFile); + for(Fileset fs: li.getFilesets()) { + for(File f: fs.getFiles()) { + Path relativePath = nball.toPath().relativize(f.toPath()); + licenseinfoFileset.appendIncludes(new String[]{relativePath.toString()}); + } + } + } + + getProject().addReference(this.licenseinfoFileset, licenseinfoFileset); + } catch (IOException ex) { + throw new BuildException(ex); + } + } +} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ReportFromLicenseinfo.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ReportFromLicenseinfo.java new file mode 100644 index 000000000000..3aa4e43524b2 --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ReportFromLicenseinfo.java @@ -0,0 +1,256 @@ +/* + * 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.netbeans.nbbuild.extlibs; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Properties; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.nbbuild.extlibs.licenseinfo.CommentType; +import org.netbeans.nbbuild.extlibs.licenseinfo.Fileset; +import org.netbeans.nbbuild.extlibs.licenseinfo.Licenseinfo; + +public class ReportFromLicenseinfo extends Task { + + private File nball; + public void setNball(File nball) { + this.nball = nball; + } + + private File report; + public void setReport(File report) { + this.report = report; + } + + public @Override void execute() throws BuildException { + Properties licenseNames = new Properties(); + try (InputStream is = new FileInputStream(new File(nball, "nbbuild/licenses/names.properties"))) { + licenseNames.load(is); + } catch (IOException ex) { + throw new BuildException(ex); + } + + try (FileOutputStream fos = new FileOutputStream(report); + OutputStreamWriter osw = new OutputStreamWriter(fos, Charset.forName("UTF-8")); + PrintWriter pw = new PrintWriter(osw)) { + + try(FileInputStream fis = new FileInputStream(new File(nball, "nbbuild/rat-licenseinfo-stub.txt")); + InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); + BufferedReader br = new BufferedReader(isr)) { + for(String line = br.readLine(); line != null; line = br.readLine()) { + pw.write(line); + pw.write("\n"); + } + } + + Path nballPath = nball.toPath(); + List licenseinfofiles = Files.walk(nballPath) + .filter(p -> p.endsWith("licenseinfo.xml")) + .map(p -> p.toFile()) + .collect(Collectors.toList()); + + TreeMap> licenseInfo = new TreeMap<>(); + + for (File licenseInfoFile: licenseinfofiles) { + Licenseinfo li = Licenseinfo.parse(licenseInfoFile); + for(Fileset fs: li.getFilesets()) { + LicenseGroup lg = new LicenseGroup( + fs.getLicenseRef(), + fs.getLicenseInfo(), + fs.getCommentType(), + fs.getComment() + ); + if(! licenseInfo.containsKey(lg)) { + licenseInfo.put(lg, new ArrayList<>()); + } + for(File f: fs.getFiles()) { + licenseInfo.get(lg).add(f); + } + } + + } + + pw.print("====================================== Per File Information ======================================\n\n"); + + for(Entry> e: licenseInfo.entrySet()) { + LicenseGroup lg = e.getKey(); + String licenseName = licenseNames.getProperty(lg.getLicenseRef()); + + if(licenseName != null) { + pw.printf("#### %s: %s\n\n", lg.getLicenseRef(), licenseName); + } else { + pw.printf("#### %s\n\n", lg.getLicenseRef()); + } + if(lg.getCommentType() != null || lg.getComment() != null) { + if(lg.getCommentType() != null) { + pw.printf("%s\n\n", lg.getCommentType().getOutputComment()); + } + if(lg.getComment() != null) { + pw.printf("%s\n\n", lg.getComment().trim()); + } + } + pw.printf("-- Files --\n"); + for(File f: e.getValue()) { + Path relativePath = nball.toPath().relativize(f.toPath()); + pw.printf("%s\n", relativePath.toString()); + } + pw.printf("\n"); + } + + pw.print("========================================= Other excludes =========================================\n\n"); + + try (FileInputStream fis = new FileInputStream(new File(nball, "nbbuild/rat-exclusions.txt")); + InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); + BufferedReader br = new BufferedReader(isr)) { + + boolean beginSkipped = false; + + for(String line = br.readLine(); line != null; line = br.readLine()) { + if (beginSkipped) { + pw.write(line); + pw.write("\n"); + } + + if(line.contains("###### BEGIN OF EXCLUSIONS")) { + beginSkipped = true; + } + } + } + } catch (IOException ex) { + throw new BuildException(ex); + } + } + + + private static class LicenseGroup implements Comparable { + private static final String ALV2 = "Apache-2.0"; + + private final String licenseRef; + private final CommentType commentType; + private final String comment; + + public LicenseGroup(String licenseRef, String licenseInfo, CommentType commentType, String comment) { + this.licenseRef = licenseRef; + this.commentType = commentType; + this.comment = comment; + } + + public String getLicenseRef() { + return licenseRef; + } + + public CommentType getCommentType() { + return commentType; + } + + public String getComment() { + return comment; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 89 * hash + Objects.hashCode(this.licenseRef); + hash = 89 * hash + Objects.hashCode(this.commentType); + hash = 89 * hash + Objects.hashCode(this.comment); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LicenseGroup other = (LicenseGroup) obj; + if (!Objects.equals(this.licenseRef, other.licenseRef)) { + return false; + } + if (!Objects.equals(this.comment, other.comment)) { + return false; + } + if (this.commentType != other.commentType) { + return false; + } + return true; + } + + + + @Override + public int compareTo(LicenseGroup o) { + String licenseNameA = nvl(getLicenseRef(), ""); + String licenseNameB = nvl(o.getLicenseRef(), ""); + + if(ALV2.equals(licenseNameA) && (! ALV2.equals(licenseNameB))) { + return -1; + } else if(ALV2.equals(licenseNameB) && (! ALV2.equals(licenseNameA))) { + return 1; + } + + int result = licenseNameA.compareTo(licenseNameB); + if(result != 0) { + return result; + } + + String commentTypeA = getCommentType() != null ? getCommentType().name() : ""; + String commentTypeB = o.getCommentType() != null ? o.getCommentType().name() : ""; + result = commentTypeA.compareTo(commentTypeB); + if (result != 0) { + return result; + } + + String commentA = nvl(getComment(), ""); + String commentB = nvl(o.getComment(), ""); + result = commentA.compareTo(commentB); + return result; + } + + private static String nvl(String input, String replacement) { + if(input == null) { + return replacement; + } else { + return input; + } + } + } +} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java index b56a3b1ca598..5554c93a73df 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java @@ -32,6 +32,8 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CodingErrorAction; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -54,6 +56,9 @@ import org.apache.tools.ant.types.selectors.SelectorUtils; import org.netbeans.nbbuild.JUnitReportWriter; import org.netbeans.nbbuild.extlibs.DownloadBinaries.MavenCoordinate; +import org.netbeans.nbbuild.extlibs.licenseinfo.Fileset; +import org.netbeans.nbbuild.extlibs.licenseinfo.Licenseinfo; +import org.netbeans.nbbuild.extlibs.licenseinfo.Licenseinfos; /** * Task to check that external libraries have legitimate licenses, etc. @@ -92,6 +97,7 @@ public void setHaltonfailure(boolean haltonfailure) { testLicenseFilesAreProperlyFormattedPhysically(); testLicenses(); testBinaryUniqueness(); + testLicenseinfo(); } catch (IOException x) { throw new BuildException(x, getLocation()); } @@ -381,6 +387,62 @@ private void testLicenses() throws IOException { } pseudoTests.put("testLicenses", msg.length() > 0 ? "Some license files have incorrect headers" + msg : null); } + + private void testLicenseinfo() throws IOException { + Path nballPath = nball.toPath(); + List licenseinfofiles = Files.walk(nballPath) + .filter(p -> p.endsWith("licenseinfo.xml")) + .map(p -> p.toFile()) + .collect(Collectors.toList()); + + File licenses = new File(new File(nball, "nbbuild"), "licenses"); + StringBuilder msg = new StringBuilder(); + + for (File licenseInfoFile: licenseinfofiles) { + String path = nballPath.relativize(licenseInfoFile.toPath()).toString(); + + Licenseinfo li; + try { + li = Licenseinfo.parse(licenseInfoFile); + } catch (IOException ex) { + msg.append("\n"); + msg.append(path); + msg.append(" could not be parsed: "); + msg.append(ex.getMessage()); + continue; + } + + for(Fileset fs: li.getFilesets()) { + for(File f: fs.getFiles()) { + if(! f.exists()) { + Path relativePath = li.getLicenseinfoFile().getParentFile().toPath().relativize(f.toPath()); + msg.append("\n"); + msg.append(path); + msg.append(" referenced file not found '"); + msg.append(relativePath.toString()); + msg.append("'"); + } + } + if(fs.getLicenseRef() != null) { + File licenseFile = new File(licenses, fs.getLicenseRef()); + if (!licenseFile.exists()) { + msg.append("\n"); + msg.append(path); + msg.append(" referenced license does not exist '"); + msg.append(fs.getLicenseRef()); + msg.append("'"); + } + } else { + msg.append("\n"); + msg.append(path); + msg.append(" missing license reference"); + } + } + } + + pseudoTests.put("testLicenseinfo", msg.length() > 0 ? "Some licenseinfo.xml files failed verification:" + msg : null); + } + private static String templateMatch(String actual, String expected, boolean left) { String reason = null; boolean expectReason = false; diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/CommentType.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/CommentType.java new file mode 100644 index 000000000000..6a7a8022fa9a --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/CommentType.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.nbbuild.extlibs.licenseinfo; + +public enum CommentType { + TEMPLATE_MINIMAL_IP("The file is used as a template and contains minimal IP."), + CATEGORY_B("The contained code is used at runtime and must be included in source form."), + COMMENT_UNSUPPORTED("Filetype does not support comments."), + GUI_USABILITY("Code is visible at runtime and added license would negatively affect usability."); + + private String outputComment; + + CommentType(String outputComment) { + this.outputComment = outputComment; + } + + public String getOutputComment() { + return outputComment; + } +} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Fileset.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Fileset.java new file mode 100644 index 000000000000..181af101e5ca --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Fileset.java @@ -0,0 +1,135 @@ +/* + * 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.netbeans.nbbuild.extlibs.licenseinfo; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +public class Fileset { + + private final List files = new ArrayList<>(); + private String licenseRef; + private String licenseInfo; + private CommentType commentType; + private String comment; + private String notice; + private boolean sourceOnly; + + public List getFiles() { + return files; + } + + public String getLicenseRef() { + return licenseRef; + } + + public void setLicenseRef(String licenseRef) { + if (licenseRef != null && licenseRef.trim().isEmpty()) { + licenseRef = null; + } + this.licenseRef = licenseRef; + } + + public String getLicenseInfo() { + return licenseInfo; + } + + public void setLicenseInfo(String licenseInfo) { + if (licenseInfo != null && licenseInfo.trim().isEmpty()) { + licenseInfo = null; + } + this.licenseInfo = licenseInfo; + } + + public CommentType getCommentType() { + return commentType; + } + + public void setCommentType(CommentType commentType) { + this.commentType = commentType; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + if (comment != null && comment.trim().isEmpty()) { + comment = null; + } + this.comment = comment; + } + + public boolean isSourceOnly() { + return sourceOnly; + } + + public void setSourceOnly(boolean sourceOnly) { + this.sourceOnly = sourceOnly; + } + + public String getNotice() { + return notice; + } + + public void setNotice(String notice) { + if (notice != null && notice.trim().isEmpty()) { + notice = null; + } + this.notice = notice; + } + + void parse(File licenseinfo, Element fileset) { + NodeList childNodes = fileset.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + if (childNodes.item(i) instanceof Element) { + Element e = (Element) childNodes.item(i); + if ("file".equals(e.getTagName())) { + getFiles().add(new File(licenseinfo.getParentFile(), e.getTextContent())); + } else if ("license".equals(e.getTagName())) { + String text = e.getTextContent(); + if (text != null && (!text.trim().isEmpty())) { + setLicenseInfo(text); + } + if (!e.getAttribute("ref").isEmpty()) { + setLicenseRef(e.getAttribute("ref")); + } + } else if ("comment".equals(e.getTagName())) { + String text = e.getTextContent(); + if (text != null && (!text.trim().isEmpty())) { + setComment(text); + } + if (!e.getAttribute("type").isEmpty()) { + setCommentType(CommentType.valueOf(e.getAttribute("type"))); + } + } else if ("notice".equals(e.getTagName())) { + String text = e.getTextContent(); + if (text != null && (!text.trim().isEmpty())) { + setNotice(text); + } + } else if ("sourceOnly".equals(e.getTagName())) { + setSourceOnly(true); + } + } + } + } +} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfo.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfo.java new file mode 100644 index 000000000000..79f09d792f5e --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfo.java @@ -0,0 +1,84 @@ +/* + * 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.netbeans.nbbuild.extlibs.licenseinfo; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class Licenseinfo { + + private File licenseinfoFile = null; + private final List filesets = new ArrayList<>(); + + public File getLicenseinfoFile() { + return licenseinfoFile; + } + + public void setLicenseinfoFile(File licenseinfoFile) { + this.licenseinfoFile = licenseinfoFile; + } + + public List getFilesets() { + return filesets; + } + + private static final DocumentBuilderFactory documentBuilderFactory; + static { + documentBuilderFactory = DocumentBuilderFactory.newInstance(); + } + + public static Licenseinfo parse(File licenseinfo) throws IOException { + try { + Document doc = documentBuilderFactory.newDocumentBuilder().parse(licenseinfo); + + if(! "licenseinfo".equals(doc.getDocumentElement().getTagName())) { + throw new IOException("Document Element is not licenseinfo"); + } + return parse(licenseinfo, doc.getDocumentElement()); + + } catch (SAXException | ParserConfigurationException | RuntimeException ex) { + throw new IOException(ex); + } + } + + private static Licenseinfo parse(File licenseinfo, Element licenseinfoElement) { + Licenseinfo li = new Licenseinfo(); + li.setLicenseinfoFile(licenseinfo); + NodeList childNodes = licenseinfoElement.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + if (childNodes.item(i) instanceof Element) { + Element e = (Element) childNodes.item(i); + if ("fileset".equals(e.getTagName())) { + Fileset fs = new Fileset(); + fs.parse(licenseinfo, e); + li.getFilesets().add(fs); + } + } + } + return li; + } +} diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfos.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfos.java new file mode 100644 index 000000000000..db1ad38c00b8 --- /dev/null +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/licenseinfo/Licenseinfos.java @@ -0,0 +1,41 @@ +/* + * 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.netbeans.nbbuild.extlibs.licenseinfo; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class Licenseinfos { + + private final List licenseInfos = new ArrayList<>(); + + public Licenseinfos() { + } + + public List getLicenseInfos() { + return licenseInfos; + } + + public void addLicenseinfoForDirectory(File licenseinfo) throws IOException { + licenseInfos.add(Licenseinfo.parse(licenseinfo)); + } + +} diff --git a/nbbuild/build.xml b/nbbuild/build.xml index 789a6f6b4ade..257cdcabe234 100644 --- a/nbbuild/build.xml +++ b/nbbuild/build.xml @@ -97,6 +97,7 @@ + @@ -539,6 +540,7 @@ Hg ID: ${hg.id} + ${netbeans.dest.dir} + @@ -1530,8 +1533,21 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - + + + + + + - - - - - - - - - - - + @@ -1623,6 +1635,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d + @@ -2062,20 +2075,30 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d + + + + - - - - + + + + + + + + + + @@ -2115,9 +2138,8 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - - + + @@ -2158,14 +2180,15 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - - + + + + diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt index 68a06aaa4390..9182b5c575dd 100644 --- a/nbbuild/rat-exclusions.txt +++ b/nbbuild/rat-exclusions.txt @@ -1,4 +1,5 @@ +###### BEGIN OF EXCLUSIONS (Do not remove this marker!) ###### build artifacts **/build/** nbbuild/licenses/** diff --git a/nbbuild/rat-licenseinfo-stub.txt b/nbbuild/rat-licenseinfo-stub.txt new file mode 100644 index 000000000000..5bb0540479ba --- /dev/null +++ b/nbbuild/rat-licenseinfo-stub.txt @@ -0,0 +1,11 @@ +Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements; and to You under the Apache License, Version 2.0. +=================================================================================================== + + +Apache Netbeans RAT Exclusions +------------------------------ + +The Apache NetBeans codebase contains files that are either not covered by the +Apache License 2.0 or can't include license headers for various reasons. + From 57bbf74f5651a2855b1e147b124ab5ebad6b05d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 27 Jan 2018 14:45:25 +0100 Subject: [PATCH 3/6] [NETBEANS-314] Add license info for files sourced from W3C --- html.editor/licenseinfo.xml | 66 +++++++++++++++++++ .../org/netbeans/modules/html/editor/todo.txt | 5 -- j2ee.persistence/licenseinfo.xml | 64 ++++++++++++++++++ maven.coverage/licenseinfo.xml | 27 ++++++++ nbbuild/build.xml | 22 ------- nbbuild/licenseinfo.xml | 35 ++++++++++ nbbuild/licenses/ISO-8879-SGML | 4 ++ nbbuild/licenses/W3C2 | 39 +++++++++++ nbbuild/licenses/names.properties | 1 + nbbuild/rat-exclusions.txt | 9 --- schema2beans/licenseinfo.xml | 27 ++++++++ xml.catalog/licenseinfo.xml | 32 +++++++++ xml.schema.completion/licenseinfo.xml | 27 ++++++++ 13 files changed, 322 insertions(+), 36 deletions(-) create mode 100644 html.editor/licenseinfo.xml delete mode 100644 html.editor/src/org/netbeans/modules/html/editor/todo.txt create mode 100644 j2ee.persistence/licenseinfo.xml create mode 100644 maven.coverage/licenseinfo.xml create mode 100644 nbbuild/licenseinfo.xml create mode 100644 nbbuild/licenses/ISO-8879-SGML create mode 100644 nbbuild/licenses/W3C2 create mode 100644 schema2beans/licenseinfo.xml create mode 100644 xml.catalog/licenseinfo.xml create mode 100644 xml.schema.completion/licenseinfo.xml diff --git a/html.editor/licenseinfo.xml b/html.editor/licenseinfo.xml new file mode 100644 index 000000000000..74a6f86ffe1c --- /dev/null +++ b/html.editor/licenseinfo.xml @@ -0,0 +1,66 @@ + + + + + src/org/netbeans/modules/html/editor/resources/DTDs/3_2/html32.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/frameset.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/loose.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/strict.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/frameset.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/loose.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/strict.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml1-frameset.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml1-strict.dtd + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml1-transitional.dtd + + DTDs and XMLSchemata are used at runtime to offer code completion for HTML/XHTML files. + + + src/org/netbeans/modules/html/editor/resources/DTDs/3_2/lat1.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/HTMLlat1.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/HTMLspecial.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/HTMLsymbol.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/HTMLlat1.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/HTMLspecial.ent + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/HTMLsymbol.ent + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml-lat1.ent + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml-special.ent + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/xhtml-symbol.ent + + DTDs and XMLSchemata are used at runtime to offer code completion for HTML/XHTML files. + + + src/org/netbeans/modules/html/editor/resources/DTDs/3_2/catalog + src/org/netbeans/modules/html/editor/resources/DTDs/4_0/catalog + src/org/netbeans/modules/html/editor/resources/DTDs/4_01/catalog + src/org/netbeans/modules/html/editor/resources/DTDs/xhtml/catalog + + + + + src/org/netbeans/modules/html/editor/options/ui/formatSample.html + src/org/netbeans/modules/html/editor/resources/HTMLExample + src/org/netbeans/modules/html/editor/resources/XHTMLExample + + + + diff --git a/html.editor/src/org/netbeans/modules/html/editor/todo.txt b/html.editor/src/org/netbeans/modules/html/editor/todo.txt deleted file mode 100644 index 0b846ade64be..000000000000 --- a/html.editor/src/org/netbeans/modules/html/editor/todo.txt +++ /dev/null @@ -1,5 +0,0 @@ -HTML EDITOR -============ - -P3 - add custom filter to the html CSL navigator - at least add "show attributes", possibly show text nodes, entity references - diff --git a/j2ee.persistence/licenseinfo.xml b/j2ee.persistence/licenseinfo.xml new file mode 100644 index 000000000000..01e4a9e0989d --- /dev/null +++ b/j2ee.persistence/licenseinfo.xml @@ -0,0 +1,64 @@ + + + + + src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_1_0.xsd + src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_1_0.xsd + + Used for XML Validation and code completion at runtime. + + + src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_2_0.xsd + src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_0.xsd + +Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved. + +Contributors: +Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009) +Specification available from http://jcp.org/en/jsr/detail?id=317 + + Used for XML Validation and code completion at runtime. + + + src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_2_1.xsd + src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_1.xsd + +Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved. + +Contributors: +Linda DeMichiel - Java Persistence 2.1, Version 2.1 (February 4, 2013) +Specification available from http://jcp.org/en/jsr/detail?id=338 + + Used for XML Validation and code completion at runtime. + + + src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-1.0.xml + src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-2.0.xml + src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-2.1.xml + src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/IllegalOrphanException.java.txt + src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/NonexistentEntityException.java.txt + src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/PreexistingEntityException.java.txt + src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/RollbackFailureException.java.txt + + + + diff --git a/maven.coverage/licenseinfo.xml b/maven.coverage/licenseinfo.xml new file mode 100644 index 000000000000..6ec0de24a63f --- /dev/null +++ b/maven.coverage/licenseinfo.xml @@ -0,0 +1,27 @@ + + + + + src/org/netbeans/modules/maven/coverage/coverage-04.dtd + + + diff --git a/nbbuild/build.xml b/nbbuild/build.xml index 257cdcabe234..8a86074f22e0 100644 --- a/nbbuild/build.xml +++ b/nbbuild/build.xml @@ -2100,9 +2100,6 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - - @@ -2111,12 +2108,6 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d All Rights Reserved License for WSDL Schema Files - - International Organization for Standardization 1986 - Permission to copy in any form is granted for use with - conforming SGML systems and applications as defined in - ISO 8879, provided this notice is included in all copies. - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. @@ -2131,10 +2122,8 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution - - @@ -2142,9 +2131,6 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - - @@ -2153,12 +2139,6 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d All Rights Reserved License for WSDL Schema Files - - International Organization for Standardization 1986 - Permission to copy in any form is granted for use with - conforming SGML systems and applications as defined in - ISO 8879, provided this notice is included in all copies. - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. @@ -2173,10 +2153,8 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution - - diff --git a/nbbuild/licenseinfo.xml b/nbbuild/licenseinfo.xml new file mode 100644 index 000000000000..0002793eae66 --- /dev/null +++ b/nbbuild/licenseinfo.xml @@ -0,0 +1,35 @@ + + + + + antsrc/org/netbeans/nbbuild/xhtml1-strict.dtd + + + + + antsrc/org/netbeans/nbbuild/xhtml-lat1.ent + antsrc/org/netbeans/nbbuild/xhtml-special.ent + antsrc/org/netbeans/nbbuild/xhtml-symbol.ent + + + + diff --git a/nbbuild/licenses/ISO-8879-SGML b/nbbuild/licenses/ISO-8879-SGML new file mode 100644 index 000000000000..37c7a32cff1e --- /dev/null +++ b/nbbuild/licenses/ISO-8879-SGML @@ -0,0 +1,4 @@ +Portions © International Organization for Standardization 1986: +Permission to copy in any form is granted for use with +conforming SGML systems and applications as defined in +ISO 8879, provided this notice is included in all copies. \ No newline at end of file diff --git a/nbbuild/licenses/W3C2 b/nbbuild/licenses/W3C2 new file mode 100644 index 000000000000..888bfc49fe60 --- /dev/null +++ b/nbbuild/licenses/W3C2 @@ -0,0 +1,39 @@ +W3C Software and Document Notice and License + +This work is being provided by the copyright holders under the following license. + +License + +By obtaining and/or copying this work, you (the licensee) agree that you have +read, understood, and will comply with the following terms and conditions. + +Permission to copy, modify, and distribute this work, with or without +modification, for any purpose and without fee or royalty is hereby granted, +provided that you include the following on ALL copies of the work or portions +thereof, including modifications: + +- The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. +- Any pre-existing intellectual property disclaimers, notices, or terms and + conditions. If none exist, the W3C Software and Document Short Notice should + be included. +- Notice of any changes or modifications, through a copyright statement on the + new code or document such as "This software or document includes material + copied from or derived from [title and URI of the W3C document]. + Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." + +Disclaimers + +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE +SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, +TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. + +The name and trademarks of copyright holders may NOT be used in advertising or +publicity pertaining to the work without specific, written prior permission. +Title to copyright in this work will at all times remain with copyright +holders. \ No newline at end of file diff --git a/nbbuild/licenses/names.properties b/nbbuild/licenses/names.properties index ccd1fe8a9c9e..fbe8e9f701da 100644 --- a/nbbuild/licenses/names.properties +++ b/nbbuild/licenses/names.properties @@ -47,3 +47,4 @@ MIT-icu4j=MIT license icu4j variant MIT-isorelax=MIT license isorelax variant MIT-validator=MIT license validator variant MPL-1.0=MPL 1.0 license +W3C2=W3C Software and Document Notice and License \ No newline at end of file diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt index 9182b5c575dd..86ae8eb0a4bf 100644 --- a/nbbuild/rat-exclusions.txt +++ b/nbbuild/rat-exclusions.txt @@ -20,8 +20,6 @@ nbbuild/rat-exclusions.txt **/Makefile-vc **/Makefile-vc-wo-crt **/package-list -html.editor/src/org/netbeans/modules/html/editor/todo.txt -html.editor/src/org/netbeans/modules/html/editor/resources/DTDs/*/catalog java.editor/src/org/netbeans/modules/java/editor/resources/JavaExample lib.uihandler/src/org/netbeans/lib/uihandler/pubKey maven.indexer/external/NOTICE-patched-indexer-core-6.0.0 @@ -175,11 +173,6 @@ css.editor/src/org/netbeans/modules/css/resources/CascadeStyleSheet.css.template css.editor/src/org/netbeans/modules/css/resources/CssExample db.sql.editor/src/org/netbeans/modules/db/sql/editor/resources/SQLExample editor.plain/src/org/netbeans/modules/editor/plain/resources/PlainTextExample -html.editor/src/org/netbeans/modules/html/editor/options/ui/formatSample.html -html.editor/src/org/netbeans/modules/html/editor/resources/HTMLExample -html.editor/src/org/netbeans/modules/html/editor/resources/XHTMLExample -j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/*.xml -j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/*.txt javafx2.project/src/org/netbeans/modules/javafx2/project/templates/** jshell.support/src/org/netbeans/modules/jshell/resources/consoleExample.jsh junit.ui/src/org/netbeans/modules/junit/ui/resources/*.template @@ -193,8 +186,6 @@ xml.text/src/org/netbeans/modules/xml/text/resources/DTDExample xml.text/src/org/netbeans/modules/xml/text/resources/XMLExample ###### miscellaneous -### -j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/*.xsd ### maven.htmlui/src/org/netbeans/modules/maven/htmlui/UIDefaults ### diff --git a/schema2beans/licenseinfo.xml b/schema2beans/licenseinfo.xml new file mode 100644 index 000000000000..b0c5ef31ebda --- /dev/null +++ b/schema2beans/licenseinfo.xml @@ -0,0 +1,27 @@ + + + + + src/org/netbeans/modules/schema2beansdev/xmlschema.xsd + + + diff --git a/xml.catalog/licenseinfo.xml b/xml.catalog/licenseinfo.xml new file mode 100644 index 000000000000..4e2dae55984a --- /dev/null +++ b/xml.catalog/licenseinfo.xml @@ -0,0 +1,32 @@ + + + + + src/org/netbeans/modules/xml/catalog/resources/Transform.xsd + src/org/netbeans/modules/xml/catalog/resources/XMLNamespace.xsd + src/org/netbeans/modules/xml/catalog/resources/XMLSchema-instance.xsd + src/org/netbeans/modules/xml/catalog/resources/XMLSchema.dtd + src/org/netbeans/modules/xml/catalog/resources/XMLSchema.xsd + src/org/netbeans/modules/xml/catalog/resources/datatypes.dtd + + + diff --git a/xml.schema.completion/licenseinfo.xml b/xml.schema.completion/licenseinfo.xml new file mode 100644 index 000000000000..e0d804c4cc07 --- /dev/null +++ b/xml.schema.completion/licenseinfo.xml @@ -0,0 +1,27 @@ + + + + + src/org/netbeans/modules/xml/schema/completion/util/XMLSchema.xsd + + + From 4327ec0fd8f28bb17d55a94ac9ce193f90a02344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 27 Jan 2018 15:18:31 +0100 Subject: [PATCH 4/6] [NETBEANS-309] Add license info for icons merged after donation At this point in time the vast majority of icons+images were donated by oracle to the ASF. The browser icons in the css.editor and web.browser.api modules were not part of that donation. As the original artwork is necessary for the GUI to have the icons be connected to the corresponding browsers, they were readded from the netbeans repository. This files are also distributed with the binary netbeans distribution and so are understood to be covered by the GPLv2 + CDDL license of netbeans. Redistribution in apache netbeans would elect the CDDL. --- css.editor/licenseinfo.xml | 44 ++++++++++++++++++++++++++++++ web.browser.api/licenseinfo.xml | 48 +++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 css.editor/licenseinfo.xml create mode 100644 web.browser.api/licenseinfo.xml diff --git a/css.editor/licenseinfo.xml b/css.editor/licenseinfo.xml new file mode 100644 index 000000000000..305b515e84da --- /dev/null +++ b/css.editor/licenseinfo.xml @@ -0,0 +1,44 @@ + + + + + src/org/netbeans/modules/css/resources/icons/chrome20-disabled.png + src/org/netbeans/modules/css/resources/icons/chrome20.png + src/org/netbeans/modules/css/resources/icons/firefox20-disabled.png + src/org/netbeans/modules/css/resources/icons/firefox20.png + src/org/netbeans/modules/css/resources/icons/ie20-disabled.png + src/org/netbeans/modules/css/resources/icons/ie20.png + src/org/netbeans/modules/css/resources/icons/opera20-disabled.png + src/org/netbeans/modules/css/resources/icons/opera20.png + src/org/netbeans/modules/css/resources/icons/safari20-disabled.png + src/org/netbeans/modules/css/resources/icons/safari20.png + + +Files were taken from oracle netbeans repository and were distributed +in the netbeans binary distribution under the combined GPLv2 + CDDL +license. + +The files are used in the GUI to represent the browsers and so need +to be close to the original artwork of their icons. + + + diff --git a/web.browser.api/licenseinfo.xml b/web.browser.api/licenseinfo.xml new file mode 100644 index 000000000000..6385103328db --- /dev/null +++ b/web.browser.api/licenseinfo.xml @@ -0,0 +1,48 @@ + + + + + src/org/netbeans/modules/web/browser/ui/resources/browser_chrome_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_chrome_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_chromium_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_chromium_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_edge_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_edge_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_firefox_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_firefox_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_ie_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_ie_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_opera_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_opera_24x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_safari_16x.png + src/org/netbeans/modules/web/browser/ui/resources/browser_safari_24x.png + + +Files were taken from oracle netbeans repository and were distributed +in the netbeans binary distribution under the combined GPLv2 + CDDL +license. + +The files are used in the GUI to represent the browsers and so need +to be close to the original artwork of their icons. + + + From 9d3fd69aa7082465dcb9c2e6f1c263848d03901c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Tue, 23 Jan 2018 23:53:07 +0100 Subject: [PATCH 5/6] [NETBEANS-315] Remove usage of rss-0_91.dtd and replace with XHTML1 DTDs The licensing situation for the RSS rss-0_91.dtd is unclear and the easiest way is replacing it by using the XHTML 1 DTDs as a replacement. The structural component of the RSS DTD is not used, just the entity definitions were relevant. These were copied from HTML 3.2 to the RSS DTD and so the XHTML 1 DTDs are a logical replacement for an XML parser. The licensing and attribution requirements of the W3C license need to be solved separatedly (tracked by NETBEANS-314) --- nbbuild/rat-exclusions.txt | 3 - welcome/licenseinfo.xml | 35 + .../welcome/content/CombinationRSSFeed.java | 4 +- .../welcome/content/RSSEntityResolver.java | 74 + .../modules/welcome/content/RSSFeed.java | 2 +- .../modules/welcome/resources/layer.xml | 19 - .../modules/welcome/resources/rss-0_91.dtd | 175 --- .../modules/welcome/resources/xhtml-lat1.ent | 196 +++ .../welcome/resources/xhtml-special.ent | 80 ++ .../welcome/resources/xhtml-symbol.ent | 237 ++++ .../welcome/resources/xhtml1-transitional.dtd | 1248 +++++++++++++++++ 11 files changed, 1873 insertions(+), 200 deletions(-) create mode 100644 welcome/licenseinfo.xml create mode 100644 welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java delete mode 100644 welcome/src/org/netbeans/modules/welcome/resources/rss-0_91.dtd create mode 100644 welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent create mode 100644 welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent create mode 100644 welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent create mode 100644 welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt index 86ae8eb0a4bf..efddca8d4328 100644 --- a/nbbuild/rat-exclusions.txt +++ b/nbbuild/rat-exclusions.txt @@ -200,8 +200,5 @@ spellchecker.dictionary_en/release/modules/dict/*.description spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 ### websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/*.xsd -### -welcome/src/org/netbeans/modules/welcome/resources/rss-0_91.dtd ### xml/src/org/netbeans/modules/xml/resources/templates/* - diff --git a/welcome/licenseinfo.xml b/welcome/licenseinfo.xml new file mode 100644 index 000000000000..354efb27c0ad --- /dev/null +++ b/welcome/licenseinfo.xml @@ -0,0 +1,35 @@ + + + + + src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd + + DTDs and XMLSchemata are used at runtime to enable html entity resolution in RSS feeds. + + + src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent + src/org/netbeans/modules/welcome/resources/xhtml-special.ent + src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent + + DTDs and XMLSchemata are used at runtime to enable html entity resolution in RSS feeds. + + diff --git a/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java b/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java index efdee3cac202..b0bdf54712d2 100644 --- a/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java +++ b/welcome/src/org/netbeans/modules/welcome/content/CombinationRSSFeed.java @@ -58,13 +58,13 @@ public CombinationRSSFeed( String url1, String url2, boolean showProxyButton, in this.url1 = url1; this.url2 = url2; } - + @Override protected List buildItemList() throws SAXException, ParserConfigurationException, IOException { XMLReader reader = XMLUtil.createXMLReader( false, true ); FeedHandler handler = new FeedHandler( getMaxItemCount() ); reader.setContentHandler( handler ); - reader.setEntityResolver( org.openide.xml.EntityCatalog.getDefault() ); + reader.setEntityResolver( new RSSEntityResolver() ); reader.setErrorHandler( new ErrorCatcher() ); reader.parse( findInputSource(new URL(url1)) ); diff --git a/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java b/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java new file mode 100644 index 000000000000..42cbdfa96e3f --- /dev/null +++ b/welcome/src/org/netbeans/modules/welcome/content/RSSEntityResolver.java @@ -0,0 +1,74 @@ +/* + * 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.netbeans.modules.welcome.content; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Entity resolver to make it possible to parse an RSS Feed (Version 0.91) with + * an XMLReader. The license of the specification and the grammar file is + * unclear. As the grammer is not used in the welcome module and the stream is + * manually parsed, only entities need to be resolved by the XML parser. + * The XML stream can contain Latin-1 entities, which are taken + * from the HTML 3.2 specification. Instead of the HTML 3.2 DTDs (SGML), the + * XHTML specification is used as a replacement here. + */ +public class RSSEntityResolver implements EntityResolver { + + private static final Logger LOG = Logger.getLogger(RSSEntityResolver.class.getName()); + private static final Map EMBEDDED_DTDS = new HashMap(); + + static { + String base = "/org/netbeans/modules/welcome/resources/"; + // This entry is intended to map the Netscape RSS publicId to the + // DTD for XHTML 1 + EMBEDDED_DTDS.put("-//Netscape Communications//DTD RSS 0.91//EN", + RSSEntityResolver.class.getResource(base + "xhtml1-transitional.dtd") + .toExternalForm()); + EMBEDDED_DTDS.put("-//W3C//ENTITIES Latin 1 for XHTML//EN", + RSSEntityResolver.class.getResource(base + "xhtml-lat1.ent") + .toExternalForm()); + EMBEDDED_DTDS.put("-//W3C//ENTITIES Symbols for XHTML//EN", + RSSEntityResolver.class.getResource(base + "xhtml-symbol.ent") + .toExternalForm()); + EMBEDDED_DTDS.put("-//W3C//ENTITIES Special for XHTML//EN", + RSSEntityResolver.class.getResource(base + "xhtml-special.ent") + .toExternalForm()); + } + + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + String url = EMBEDDED_DTDS.get(publicId); + LOG.log(Level.FINE, + "Resolving publicId({0}) to: {1}", //NOI18N + new Object[] {publicId, url}); + if (url != null) { + return new InputSource(url); + } else { + return null; + } + } +} diff --git a/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java b/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java index eabf16cf93e2..463f37f78b55 100644 --- a/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java +++ b/welcome/src/org/netbeans/modules/welcome/content/RSSFeed.java @@ -165,7 +165,7 @@ protected List buildItemList() throws SAXException, ParserConfiguratio XMLReader reader = XMLUtil.createXMLReader( false, true ); FeedHandler handler = new FeedHandler( getMaxItemCount() ); reader.setContentHandler( handler ); - reader.setEntityResolver( org.openide.xml.EntityCatalog.getDefault() ); + reader.setEntityResolver( new RSSEntityResolver() ); reader.setErrorHandler( new ErrorCatcher() ); InputSource is = findInputSource(new URL(url)); diff --git a/welcome/src/org/netbeans/modules/welcome/resources/layer.xml b/welcome/src/org/netbeans/modules/welcome/resources/layer.xml index fed33a5c2873..8e3cd3177eb1 100644 --- a/welcome/src/org/netbeans/modules/welcome/resources/layer.xml +++ b/welcome/src/org/netbeans/modules/welcome/resources/layer.xml @@ -88,25 +88,6 @@ - - - - - - - - - - - - - - - - diff --git a/welcome/src/org/netbeans/modules/welcome/resources/rss-0_91.dtd b/welcome/src/org/netbeans/modules/welcome/resources/rss-0_91.dtd deleted file mode 100644 index 91066ae8bea0..000000000000 --- a/welcome/src/org/netbeans/modules/welcome/resources/rss-0_91.dtd +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent new file mode 100644 index 000000000000..2a33e090df8a --- /dev/null +++ b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-lat1.ent @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent new file mode 100644 index 000000000000..321cc457e9cc --- /dev/null +++ b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-special.ent @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent new file mode 100644 index 000000000000..7e91b771d3ec --- /dev/null +++ b/welcome/src/org/netbeans/modules/welcome/resources/xhtml-symbol.ent @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd b/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd new file mode 100644 index 000000000000..773c45a1faf6 --- /dev/null +++ b/welcome/src/org/netbeans/modules/welcome/resources/xhtml1-transitional.dtd @@ -0,0 +1,1248 @@ + + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 49524f125884d0e5c2bec5ee249c1f4f6efae922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 27 Jan 2018 20:46:18 +0100 Subject: [PATCH 6/6] Remove files from rat exclusions and add explicit license information --- maven.coverage/licenseinfo.xml | 5 + nbbuild/build.xml | 48 +-- nbbuild/licenses/OASIS | 22 ++ nbbuild/licenses/WSDL-2004 | 25 ++ nbbuild/rat-exclusions.txt | 39 ++- nbbuild/tagref | 4 + o.apache.xml.resolver/licenseinfo.xml | 32 ++ o.n.bootstrap/readme/README-bin.txt | 4 + performance/licenseinfo.xml | 28 ++ spellchecker.dictionary_en/licenseinfo.xml | 30 ++ .../resources/lastsel/file.lastsel_mime1 | 2 + websvc.saas.api/licenseinfo.xml | 28 ++ .../websvc/saas/model/wadl20061109.xsd | 289 ------------------ .../modules/websvc/saas/util/testwadl.xml | 6 +- xml.jaxb/licenseinfo.xml | 33 ++ xml.wsdl.model/licenseinfo.xml | 30 ++ xml/licenseinfo.xml | 32 ++ xsl/licenseinfo.xml | 28 ++ 18 files changed, 325 insertions(+), 360 deletions(-) create mode 100644 nbbuild/licenses/OASIS create mode 100644 nbbuild/licenses/WSDL-2004 create mode 100644 o.apache.xml.resolver/licenseinfo.xml create mode 100644 performance/licenseinfo.xml create mode 100644 spellchecker.dictionary_en/licenseinfo.xml create mode 100644 websvc.saas.api/licenseinfo.xml delete mode 100644 websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/wadl20061109.xsd create mode 100644 xml.jaxb/licenseinfo.xml create mode 100644 xml.wsdl.model/licenseinfo.xml create mode 100644 xml/licenseinfo.xml create mode 100644 xsl/licenseinfo.xml diff --git a/maven.coverage/licenseinfo.xml b/maven.coverage/licenseinfo.xml index 6ec0de24a63f..c29f4aefa482 100644 --- a/maven.coverage/licenseinfo.xml +++ b/maven.coverage/licenseinfo.xml @@ -24,4 +24,9 @@ src/org/netbeans/modules/maven/coverage/coverage-04.dtd + + src/org/netbeans/modules/maven/coverage/jacoco-1.0.dtd + + Used by XML parser at runtime. + diff --git a/nbbuild/build.xml b/nbbuild/build.xml index 8a86074f22e0..4995f0f8bf25 100644 --- a/nbbuild/build.xml +++ b/nbbuild/build.xml @@ -2100,65 +2100,21 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d - - - - - International Business Machines Corporation and Microsoft Corporation - All Rights Reserved - License for WSDL Schema Files - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 - which accompanies this distribution. - - - This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution - - - - - - + - - - - - International Business Machines Corporation and Microsoft Corporation - All Rights Reserved - License for WSDL Schema Files - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 - which accompanies this distribution. - - - This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution - - - - - - + diff --git a/nbbuild/licenses/OASIS b/nbbuild/licenses/OASIS new file mode 100644 index 000000000000..8ee5116ac5d2 --- /dev/null +++ b/nbbuild/licenses/OASIS @@ -0,0 +1,22 @@ +Copyright � 2000, 2001 The Organization for the Advancement of Structured +Information Standards [OASIS]. All Rights Reserved. + +This document and translations of it may be copied and furnished to others, and +derivative works that comment on or otherwise explain it or assist in its +implementation may be prepared, copied, published and distributed, in whole or +in part, without restriction of any kind, provided that the above copyright +notice and this paragraph are included on all such copies and derivative works. +However, this document itself may not be modified in any way, such as by +removing the copyright notice or references to OASIS, except as needed for the +purpose of developing OASIS specifications, in which case the procedures for +copyrights defined in the OASIS Intellectual Property Rights document must be +followed, or as required to translate it into languages other than English. + +The limited permissions granted above are perpetual and will not be revoked by +OASIS or its successors or assigns. + +This document and the information contained herein is provided on an "AS IS" +basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE +ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A +PARTICULAR PURPOSE. \ No newline at end of file diff --git a/nbbuild/licenses/WSDL-2004 b/nbbuild/licenses/WSDL-2004 new file mode 100644 index 000000000000..b96497a7da0a --- /dev/null +++ b/nbbuild/licenses/WSDL-2004 @@ -0,0 +1,25 @@ +Copyright 2001 - 2005, International Business Machines Corporation and Microsoft Corporation +All Rights Reserved + +License for WSDL Schema Files + +The Authors grant permission to copy and distribute the WSDL Schema +Files in any medium without fee or royalty as long as this notice and +license are distributed with them. The originals of these files can +be located at: + +http://schemas.xmlsoap.org/wsdl/2004-08-24.xsd + +THESE SCHEMA FILES ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS +OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THESE FILES, INCLUDING, BUT NOT +LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, +INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR +RELATING TO ANY USE OR DISTRIBUTION OF THESE FILES. + +The name and trademarks of the Authors may NOT be used in any manner, +including advertising or publicity pertaining to these files or any program +or service that uses these files, written prior permission. Title to copyright +in these files will at all times remain with the Authors. + +No other rights are granted by implication, estoppel or otherwise. diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt index efddca8d4328..382306711c14 100644 --- a/nbbuild/rat-exclusions.txt +++ b/nbbuild/rat-exclusions.txt @@ -1,3 +1,19 @@ +###### 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. ###### BEGIN OF EXCLUSIONS (Do not remove this marker!) ###### build artifacts @@ -6,7 +22,6 @@ nbbuild/licenses/** nbbuild/netbeans/** nbbuild/testuserdir/** nbbuild/user.build.properties -nbbuild/rat-exclusions.txt ###### user-specific files **/nbproject/private/** @@ -25,7 +40,6 @@ lib.uihandler/src/org/netbeans/lib/uihandler/pubKey maven.indexer/external/NOTICE-patched-indexer-core-6.0.0 nbbuild/hudson/.hgmail-profiler nbbuild/l10n.patterns -nbbuild/tagref o.n.core/test/unit/src/org/netbeans/core/modules/jars/localized-manifest/locmani/something.txt openide.util.lookup/test/unit/src/org/openide/util/lookup/MetaInfServicesLookupTestRunnable.txt openide.util.lookup/test/unit/src/org/openide/util/lookup/problem100320.txt @@ -39,8 +53,6 @@ templates/src/org/netbeans/modules/templates/resources/userprop.txt ### limited degreed of creativity ## the files do not reach a level of creativity maven.checkstyle/src/org/netbeans/modules/maven/format/checkstyle/config/configuration*.dtd -## Template for user - very limited degree of creativity -xsl/src/org/netbeans/modules/xsl/resources/templates/stylesheet.xsl ###### test data: https://www.apache.org/legal/src-headers.html#faq-exceptions api.search/test/unit/src/org/netbeans/modules/search/data/** @@ -184,21 +196,4 @@ o.apache.tools.ant.module/src/org/apache/tools/ant/module/resources/Project.xml_ spring.beans/src/org/netbeans/modules/spring/beans/resources/templates/*.template xml.text/src/org/netbeans/modules/xml/text/resources/DTDExample xml.text/src/org/netbeans/modules/xml/text/resources/XMLExample - -###### miscellaneous -### -maven.htmlui/src/org/netbeans/modules/maven/htmlui/UIDefaults -### -o.n.bootstrap/readme/*.txt -### -performance/threaddemo/src/threaddemo/util/doc-files/TwoWaySupport.zargo -### -properties.syntax/src/org/netbeans/modules/properties/syntax/PropertiesExample -### -spellchecker.dictionary_en/release/modules/dict/*.description -### -spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 -### -websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/*.xsd -### -xml/src/org/netbeans/modules/xml/resources/templates/* +properties.syntax/src/org/netbeans/modules/properties/syntax/PropertiesExample \ No newline at end of file diff --git a/nbbuild/tagref b/nbbuild/tagref index a496cb142158..2e076c48f20a 100644 --- a/nbbuild/tagref +++ b/nbbuild/tagref @@ -1,3 +1,7 @@ +Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements; and to You under the Apache License, Version 2.0. + + This file is used for tagging. This file is not used by the build, but for tagging purposes only. Please do not delete me. diff --git a/o.apache.xml.resolver/licenseinfo.xml b/o.apache.xml.resolver/licenseinfo.xml new file mode 100644 index 000000000000..784a72977958 --- /dev/null +++ b/o.apache.xml.resolver/licenseinfo.xml @@ -0,0 +1,32 @@ + + + + + src/org/apache/xml/resolver/etc/catalog.dtd + src/org/apache/xml/resolver/etc/catalog.rng + src/org/apache/xml/resolver/etc/catalog.xsd + + + Used at runtime for the XML parser used to parse XML catalog files. + + + diff --git a/o.n.bootstrap/readme/README-bin.txt b/o.n.bootstrap/readme/README-bin.txt index 7a9676a7271d..922dbb992482 100644 --- a/o.n.bootstrap/readme/README-bin.txt +++ b/o.n.bootstrap/readme/README-bin.txt @@ -1,3 +1,7 @@ +Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements; and to You under the Apache License, Version 2.0. + + This is a NetBeans Plaform binary build. JavaHelp note: JavaHelp is not distributed in this build. diff --git a/performance/licenseinfo.xml b/performance/licenseinfo.xml new file mode 100644 index 000000000000..402cfe169941 --- /dev/null +++ b/performance/licenseinfo.xml @@ -0,0 +1,28 @@ + + + + + threaddemo/src/threaddemo/util/doc-files/TwoWaySupport.zargo + + + + diff --git a/spellchecker.dictionary_en/licenseinfo.xml b/spellchecker.dictionary_en/licenseinfo.xml new file mode 100644 index 000000000000..c68515a23665 --- /dev/null +++ b/spellchecker.dictionary_en/licenseinfo.xml @@ -0,0 +1,30 @@ + + + + + release/modules/dict/dictionary_en.description + release/modules/dict/dictionary_en_GB.description + release/modules/dict/dictionary_en_US.description + + + + diff --git a/spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 b/spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 index e69de29bb2d1..b5cf289e0725 100644 --- a/spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 +++ b/spi.navigator/test/unit/src/org/netbeans/modules/navigator/resources/lastsel/file.lastsel_mime1 @@ -0,0 +1,2 @@ +Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements; and to You under the Apache License, Version 2.0. \ No newline at end of file diff --git a/websvc.saas.api/licenseinfo.xml b/websvc.saas.api/licenseinfo.xml new file mode 100644 index 000000000000..304964b32bbe --- /dev/null +++ b/websvc.saas.api/licenseinfo.xml @@ -0,0 +1,28 @@ + + + + + src/org/netbeans/modules/websvc/saas/model/wadl200902.xsd + + The file is needed to generate the model classes. There is no binary for this file, so it is included as is. + + diff --git a/websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/wadl20061109.xsd b/websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/wadl20061109.xsd deleted file mode 100644 index 810dbba72b1b..000000000000 --- a/websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/wadl20061109.xsd +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/websvc.saas.api/test/unit/src/org/netbeans/modules/websvc/saas/util/testwadl.xml b/websvc.saas.api/test/unit/src/org/netbeans/modules/websvc/saas/util/testwadl.xml index 144b82c16749..436f796eaa60 100644 --- a/websvc.saas.api/test/unit/src/org/netbeans/modules/websvc/saas/util/testwadl.xml +++ b/websvc.saas.api/test/unit/src/org/netbeans/modules/websvc/saas/util/testwadl.xml @@ -23,9 +23,9 @@ + xsi:schemaLocation="http://wadl.dev.java.net/2009/02 + ../../../../../../../../../../websvc.saas.api/src/org/netbeans/modules/websvc/saas/model/wadl200902.xsd" + xmlns="http://wadl.dev.java.net/2009/02"> diff --git a/xml.jaxb/licenseinfo.xml b/xml.jaxb/licenseinfo.xml new file mode 100644 index 000000000000..b968faf74b97 --- /dev/null +++ b/xml.jaxb/licenseinfo.xml @@ -0,0 +1,33 @@ + + + + + src/org/netbeans/modules/xml/jaxb/resources/eclipselink_oxm_2_3.xsd + +Copyright (c) 1998, 2010 Oracle. All rights reserved. + + Contributors: + dmccann - December 22/2010 - 2.3 - Initial implementation + + Used for XML Validation and code completion at runtime. + + diff --git a/xml.wsdl.model/licenseinfo.xml b/xml.wsdl.model/licenseinfo.xml new file mode 100644 index 000000000000..19ef7df8701f --- /dev/null +++ b/xml.wsdl.model/licenseinfo.xml @@ -0,0 +1,30 @@ + + + + + src/org/netbeans/modules/xml/wsdl/validator/resources/wsdl-2004-08-24.xsd + + + Used at runtime for the XML validation. + + + diff --git a/xml/licenseinfo.xml b/xml/licenseinfo.xml new file mode 100644 index 000000000000..ff70fa8598dc --- /dev/null +++ b/xml/licenseinfo.xml @@ -0,0 +1,32 @@ + + + + + src/org/netbeans/modules/xml/resources/templates/emptyDTD.dtd.template + src/org/netbeans/modules/xml/resources/templates/emptyXML.xml.template + src/org/netbeans/modules/xml/resources/templates/emptyXmlSchema.xsd.template + src/org/netbeans/modules/xml/resources/templates/xhtml.xml.template + src/org/netbeans/modules/xml/resources/templates/xml_entity.ent.template + + + + diff --git a/xsl/licenseinfo.xml b/xsl/licenseinfo.xml new file mode 100644 index 000000000000..437b725946ef --- /dev/null +++ b/xsl/licenseinfo.xml @@ -0,0 +1,28 @@ + + + + + src/org/netbeans/modules/xsl/resources/templates/stylesheet.xsl + + + +