maven-plugins/jira/plugin.jelly

157 lines
5.1 KiB
XML

<?xml version="1.0"?>
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed 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.
*/
-->
<project
xmlns:j="jelly:core"
xmlns:define="jelly:define"
xmlns:jira="jira"
xmlns:maven="jelly:maven"
xmlns:doc="doc"
xmlns:ant="jelly:ant">
<goal name="maven-jira-plugin:register">
<doc:registerReport
name="Jira Report"
pluginName="maven-jira-plugin"
link="jira"
description="Report all issues defined in Jira."/>
<j:if test="${maven.jira.roadmap}">
<doc:registerReport
name="Jira Roadmap Report"
pluginName=""
link="jira-roadmap"
description="Report all issues that are scheduled for the next release."
/>
</j:if>
</goal>
<goal name="maven-jira-plugin:deregister">
<doc:deregisterReport name="Jira Report"/>
<doc:deregisterReport name="Jira Roadmap Report"/>
</goal>
<define:taglib uri="jira">
<define:jellybean
name="jira"
className="org.apache.maven.jira.JiraDownloader"
method="doExecute"
/>
</define:taglib>
<goal
name="maven-jira-plugin:report"
description="Generate report with all entries defined in Jira">
<mkdir dir="${maven.build.dir}/jira"/>
<copy tofile="${maven.build.dir}/jira/jira-roadmap.xml" file="${plugin.resources}/templates/jira-template.xml"/>
<copy tofile="${maven.build.dir}/jira/jira-results.xml" file="${plugin.resources}/templates/jira-template.xml"/>
<jira:jira
project="${pom}"
output="${maven.build.dir}/jira/jira-results.xml"
nbEntries="${maven.jira.nbentries}"
status="${maven.jira.status}"
filter="${maven.jira.filter}"
resolution="${maven.jira.resolution}"
priority="${maven.jira.priority}"
webUser="${maven.jira.webUser}"
webPassword="${maven.jira.webPassword}"
jiraUser="${maven.jira.jiraUser}"
jiraPassword="${maven.jira.jiraPassword}"
proxyNtlmHost="${maven.jira.proxy.ntlm.host}"
proxyNtlmDomain="${maven.jira.proxy.ntlm.domain}"
component="${maven.jira.component}"
roadmap="${maven.jira.roadmap}"
/>
<mkdir dir="${maven.gen.docs}"/>
<j:catch var="parseresult">
<j:set var="title" value="Jira Report"/>
<j:set var="description" value="Report all issues defined in Jira."/>
<j:set var="jiraUrl" value="${pom.issueTrackingUrl}"/>
<doc:jslFile
input="${maven.build.dir}/jira/jira-results.xml"
output="${maven.gen.docs}/jira.xml"
stylesheet="${plugin.resources}/jira.jsl"
outputMode="xml"
prettyPrint="true"
/>
</j:catch>
<!-- FIXME: Hack, taken from announcement/plugin.jelly -->
<ant:replace file="${maven.gen.docs}/jira.xml" token="&amp;amp;" value="&amp;"/>
<j:choose>
<j:when test="${!empty(parseresult)}">
<ant:echo>Error: unable to parse jira results due to an error: ${parseresult.message}. Jira report will not be generated</ant:echo>
</j:when>
<j:otherwise>
<!-- go on -->
<copy todir="${maven.docs.dest}/images/jira" overwrite="yes" filtering="no">
<fileset dir="${plugin.resources}/images">
<include name="**/*.gif"/>
</fileset>
</copy>
</j:otherwise>
</j:choose>
<j:if test="${maven.jira.roadmap}">
<j:catch var="parseresult">
<j:set var="title" value="Jira Roadmap Report"/>
<j:set var="description" value="Report all issues that are scheduled for the next release."/>
<j:set var="jiraUrl" value="${pom.issueTrackingUrl}?report=com.atlassian.jira.plugin.system.project:roadmap-panel"/>
<doc:jslFile
input="${maven.build.dir}/jira/jira-roadmap.xml"
output="${maven.gen.docs}/jira-roadmap.xml"
stylesheet="${plugin.resources}/jira.jsl"
outputMode="xml"
prettyPrint="true"
/>
<j:remove var="jiraUrl"/>
</j:catch>
<!-- FIXME: Hack, taken from announcement/plugin.jelly -->
<ant:replace file="${maven.gen.docs}/jira-roadmap.xml" token="&amp;amp;" value="&amp;"/>
<j:choose>
<j:when test="${!empty(parseresult)}">
<ant:echo>Error: unable to parse jira results due to an error: ${parseresult.message}. Jira roadmap report will not be generated</ant:echo>
</j:when>
<j:otherwise>
<!-- go on -->
<copy todir="${maven.docs.dest}/images/jira" overwrite="no" filtering="no">
<fileset dir="${plugin.resources}/images">
<include name="**/*.gif"/>
</fileset>
</copy>
</j:otherwise>
</j:choose>
</j:if>
</goal>
</project>