Author: dennisl
Date: Thu Jul 31 04:47:08 2008
New Revision: 681344
URL: http://svn.apache.org/viewvc?rev=681344&view=rev
Log:
o Improve documentation and logging for the changes-validate mojo.
Modified:
maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/changes-file-validation.apt
maven/plugins/trunk/maven-changes-plugin/src/site/apt/index.apt
maven/plugins/trunk/maven-changes-plugin/src/site/site.xml
Modified:
maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java?rev=681344&r1=681343&r2=681344&view=diff
==============================================================================
---
maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
(original)
+++
maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
Thu Jul 31 04:47:08 2008
@@ -33,7 +33,7 @@
/**
*
- * Goal which validate changes file
+ * Goal which validate the <code>changes.xml</code> file.
*
* @goal changes-validate
*
@@ -90,18 +90,18 @@
{
XmlValidationHandler xmlValidationHandler = changesSchemaValidator
.validateXmlWithSchema( xmlPath, changesXsdVersion,
failOnError );
- boolean hasErrros = !xmlValidationHandler.getErrors().isEmpty();
- if ( hasErrros )
+ boolean hasErrors = !xmlValidationHandler.getErrors().isEmpty();
+ if ( hasErrors )
{
logSchemaValidation( xmlValidationHandler.getErrors() );
if ( failOnError )
{
throw new MojoExecutionException( "changes.xml file " +
xmlPath.getAbsolutePath()
- + " is not valid see previous errors" );
+ + " is not valid, see previous errors." );
}
else
{
- getLog().info( " skip previous validation errors due
failOnError false " );
+ getLog().info( " skip previous validation errors due to
failOnError=false." );
}
}
}
@@ -110,15 +110,15 @@
if ( failOnError )
{
throw new MojoExecutionException( "failed to validate
changes.xml file " + xmlPath.getAbsolutePath()
- + " : " + e.getMessage(), e );
+ + ": " + e.getMessage(), e );
}
}
}
private void logSchemaValidation( List /*SAXException*/errors )
{
- getLog().warn( "failed to validate changes " +
xmlPath.getAbsolutePath() );
- getLog().warn( "validation errors : " );
+ getLog().warn( "failed to validate changes.xml file " +
xmlPath.getAbsolutePath() );
+ getLog().warn( "validation errors: " );
for ( Iterator iterator = errors.iterator(); iterator.hasNext(); )
{
SAXException error = (SAXException) iterator.next();
Modified:
maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/changes-file-validation.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/changes-file-validation.apt?rev=681344&r1=681343&r2=681344&view=diff
==============================================================================
---
maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/changes-file-validation.apt
(original)
+++
maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/changes-file-validation.apt
Thu Jul 31 04:47:08 2008
@@ -1,9 +1,9 @@
------
- Validate your changes file
+ Validate Your changes.xml File
------
Olivier Lamy
------
- 31 July 2008
+ 2008-07-31
------
~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -27,15 +27,16 @@
~~ http://maven.apache.org/doxia/references/apt-format.html
-Validate your changes file
+Validate Your changes.xml File
- Since 2.1, a {{{../changes-validate-mojo.html}mojo}} is now provided a schema
file and a mojo is now
+ Since 2.1, a {{{../changes-validate-mojo.html}mojo}} is
provided to validate your changes file.\
- You can attach this mojo to the pre-site phase.
+ You can attach this mojo to the <<<pre-site>>> phase if you want the
+ validation to be performed automatically when you generate the site.
* Configuring the Plugin
- First you must configure the plugin and tell it to validate your changes
file.
+ First you must configure the plugin and tell it to validate your changes file.
+-----------------+
<project>
@@ -44,7 +45,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
- <version>2.1</version>
+ <version>2.1</version>
<executions>
<execution>
<id>validate-changes</id>
@@ -53,11 +54,12 @@
<goal>changes-validate</goal>
</goals>
<configuration>
- <!-- if true the build will fail if the changes is not, if false
warn will be logged. -->
+ <!-- if set to true the build will fail if the changes file is
invalid,
+ if set to false warnings will be logged. -->
<failOnError>true</failOnError>
</configuration>
</execution>
- </executions>
+ </executions>
</plugin>
</plugins>
...
Modified: maven/plugins/trunk/maven-changes-plugin/src/site/apt/index.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/site/apt/index.apt?rev=681344&r1=681343&r2=681344&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/site/apt/index.apt Thu Jul 31
04:47:08 2008
@@ -3,7 +3,7 @@
------
Dennis Lundberg
------
- 31 July 2008
+ 2008-07-31
------
~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -46,7 +46,7 @@
* {{{jira-report-mojo.html}changes:jira-report}} create a report from issues
downloaded from JIRA.
- * {{{changes-validate-mojo.html.html}changes:changes-validate}} create a
report from issues downloaded from JIRA.
+ * {{{changes-validate-mojo.html.html}changes:changes-validate}} validate the
<<<changes.xml>>> file.
[]
@@ -67,4 +67,4 @@
* {{{examples/specifying-mail-sender.html}Specifying the mail sender}}
- * {{{examples/changes-file-validation.html}Validate your changes file}}
+ * {{{examples/changes-file-validation.html}Validate your <<<changes.xml>>>
file}}
Modified: maven/plugins/trunk/maven-changes-plugin/src/site/site.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/site/site.xml?rev=681344&r1=681343&r2=681344&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/site/site.xml Thu Jul 31
04:47:08 2008
@@ -38,7 +38,7 @@
<item name="SMTP Authentication"
href="examples/smtp-authentication.html"/>
<item name="Specifying the Mail Sender"
href="examples/specifying-mail-sender.html"/>
<item name="Using a Custom Announcement Template"
href="examples/using-a-custom-announcement-template.html"/>
- <item name="Validate your changes file"
href="examples/changes-file-validation.html"/>
+ <item name="Validate Your changes.xml File"
href="examples/changes-file-validation.html"/>
</menu>
</body>
</project>