| <!DOCTYPE html> |
| <!-- |
| | Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/apt/report.apt at 2024-05-07 |
| |
| | Rendered using Apache Maven Default Skin |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" /> |
| <title>Apache Rat™ Task Library for Apache Ant – The Report Task</title> |
| <link rel="stylesheet" href="./css/maven-base.css" /> |
| <link rel="stylesheet" href="./css/maven-theme.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| <link href="https://creadur.apache.org/font/matesc.css" type="text/css" rel="stylesheet" /> |
| </head> |
| <body class="composite"> |
| <div id="banner"> |
| <a href="https://www.apache.org/" id="bannerLeft"><img src="https://www.apache.org/img/asf_logo.png" alt="The Apache Software Foundation" title="The Apache Software Foundation"/></a> <div class="clear"> |
| <hr/> |
| </div> |
| </div> |
| <div id="breadcrumbs"> |
| <div class="xleft"> |
| <span id="publishDate">Last Published: 2024-05-07</span> |
| | <span id="projectVersion">Version: 0.17-SNAPSHOT</span> |
| | <a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a> > |
| <a href="https://creadur.apache.org/" class="externalLink" title="Creadur">Creadur</a> > |
| <a href="https://creadur.apache.org/rat/" class="externalLink" title="Rat">Rat</a> > |
| <a href="index.html" title="Apache Rat™ Task Library for Apache Ant">Apache Rat™ Task Library for Apache Ant</a> > |
| The Report Task |
| </div> |
| <div class="xright"> </div> |
| <div class="clear"> |
| <hr/> |
| </div> |
| </div> |
| <div id="leftColumn"> |
| <div id="navcolumn"> |
| <h5>Parent Project</h5> |
| <ul> |
| <li class="none"><a href="../index.html" title="Apache Creadur Rat">Apache Creadur Rat</a></li> |
| </ul> |
| <h5>Overview</h5> |
| <ul> |
| <li class="none"><a href="index.html" title="Introduction">Introduction</a></li> |
| <li class="none"><strong>Report Task</strong></li> |
| <li class="none"><a href="types.html" title="Types">Types</a></li> |
| </ul> |
| <h5>Examples</h5> |
| <ul> |
| <li class="none"><a href="examples/basic.html" title="Basic Usage">Basic Usage</a></li> |
| <li class="none"><a href="examples/custom.html" title="Custom Types">Custom Types</a></li> |
| </ul> |
| <h5>Project Documentation</h5> |
| <ul> |
| <li class="collapsed"><a href="project-info.html" title="Project Information">Project Information</a></li> |
| <li class="collapsed"><a href="project-reports.html" title="Project Reports">Project Reports</a></li> |
| </ul> |
| <h5>Apache Rat™</h5> |
| <ul> |
| <li class="none"><a href="../index.html" title="Introducing Rat">Introducing Rat</a></li> |
| <li class="none"><a href="../apidocs/index.html" title="Javadocs">Javadocs</a></li> |
| <li class="none"><a href="../download_rat.cgi" title="Downloads">Downloads</a></li> |
| <li class="none"><a href="../RELEASE_NOTES.txt" title="Changes">Changes</a></li> |
| </ul> |
| <h5>Running Rat</h5> |
| <ul> |
| <li class="none"><a href="../apache-rat/index.html" title="From The Command Line">From The Command Line</a></li> |
| <li class="none"><a href="../apache-rat-tasks/index.html" title="With Ant">With Ant</a></li> |
| <li class="none"><a href="../apache-rat-plugin/index.html" title="With Maven">With Maven</a></li> |
| </ul> |
| <h5>Apache Creadur™</h5> |
| <ul> |
| <li class="none"><a href="https://creadur.apache.org" class="externalLink" title="Creadur Project Home">Creadur Project Home</a></li> |
| <li class="none"><a href="https://creadur.apache.org/tentacles" class="externalLink" title="Apache Tentacles">Apache Tentacles</a></li> |
| <li class="none"><a href="https://creadur.apache.org/whisker" class="externalLink" title="Apache Whisker">Apache Whisker</a></li> |
| <li class="none"><a href="https://www.apache.org/security/" class="externalLink" title="Security">Security</a></li> |
| <li class="none"><a href="https://www.apache.org/licenses/" class="externalLink" title="License">License</a></li> |
| <li class="none"><a href="https://privacy.apache.org/policies/privacy-policy-public.html" class="externalLink" title="Privacy">Privacy</a></li> |
| <li class="none"><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">Sponsorship</a></li> |
| <li class="none"><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">Thanks</a></li> |
| </ul> |
| <h5>The Apache Software Foundation</h5> |
| <ul> |
| <li class="none"><a href="https://www.apache.org/foundation" class="externalLink" title="About the Foundation">About the Foundation</a></li> |
| <li class="none"><a href="https://projects.apache.org" class="externalLink" title="The projects">The projects</a></li> |
| <li class="none"><a href="https://people.apache.org" class="externalLink" title="The people">The people</a></li> |
| <li class="none"><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How we work">How we work</a></li> |
| <li class="none"><a href="https://www.apache.org/foundation/how-it-works.html#history" class="externalLink" title="Our history">Our history</a></li> |
| <li class="none"><a href="https://blogs.apache.org/foundation/" class="externalLink" title="News">News</a></li> |
| </ul> |
| <h5>Contribute</h5> |
| <ul> |
| <li class="none"><a href="https://www.apache.org/foundation/getinvolved.html" class="externalLink" title="Get Involved">Get Involved</a></li> |
| </ul> |
| <h5>Committer Info</h5> |
| <ul> |
| <li class="none"><a href="https://www.apache.org/dev/committers.html" class="externalLink" title="ASF Committers' FAQ">ASF Committers' FAQ</a></li> |
| <li class="none"><a href="https://www.apache.org/dev/new-committers-guide.html" class="externalLink" title="New Committers Guide">New Committers Guide</a></li> |
| <li class="none"><a href="../site-publish.html" title="Howto publish this site">Howto publish this site</a></li> |
| <li class="none"><a href="https://community.apache.org/" class="externalLink" title="Community">Community</a></li> |
| <li class="none"><a href="https://www.apache.org/legal/" class="externalLink" title="Legal">Legal</a></li> |
| <li class="none"><a href="https://www.apache.org/foundation/marks/" class="externalLink" title="Branding">Branding</a></li> |
| <li class="none"><a href="https://www.apache.org/press/" class="externalLink" title="Media Relations">Media Relations</a></li> |
| </ul> |
| <a href="https://maven.apache.org/" title="Maven" class="poweredBy"> |
| <img class="poweredBy" alt="Maven" src="https://maven.apache.org/images/logos/maven-feather.png" /> |
| </a> |
| </div> |
| </div> |
| <div id="bodyColumn"> |
| <div id="contentBox"> |
| <section> |
| <h2><a name="Report_Task"></a>Report Task</h2> |
| <p>The Report task is the heart of the Apache Rat Ant Task Library, it runs Rat on a given set of resources and generates the report.</p> |
| <p>The task can work on any Ant <a class="externalLink" href="https://ant.apache.org/manual/Types/resources.html">resource or resource collection</a> and the usual Ant selectors can be applied to restrict things even further.</p> |
| <p>Reports can use Rat's internal XML or plain text format or be styled by a custom XSLT stylesheet.</p> |
| <p>It is possible to define custom matchers for licenses not directly supported by Rat via nested elements to the Report task.</p></section><section> |
| <h2><a name="Attributes_of_the_Task"></a>Attributes of the Task</h2> |
| <table border="1" class="bodyTable"> |
| <tr class="a"> |
| <td align="center">Name</td> |
| <td align="left">Description</td></tr> |
| <tr class="b"> |
| <td align="center">reportFile</td> |
| <td align="left">Name of the file to write the report to. If ommitted the report will be sent to Ant's logging system instead.</td></tr> |
| <tr class="a"> |
| <td align="center">format</td> |
| <td align="left">The format to use for the report. Choices are <code>xml</code> for Rat's XML format, <code>plain</code> for plain text using Rat's built-in stylesheet, <code>styled</code> transforms the XML output using the given stylesheet. The stylesheet nested element must be set as well if this attribute is used. Defaults to <code>plain</code></td></tr> |
| <tr class="b"> |
| <td align="center">addDefaultLicenseMatchers</td> |
| <td align="left">Whether to use Rat's built-in set of license matchers in addition to those specified as nested elements. Boolean, defaults to <code>true</code>.</td></tr> |
| <tr class="a"> |
| <td align="center">addLicenseHeaders</td> |
| <td align="left">Whether to add license headers to files that don't have one. Choices are <code>true</code>, <code>false</code> and <code>forced</code> where <code>forced</code> would add a license even if Rat already found one. Boolean, defaults to <code>false</code>.</td></tr> |
| <tr class="b"> |
| <td align="center">copyrightMessage</td> |
| <td align="left">If Rat is adding license headers: Sets the optional copyright message. This value is ignored, if no license headers are added.</td></tr></table></section><section> |
| <h2><a name="Nested_Elements"></a>Nested Elements</h2><section> |
| <h3><a name="Resources"></a>Resources</h3> |
| <p>The files to be checked by Rat are specified as nested <a class="externalLink" href="https://ant.apache.org/manual/Types/resources.html"> resource (collection)(s)</a>, the most basic one would probably be a <a class="externalLink" href="https://ant.apache.org/manual/Types/fileset.html"> fileset</a>.</p> |
| <p>For example the following would check all Java files in the <code>src</code> directory.</p> |
| <div> |
| <pre><rat:report> |
| <fileset dir="src" includes="**/*.java"/> |
| </rat:report></pre></div></section><section> |
| <h3><a name="Stylesheet"></a>Stylesheet</h3> |
| <p>If the <code>format</code> attribute has been set to <code>styled</code> the XSLT stylesheet to apply is specified as a nested resource element. For example</p> |
| <div> |
| <pre><rat:report format="styled" reportFile="rat-report.html"> |
| ... |
| <stylesheet> |
| <file file="my/rat-xml-2-html.xslt"/> |
| </stylesheet> |
| </rat:report></pre></div></section><section> |
| <h3><a name="License_Matchers"></a>License Matchers</h3> |
| <p>Any defined Ant type that implements the <code>IHeaderMatcher</code> interface can be used as nested element to provide a matcher to Rat. License matchers are the pieces that make Rat identify the license of a document.</p> |
| <p>The Ant library already contains <a href="./types.html#License_Matchers">types for the built-in license matchers</a> but you can define your own classes for <a href="./examples/custom.html">custom matchers</a>.</p> |
| <p>There are two scenarios where you'd use a nested element to define license matchers to Rat. The more common one would be if you wanted Rat to detect and identify a license that isn't supported out of the box - in this case you will want to write a custom matcher.</p> |
| <p>The second case would be if you want to only detect a subset of licenses known to Rat for some reason. For example if the only license you want to detect was the Apache License 2.0 you'd first disable the built-in matchers by setting <code>addDefaultLicenseMatchers</code> to false and then explicitly add the built-in <code>asl20</code> matcher</p> |
| <div> |
| <pre><rat:report addDefaultLicenseMatchers="false"> |
| <rat:asl20/> |
| </rat:report></pre></div></section><section> |
| <h3><a name="Approved_License_Families"></a>Approved License Families</h3> |
| <p>Any defined Ant type that implements the <code>ILicenseFamily</code> interface can be used as nested element to provide a license family as an approved license to Rat.</p> |
| <p>The Ant library already contains <a href="./types.html#License_Matchers">types for the built-in license families</a> but you can define your own classes for <a href="./examples/custom.html">custom families</a>. In most cases <a href="./types.html#approvedLicense"><code>approvedLicense</code></a> should be sufficient, though.</p></section></section> |
| </div> |
| </div> |
| <div class="clear"> |
| <hr/> |
| </div> |
| <div id="footer"> |
| <div class="xright"> |
| Copyright © 2016-2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. |
| Apache Creadur, Creadur, Apache Rat, Apache Tentacles, Apache Whisker, Apache and the Apache feather logo are trademarks |
| of The Apache Software Foundation. |
| Oracle and Java are registered trademarks of Oracle and/or its affiliates. |
| All other marks mentioned may be trademarks or registered trademarks of their respective owners. |
| </div> |
| <div class="clear"> |
| <hr/> |
| </div> |
| </div> |
| </body> |
| </html> |