Fix a bug where changes.xml was not parsed correctly when lenient=true
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@354832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -65,11 +65,13 @@
|
||||
|
||||
<goal name="announcement:check-version" prereqs="announcement:init">
|
||||
|
||||
<j:choose>
|
||||
<j:when test="${! isLenient}">
|
||||
|
||||
<x:parse var="doc" xml="${inputFile}"/>
|
||||
<j:set var="changesXmlAvailable" value="false"/>
|
||||
<util:available file="${inputFile}">
|
||||
<j:set var="changesXmlAvailable" value="true"/>
|
||||
</util:available>
|
||||
|
||||
<j:if test="${changesXmlAvailable}">
|
||||
<x:parse var="doc" xml="${inputFile}"/>
|
||||
<jsl:stylesheet select="$doc">
|
||||
<jsl:template match="document/body/release">
|
||||
<x:set var="version" select="string(@version)"/>
|
||||
@@ -80,11 +82,12 @@
|
||||
<jsl:template match="@*"/>
|
||||
<jsl:template match="text()"/>
|
||||
</jsl:stylesheet>
|
||||
|
||||
</j:if>
|
||||
|
||||
<j:if test="${!isLenient}">
|
||||
<j:if test="${versionFound == null}">
|
||||
<ant:fail>The ${versionVariable} release could not be found in the changes.xml file.</ant:fail>
|
||||
</j:if>
|
||||
|
||||
<!-- Check if a <version> tag is defined in the POM for the current release to be announced -->
|
||||
<j:if test="${size(pom.versions)!=0}">
|
||||
<j:set var="foundTag" value="false"/>
|
||||
@@ -98,8 +101,9 @@
|
||||
<ant:fail>Missing "version" element in the POM for release ${versionVariable}.</ant:fail>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
</j:if>
|
||||
|
||||
<j:if test="${!changesXmlAvailable or versionFound == null}">
|
||||
<!-- creates an empty changes.xml file -->
|
||||
<j:set var="emptyChangesXml" value="${maven.build.dir}/empty-changes.xml"/>
|
||||
<j:file
|
||||
@@ -119,9 +123,8 @@
|
||||
</j:file>
|
||||
<util:file var="emptyChangesXmlFile" name="${emptyChangesXml}"/>
|
||||
<x:parse var="doc" xml="${emptyChangesXmlFile}"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:if>
|
||||
|
||||
</goal>
|
||||
|
||||
<goal name="announcement:generate" prereqs="announcement:check-version"
|
||||
@@ -134,11 +137,6 @@
|
||||
<goal name="announcement:generate-all" prereqs="announcement:check-version"
|
||||
description="Generate release announcement for all releases">
|
||||
|
||||
<j:set var="changesXmlAvailable" value="false"/>
|
||||
<util:available file="${inputFile}">
|
||||
<j:set var="changesXmlAvailable" value="true"/>
|
||||
</util:available>
|
||||
|
||||
<j:choose>
|
||||
<j:when test="${changesXmlAvailable}">
|
||||
<x:parse var="doc" xml="${inputFile}"/>
|
||||
|
||||
Reference in New Issue
Block a user