improve naming consistency : rename plugin:available by assert:assertPluginAvailable
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@290197 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
677c0c6d33
commit
c587f48e09
@ -28,15 +28,15 @@
|
|||||||
xmlns:ant="jelly:ant"
|
xmlns:ant="jelly:ant"
|
||||||
xmlns:util="jelly:util"
|
xmlns:util="jelly:util"
|
||||||
xmlns:doc="doc"
|
xmlns:doc="doc"
|
||||||
xmlns:plugin="plugin"
|
xmlns:assert="assert"
|
||||||
xmlns:maven="jelly:maven"
|
xmlns:maven="jelly:maven"
|
||||||
xmlns:define="jelly:define"
|
xmlns:define="jelly:define"
|
||||||
xmlns:checkstyle="checkstyle">
|
xmlns:checkstyle="checkstyle">
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<!-- fake test because the plugin:available tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||||
<plugin:available groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="maven-faq-plugin"/>
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||||
<plugin:available groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.10" neededBy="maven-faq-plugin"/>
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.10" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
6
dist/plugin.jelly
vendored
6
dist/plugin.jelly
vendored
@ -23,11 +23,13 @@
|
|||||||
xmlns:ant="jelly:ant"
|
xmlns:ant="jelly:ant"
|
||||||
xmlns:maven="jelly:maven"
|
xmlns:maven="jelly:maven"
|
||||||
xmlns:artifact="artifact"
|
xmlns:artifact="artifact"
|
||||||
xmlns:plugin="plugin"
|
xmlns:assert="assert"
|
||||||
xmlns:util="jelly:util">
|
xmlns:util="jelly:util">
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-dist-plugin"/>
|
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<j:new var="distTypeHandler" className="org.apache.maven.dist.DistributionArtifactTypeHandler" />
|
<j:new var="distTypeHandler" className="org.apache.maven.dist.DistributionArtifactTypeHandler" />
|
||||||
|
|||||||
@ -26,13 +26,13 @@
|
|||||||
xmlns:ant="jelly:ant"
|
xmlns:ant="jelly:ant"
|
||||||
xmlns:define="jelly:define"
|
xmlns:define="jelly:define"
|
||||||
xmlns:doc="doc"
|
xmlns:doc="doc"
|
||||||
xmlns:plugin="plugin"
|
xmlns:assert="assert"
|
||||||
xmlns:faq="faq">
|
xmlns:faq="faq">
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<!-- fake test because the plugin:available tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||||
<plugin:available groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="maven-faq-plugin"/>
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||||
<plugin:available groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.9.2" neededBy="maven-faq-plugin"/>
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.9.2" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<define:taglib uri="faq">
|
<define:taglib uri="faq">
|
||||||
|
|||||||
@ -24,12 +24,14 @@
|
|||||||
xmlns:license="license"
|
xmlns:license="license"
|
||||||
xmlns:maven="jelly:maven"
|
xmlns:maven="jelly:maven"
|
||||||
xmlns:artifact="artifact"
|
xmlns:artifact="artifact"
|
||||||
xmlns:plugin="plugin"
|
xmlns:assert="assert"
|
||||||
xmlns:util="jelly:util"
|
xmlns:util="jelly:util"
|
||||||
xmlns:doc="doc">
|
xmlns:doc="doc">
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-jar-plugin"/>
|
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
|
|||||||
@ -23,11 +23,13 @@
|
|||||||
xmlns:maven="jelly:maven"
|
xmlns:maven="jelly:maven"
|
||||||
xmlns:doc="doc"
|
xmlns:doc="doc"
|
||||||
xmlns:scm="scm"
|
xmlns:scm="scm"
|
||||||
xmlns:plugin="plugin"
|
xmlns:assert="assert"
|
||||||
xmlns:ant="jelly:ant">
|
xmlns:ant="jelly:ant">
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<plugin:available groupId="maven" artifactId="maven-scm-plugin" minRelease="1.5" neededBy="maven-jdiff-plugin"/>
|
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||||
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-scm-plugin" minRelease="1.5" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<goal name="maven-jdiff-plugin:register">
|
<goal name="maven-jdiff-plugin:register">
|
||||||
|
|||||||
@ -55,9 +55,47 @@
|
|||||||
<ant:include name="**/.processed" />
|
<ant:include name="**/.processed" />
|
||||||
</ant:fileset>
|
</ant:fileset>
|
||||||
</ant:delete>
|
</ant:delete>
|
||||||
</define:tag>
|
</define:tag>
|
||||||
|
|
||||||
<define:tag name="available">
|
</define:taglib>
|
||||||
|
|
||||||
|
<define:taglib uri="assert">
|
||||||
|
<define:tag name="assertFileExists">
|
||||||
|
<!-- @file : Full file path -->
|
||||||
|
<!-- @msg : optional message to be displayed -->
|
||||||
|
<u:file var="fileAsFile" name="${file}"/>
|
||||||
|
<j:if test="${!(fileAsFile.exists())}">
|
||||||
|
<ant:fail>${file} does not exist.${msg}</ant:fail>
|
||||||
|
</j:if>
|
||||||
|
</define:tag>
|
||||||
|
<define:tag name="assertFileContains">
|
||||||
|
<!-- @file : Full file path -->
|
||||||
|
<!-- @match: the matching value expected -->
|
||||||
|
<!-- @msg : optional message to be displayed -->
|
||||||
|
<assert:assertFileExists file="${file}" msg="${msg}"/>
|
||||||
|
<u:loadText var="fileContent" file="${file}"/>
|
||||||
|
<j:if test="${fileContent.indexOf(match) lt 0}">
|
||||||
|
<ant:fail>${file} does not contain string [${match}].${msg}</ant:fail>
|
||||||
|
</j:if>
|
||||||
|
</define:tag>
|
||||||
|
<define:tag name="assertFileNotFound">
|
||||||
|
<!-- @file : Full file path -->
|
||||||
|
<!-- @msg : optional message to be displayed -->
|
||||||
|
<u:file var="fileAsFile" name="${file}"/>
|
||||||
|
<j:if test="${fileAsFile.exists()}">
|
||||||
|
<ant:fail>${file} found and not expected.${msg}</ant:fail>
|
||||||
|
</j:if>
|
||||||
|
</define:tag>
|
||||||
|
<define:tag name="assertEquals">
|
||||||
|
<!-- @expected : the expected value -->
|
||||||
|
<!-- @value : the actual value -->
|
||||||
|
<!-- @msg : optional message to be displayed -->
|
||||||
|
<j:if test="${not(expected.equals(value))}">
|
||||||
|
<ant:fail>Expected [${expected}] but got [${value}].${msg}</ant:fail>
|
||||||
|
</j:if>
|
||||||
|
</define:tag>
|
||||||
|
|
||||||
|
<define:tag name="assertPluginAvailable">
|
||||||
<!-- Check parameters -->
|
<!-- Check parameters -->
|
||||||
<maven:param-check value="${groupId}" fail="true" message="'groupId' must be specified"/>
|
<maven:param-check value="${groupId}" fail="true" message="'groupId' must be specified"/>
|
||||||
<maven:param-check value="${artifactId}" fail="true" message="'artifactId' must be specified"/>
|
<maven:param-check value="${artifactId}" fail="true" message="'artifactId' must be specified"/>
|
||||||
@ -157,49 +195,12 @@ Try: maven plugin:download -DgroupId=maven -DartifactId=${pluginToTest} -Dversio
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
</ant:fail>
|
</ant:fail>
|
||||||
</j:if>
|
</j:if>
|
||||||
</define:tag>
|
</define:tag>
|
||||||
|
|
||||||
</define:taglib>
|
|
||||||
|
|
||||||
<define:taglib uri="assert">
|
|
||||||
<define:tag name="assertFileExists">
|
|
||||||
<!-- @file : Full file path -->
|
|
||||||
<!-- @msg : optional message to be displayed -->
|
|
||||||
<u:file var="fileAsFile" name="${file}"/>
|
|
||||||
<j:if test="${!(fileAsFile.exists())}">
|
|
||||||
<ant:fail>${file} does not exist.${msg}</ant:fail>
|
|
||||||
</j:if>
|
|
||||||
</define:tag>
|
|
||||||
<define:tag name="assertFileContains">
|
|
||||||
<!-- @file : Full file path -->
|
|
||||||
<!-- @match: the matching value expected -->
|
|
||||||
<!-- @msg : optional message to be displayed -->
|
|
||||||
<assert:assertFileExists file="${file}" msg="${msg}"/>
|
|
||||||
<u:loadText var="fileContent" file="${file}"/>
|
|
||||||
<j:if test="${fileContent.indexOf(match) lt 0}">
|
|
||||||
<ant:fail>${file} does not contain string [${match}].${msg}</ant:fail>
|
|
||||||
</j:if>
|
|
||||||
</define:tag>
|
|
||||||
<define:tag name="assertFileNotFound">
|
|
||||||
<!-- @file : Full file path -->
|
|
||||||
<!-- @msg : optional message to be displayed -->
|
|
||||||
<u:file var="fileAsFile" name="${file}"/>
|
|
||||||
<j:if test="${fileAsFile.exists()}">
|
|
||||||
<ant:fail>${file} found and not expected.${msg}</ant:fail>
|
|
||||||
</j:if>
|
|
||||||
</define:tag>
|
|
||||||
<define:tag name="assertEquals">
|
|
||||||
<!-- @expected : the expected value -->
|
|
||||||
<!-- @value : the actual value -->
|
|
||||||
<!-- @msg : optional message to be displayed -->
|
|
||||||
<j:if test="${not(expected.equals(value))}">
|
|
||||||
<ant:fail>Expected [${expected}] but got [${value}].${msg}</ant:fail>
|
|
||||||
</j:if>
|
|
||||||
</define:tag>
|
|
||||||
</define:taglib>
|
</define:taglib>
|
||||||
|
|
||||||
<j:if test="${bootstrapping == null}">
|
<j:if test="${bootstrapping == null}">
|
||||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-plugin-plugin"/>
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<goal name="plugin" prereqs="plugin:plugin" description="Build a plugin jar" />
|
<goal name="plugin" prereqs="plugin:plugin" description="Build a plugin jar" />
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
<release version="1.7-SNAPSHOT" date="In SVN">
|
<release version="1.7-SNAPSHOT" date="In SVN">
|
||||||
<action dev="aheritier" type="add">new plugin:available tag to check if a minimal release of a plugin is present.</action>
|
<action dev="aheritier" type="add">new assert:assertPluginAvailable tag to check if a minimal release of a plugin is present.</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.6" date="2005-06-03">
|
<release version="1.6" date="2005-06-03">
|
||||||
<action dev="vmassol" type="add">Added new
|
<action dev="vmassol" type="add">Added new
|
||||||
|
|||||||
@ -31,7 +31,6 @@
|
|||||||
<ol>
|
<ol>
|
||||||
<li><a href='#uninstall_Tag'>uninstall</a></li>
|
<li><a href='#uninstall_Tag'>uninstall</a></li>
|
||||||
<li><a href='#clearCache_Tag'>clearCache</a></li>
|
<li><a href='#clearCache_Tag'>clearCache</a></li>
|
||||||
<li><a href='#available_Tag'>available</a></li>
|
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
<li><a href='#assert_Tag_Library'>assert</a>
|
<li><a href='#assert_Tag_Library'>assert</a>
|
||||||
@ -40,6 +39,7 @@
|
|||||||
<li><a href='#assertFileContains_Tag'>assertFileContains</a></li>
|
<li><a href='#assertFileContains_Tag'>assertFileContains</a></li>
|
||||||
<li><a href='#assertFileNotFound_Tag'>assertFileNotFound</a></li>
|
<li><a href='#assertFileNotFound_Tag'>assertFileNotFound</a></li>
|
||||||
<li><a href='#assertEquals_Tag'>assertEquals</a></li>
|
<li><a href='#assertEquals_Tag'>assertEquals</a></li>
|
||||||
|
<li><a href='#assertPluginAvailable_Tag'>available</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
@ -71,32 +71,6 @@
|
|||||||
</p>
|
</p>
|
||||||
<p>There are no attributes for this tag</p>
|
<p>There are no attributes for this tag</p>
|
||||||
</subsection>
|
</subsection>
|
||||||
<subsection name='available Tag'>
|
|
||||||
<p>Fails the build if the given plugin does not exist or hasn't the minimal release number. Otherwise no effect.</p>
|
|
||||||
<table>
|
|
||||||
<tr><th>Attribute</th><th>Optional?</th><th>Description</th></tr>
|
|
||||||
<tr>
|
|
||||||
<td>groupId</td>
|
|
||||||
<td>No</td>
|
|
||||||
<td>The plugin's groupId</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>artifactId</td>
|
|
||||||
<td>No</td>
|
|
||||||
<td>The plugin's artifactId</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>minRelease</td>
|
|
||||||
<td>No</td>
|
|
||||||
<td>The minimum plugin's release</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>neededBy</td>
|
|
||||||
<td>No</td>
|
|
||||||
<td>The name of the plugin or project using this tag. It is used when the tag displays the error for the user.</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</subsection>
|
|
||||||
</section>
|
</section>
|
||||||
<section name='assert Tag Library'>
|
<section name='assert Tag Library'>
|
||||||
<p>
|
<p>
|
||||||
@ -177,6 +151,32 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</subsection>
|
</subsection>
|
||||||
|
<subsection name='assertPluginAvailable Tag'>
|
||||||
|
<p>Fails the build if the given plugin does not exist or hasn't the minimal release number. Otherwise no effect.</p>
|
||||||
|
<table>
|
||||||
|
<tr><th>Attribute</th><th>Optional?</th><th>Description</th></tr>
|
||||||
|
<tr>
|
||||||
|
<td>groupId</td>
|
||||||
|
<td>No</td>
|
||||||
|
<td>The plugin's groupId</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>artifactId</td>
|
||||||
|
<td>No</td>
|
||||||
|
<td>The plugin's artifactId</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>minRelease</td>
|
||||||
|
<td>No</td>
|
||||||
|
<td>The minimum plugin's release</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>neededBy</td>
|
||||||
|
<td>No</td>
|
||||||
|
<td>The name of the plugin or project using this tag. It is used when the tag displays the error for the user.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</subsection>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user