nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NUTCH-2621) Generate report of third-party licenses
Date Fri, 17 Aug 2018 10:00:02 GMT

    [ https://issues.apache.org/jira/browse/NUTCH-2621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583719#comment-16583719
] 

ASF GitHub Bot commented on NUTCH-2621:
---------------------------------------

sebastian-nagel closed pull request #365: NUTCH-2621 Generate report of third-party licenses
URL: https://github.com/apache/nutch/pull/365
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/build.xml b/build.xml
index 03e43fc63..244f6e60a 100644
--- a/build.xml
+++ b/build.xml
@@ -562,7 +562,13 @@
 
   <!-- target: report  ================================================== -->
   <target name="report" depends="resolve-test" description="--> generates a report
of dependencies">
-    <ivy:report todir="${build.dir}"/>
+    <ivy:report todir="${build.dir}" xml="true"/>
+  </target>
+
+  <!-- target: 3rd-party licenses report  =============================== -->
+  <target name="report-licenses" depends="resolve-default" description="--> generates
a report of licenses of dependencies">
+    <ivy:report todir="${build.dir}" xml="false" graph="false" xslfile="ivy/ivy-report-license.xsl"
+                outputpattern="[organisation]-[module]-[conf]-3rd-party-licenses.tsv"/>
   </target>
 
   <!-- target: ivy-init  ================================================ -->
diff --git a/ivy/ivy-report-license.xsl b/ivy/ivy-report-license.xsl
new file mode 100644
index 000000000..156c895b3
--- /dev/null
+++ b/ivy/ivy-report-license.xsl
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+-->
+<!-- XSLT to extract third-party licenses in a tabular view, see ant target `ant report-license`
-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:output method="text"/>
+<xsl:template match="/ivy-report">
+  <xsl:text>Name&#x09;Organization&#x09;Revision&#x09;PubDate&#x09;Licenses...&#x0a;</xsl:text>
+  <xsl:for-each select="dependencies/module">
+    <xsl:value-of select="@name"/>
+    <xsl:text>&#x09;</xsl:text>
+    <xsl:value-of select="@organisation"/>
+    <xsl:for-each select="revision[not(@evicted)]/license">
+      <xsl:text>&#x09;</xsl:text>
+      <xsl:value-of select="../@name"/>
+      <xsl:text>&#x09;</xsl:text>
+      <xsl:value-of select="../@pubdate"/>
+      <xsl:text>&#x09;</xsl:text>
+      <xsl:value-of select="@name"/>
+      <xsl:text>&#x09;</xsl:text>
+      <xsl:value-of select="@url"/>
+    </xsl:for-each>
+    <xsl:text>&#x0a;</xsl:text>
+  </xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/src/plugin/build-plugin.xml b/src/plugin/build-plugin.xml
index 616f4c901..8809f06e0 100755
--- a/src/plugin/build-plugin.xml
+++ b/src/plugin/build-plugin.xml
@@ -236,7 +236,13 @@
   </target>
 
   <target name="report" depends="resolve-test" description="--> generates a report
of dependencies">
-    <ivy:report todir="${build.dir}"/>
+    <ivy:report todir="${build.dir}" xml="true"/>
+  </target>
+
+  <!-- target: 3rd-party licenses report  =============================== -->
+  <target name="report-licenses" depends="resolve-default" description="--> generates
a report of licenses of dependencies">
+    <ivy:report todir="${build.dir}" xml="false" graph="false" xslfile="${nutch.root}/ivy/ivy-report-license.xsl"
+                outputpattern="[organisation]-[module]-[conf]-3rd-party-licenses.tsv"/>
   </target>
 
   <!-- ================================================================== -->


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Generate report of third-party licenses
> ---------------------------------------
>
>                 Key: NUTCH-2621
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2621
>             Project: Nutch
>          Issue Type: Sub-task
>          Components: build
>    Affects Versions: 1.15
>            Reporter: Sebastian Nagel
>            Priority: Trivial
>             Fix For: 1.16
>
>
> Would be good to have the possibility to generate a list of third-party licenses of all
dependent libraries shipped with the binary 1.x package. There is the {{ant report}} target
which includes also licenses but a list or tabular view would be much easier to process than
a graph or HTML report. Cf. the [Maven license plugin|https://www.mojohaus.org/license-maven-plugin/index.html].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message