Author: vsiveton
Date: Fri Jul 28 18:35:21 2006
New Revision: 426736

URL: http://svn.apache.org/viewvc?rev=426736&view=rev
Log:
PR: MVERIFIER-2 review plugin documentation
Submitted by: Denis Cabasson

o Proposed documentation
o it provided too

Added:
    maven/plugins/trunk/maven-verifier-plugin/src/it/
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/pom.xml
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/
    
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file1.txt
    
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file2.txt
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/
    maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/
    
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/verifications-test.xml
    maven/plugins/trunk/maven-verifier-plugin/src/site/
    maven/plugins/trunk/maven-verifier-plugin/src/site/apt/
    maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/
    maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/simple.apt
    maven/plugins/trunk/maven-verifier-plugin/src/site/apt/index.apt
    maven/plugins/trunk/maven-verifier-plugin/src/site/apt/usage.apt
    maven/plugins/trunk/maven-verifier-plugin/src/site/site.xml
Modified:
    maven/plugins/trunk/maven-verifier-plugin/pom.xml
    
maven/plugins/trunk/maven-verifier-plugin/src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java

Modified: maven/plugins/trunk/maven-verifier-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/pom.xml?rev=426736&r1=426735&r2=426736&view=diff
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-verifier-plugin/pom.xml Fri Jul 28 18:35:21 2006
@@ -9,6 +9,9 @@
   <packaging>maven-plugin</packaging>
   <name>Maven Verifier Plugin</name>
   <version>1.0-beta-2-SNAPSHOT</version>
+  <prerequisites>
+    <maven>2.0</maven>
+  </prerequisites>
   <issueManagement>
     <system>JIRA</system>
     <url>http://jira.codehaus.org/browse/MVERIFIER</url>

Added: maven/plugins/trunk/maven-verifier-plugin/src/it/simple/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/it/simple/pom.xml?rev=426736&view=auto
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/src/it/simple/pom.xml (added)
+++ maven/plugins/trunk/maven-verifier-plugin/src/it/simple/pom.xml Fri Jul 28 
18:35:21 2006
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-verifier-plugin-sample-simple</artifactId>
+  <packaging>jar</packaging>
+  <name>Maven Verifier Plugin Simple Sample</name>
+  <description>Maven Verifier Plugin Simple Sample</description>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-verifier-plugin</artifactId>
+        <configuration>
+
+          <failOnError>true</failOnError>
+          
<verificationFile>${basedir}/src/test/verifier/verifications-test.xml</verificationFile>
+
+        </configuration>
+        <executions>
+          <execution>
+            <id>main</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file1.txt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file1.txt?rev=426736&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file1.txt
 (added)
+++ 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file1.txt
 Fri Jul 28 18:35:21 2006
@@ -0,0 +1 @@
+This one is quite empty.

Added: 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file2.txt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file2.txt?rev=426736&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file2.txt
 (added)
+++ 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/main/resources/file2.txt
 Fri Jul 28 18:35:21 2006
@@ -0,0 +1 @@
+Lots of stuff here.... aaaabbbb that's all!!

Added: 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/verifications-test.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/verifications-test.xml?rev=426736&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/verifications-test.xml
 (added)
+++ 
maven/plugins/trunk/maven-verifier-plugin/src/it/simple/src/test/verifier/verifications-test.xml
 Fri Jul 28 18:35:21 2006
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<verifications>
+       <files>
+               <file>
+                       <location>src/main/resources/file1.txt</location>
+               </file>
+               <file>
+                       <location>src/main/resources/file2.txt</location>
+                       <contains>aaaabbbb</contains>
+               </file>
+               <file>
+                       <location>src/main/resources/file3.txt</location>
+                       <exists>false</exists>
+               </file>
+       </files>
+</verifications>

Modified: 
maven/plugins/trunk/maven-verifier-plugin/src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java?rev=426736&r1=426735&r2=426736&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-verifier-plugin/src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-verifier-plugin/src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java
 Fri Jul 28 18:35:21 2006
@@ -44,18 +44,24 @@
     extends AbstractMojo
 {
     /**
+     * Project base directory (appended for relative file paths).
+     *
      * @parameter expression="${basedir}"
      * @required
      */
     private File basedir;
 
     /**
+     * The file containing the verifications to perform.
+     *
      * @parameter expression="${basedir}/src/test/verifier/verifications.xml"
      * @required
      */
     private File verificationFile;
 
     /**
+     * Wether the build will fail if a file isn't available or not.
+     *
      * @required
      */
     private boolean failOnError = true;
@@ -158,7 +164,7 @@
 
         Pattern pattern = Pattern.compile( fileCheck.getContains() );
 
-        // Note: Very inefficient way as we load the whole file in memory. If 
you have a better 
+        // Note: Very inefficient way as we load the whole file in memory. If 
you have a better
         // idea, please submit it!
         Matcher matcher = pattern.matcher( FileUtils.fileRead( new File( 
fileCheck.getLocation() ) ) );
 

Added: 
maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/simple.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/simple.apt?rev=426736&view=auto
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/simple.apt 
(added)
+++ maven/plugins/trunk/maven-verifier-plugin/src/site/apt/examples/simple.apt 
Fri Jul 28 18:35:21 2006
@@ -0,0 +1,35 @@
+ ------
+ Maven 2 Verifier Plugin: Simple example
+ ------
+ Denis Cabasson
+ ------
+ 20 july 2006
+ ------
+
+Sample verifications.xml file
+
++--------
+<verifications>
+  <files>
+    <file>
+      <location>src/main/resources/file1.txt</location>
+    </file>
+    <file>
+      <location>src/main/resources/file2.txt</location>
+      <contains>aaaabbbb</contains>
+    </file>
+    <file>
+      <location>src/main/resources/file3.txt</location>
+      <exists>false</exists>
+    </file>
+  </files>
+</verifications>
++---------
+
+  This file:
+
+  * checks that the file <<<src/main/resources/file1.txt>>> is present.
+
+  * checks that the file <<<src/main/resources/file2.txt>>> is present and 
match the regexp <aaaabbbb>.
+
+  * checks that the file <<<src/main/resources/file3.txt>>> is <<not>> present.

Added: maven/plugins/trunk/maven-verifier-plugin/src/site/apt/index.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/site/apt/index.apt?rev=426736&view=auto
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-verifier-plugin/src/site/apt/index.apt Fri Jul 28 
18:35:21 2006
@@ -0,0 +1,29 @@
+ ------
+ Introduction
+ ------
+ Denis Cabasson
+ ------
+ 20 july 2006
+ ------
+
+
+Maven Verifier Plugin
+
+  Useful for integration tests - verifies the existence of certain conditions.
+
+* Goals Overview
+
+  General Information about the goals.
+
+  * {{{goal.html}verifier:verify}} Verifies existence or non-existence of 
files/directories and optionally checks file content against a regexp.
+
+* Usage
+
+  Instructions on how to use the Plugin Name can be found {{{usage.html}here}}.
+
+* Examples
+
+  To provide you with better understanding on some usages of the Plugin Name,
+  you can take a look into the following examples:
+
+  * {{{examples/simple.html}Simple Project}}

Added: maven/plugins/trunk/maven-verifier-plugin/src/site/apt/usage.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/site/apt/usage.apt?rev=426736&view=auto
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/src/site/apt/usage.apt (added)
+++ maven/plugins/trunk/maven-verifier-plugin/src/site/apt/usage.apt Fri Jul 28 
18:35:21 2006
@@ -0,0 +1,43 @@
+ ------
+ Maven 2 Verifier Plugin: using
+ ------
+ Denis Cabasson
+ ------
+ 20 july 2006
+ ------
+
+Verifying some file system resources during you build
+
+  Add the Verifier plugin in your <<<pom.xml>>> under the <<<build>>> section:
+
++--------
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-verifier-plugin</artifactId>
+        <configuration>
+          <failOnError>true</failOnError>
+          
<verificationFile>${basedir}/src/test/verifier/verifications-test.xml</verificationFile>
+        </configuration>
+        <executions>
+          <execution>
+            <id>main</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+[...]
++---------
+
+  The <<<maven-verifier-plugin>>> will break your build if the files 
designated in
+  the verificationFile cannot be found.
+
+  For a sample verification file, see {{{examples/simple.html}Simple Exemple}}.

Added: maven/plugins/trunk/maven-verifier-plugin/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-verifier-plugin/src/site/site.xml?rev=426736&view=auto
==============================================================================
--- maven/plugins/trunk/maven-verifier-plugin/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-verifier-plugin/src/site/site.xml Fri Jul 28 
18:35:21 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<body>
+    <links>
+      <item name="Maven" href="http://maven.apache.org/maven2/"/>
+    </links>
+
+    <menu name="Overview">
+      <item name="Introduction" href="index.html"/>
+      <item name="Goals" href="plugin-info.html"/>
+      <item name="Usage" href="usage.html"/>
+    </menu>
+
+    <menu name="Examples">
+      <item name="Simple" href="examples/simple.html"/>
+   </menu>
+
+    ${reports}
+
+</body>


Reply via email to