Files
maven-plugins/license/plugin.jelly
T

85 lines
2.9 KiB
XML

<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:define="jelly:define"
xmlns:doc="doc"
xmlns:license="license"
xmlns:util="jelly:util">
<define:taglib uri="license">
<define:jellybean name="license"
className="org.apache.maven.license.LicenseTask"
method="doExecute" />
</define:taglib>
<!-- ================================================================== -->
<!-- L I C E N S E -->
<!-- ================================================================== -->
<goal name="maven-license-plugin:register">
<doc:registerReport
name="Project License"
link="license"
description="Displays the primary license for the project."/>
</goal>
<goal name="maven-license-plugin:report"
description="Generate an XML file from the license.txt">
<attainGoal name="license"/>
</goal>
<goal name="license"
description="Generate an XML file from the license file"
prereqs="license:transfer"/>
<goal
name="license:transfer"
prereqs="xdoc:init"
description="Generate a xml file from your license file">
<j:set var="licenseX" value='${maven.license.licenseFile}X'/>
<j:set var="genDocs"
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
<j:choose>
<j:when test="${licenseX != 'X'}">
<j:set var="licenseFile" value='${maven.license.licenseFile}'/>
</j:when>
<j:otherwise>
<j:set var="licenseFile" value='${basedir}/LICENSE.txt'/>
</j:otherwise>
</j:choose>
<util:available file="${licenseFile}">
<j:set var="licensePresent" value="true"/>
</util:available>
<j:if test="${licensePresent != 'true'}">
<echo>
======================================================================
= W A R N I N G =
======================================================================
= Your project doesn't contain a header file specified as: =
= ${licenseFile}
= The License Report Plugin needs it to display the license =
= for the project. =
= If it can't find this file, it creates a page mentioning that =
= no license file has been given to Maven. =
======================================================================
</echo>
<j:set var="licenseFile" value='${plugin.resources}/LICENSE.txt'/>
</j:if>
<license:license
description="Project License"
input="${licenseFile}"
output="${genDocs}/license.xml"
outputEncoding="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.outputencoding')}"
title="License"
/>
</goal>
</project>