Index: src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java (r‚vision 423860) +++ src/main/java/org/apache/maven/plugin/verifier/VerifierMojo.java (copie de travail) @@ -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() ) ) ); Index: src/site/site.xml =================================================================== --- src/site/site.xml (r‚vision 0) +++ src/site/site.xml (r‚vision 0) @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + ${reports} + + Index: src/site/apt/usage.apt =================================================================== --- src/site/apt/usage.apt (r‚vision 0) +++ src/site/apt/usage.apt (r‚vision 0) @@ -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 <<>> under the <<>> section: + ++-------- + + [...] + + + + org.apache.maven.plugins + maven-verifier-plugin + + true + ${basedir}/src/test/verifier/verifications-test.xml + + + + main + verify + + verify + + + + + + +[...] ++--------- + + The <<>> 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}}. Index: src/site/apt/index.apt =================================================================== --- src/site/apt/index.apt (r‚vision 0) +++ src/site/apt/index.apt (r‚vision 0) @@ -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}} Index: src/site/apt/examples/simple.apt =================================================================== --- src/site/apt/examples/simple.apt (r‚vision 0) +++ src/site/apt/examples/simple.apt (r‚vision 0) @@ -0,0 +1,35 @@ + ------ + Maven 2 Verifier Plugin: Simple example + ------ + Denis Cabasson + ------ + 20 july 2006 + ------ + +Sample verifications.xml file + ++-------- + + + + src/main/resources/file1.txt + + + src/main/resources/file2.txt + aaaabbbb + + + src/main/resources/file3.txt + false + + + ++--------- + + This file: + + * checks that the file <<>> is present. + + * checks that the file <<>> is present and match the regexp . + + * checks that the file <<>> is <> present. Index: src/it/simple/src/test/verifier/verifications-test.xml =================================================================== --- src/it/simple/src/test/verifier/verifications-test.xml (r‚vision 0) +++ src/it/simple/src/test/verifier/verifications-test.xml (r‚vision 0) @@ -0,0 +1,16 @@ + + + + + src/main/resources/file1.txt + + + src/main/resources/file2.txt + aaaabbbb + + + src/main/resources/file3.txt + false + + + Index: src/it/simple/src/main/resources/file2.txt =================================================================== --- src/it/simple/src/main/resources/file2.txt (r‚vision 0) +++ src/it/simple/src/main/resources/file2.txt (r‚vision 0) @@ -0,0 +1 @@ +Lots of stuff here.... aaaabbbb that's all!! Index: src/it/simple/src/main/resources/file1.txt =================================================================== --- src/it/simple/src/main/resources/file1.txt (r‚vision 0) +++ src/it/simple/src/main/resources/file1.txt (r‚vision 0) @@ -0,0 +1 @@ +This one is quite empty. Index: src/it/simple/pom.xml =================================================================== --- src/it/simple/pom.xml (r‚vision 0) +++ src/it/simple/pom.xml (r‚vision 0) @@ -0,0 +1,33 @@ + + + 4.0.0 + org.apache.maven.plugins + maven-verifier-plugin-sample-simple + jar + Maven Verifier Plugin Simple Sample + Maven Verifier Plugin Simple Sample + 1.0-SNAPSHOT + + + + org.apache.maven.plugins + maven-verifier-plugin + + + true + ${basedir}/src/test/verifier/verifications-test.xml + + + + + main + verify + + verify + + + + + + + Index: pom.xml =================================================================== --- pom.xml (r‚vision 423860) +++ pom.xml (copie de travail) @@ -9,6 +9,9 @@ maven-plugin Maven Verifier Plugin 1.0-beta-2-SNAPSHOT + + 2.0 +