You can do this with the antrun plugin. Add the ant task to either do the
scan or have ant run some program of your chosing to run the scan. Based on
the result of the scan, you have ant fail and the build will fail.

The thing I don't know is which lifecycle phase you tie that ant task to.
You said the "JSPs that had been written". If you mean the JSPs that the
team wrote then the  'generate-source' phase would work just fine and it
would fail right up front. If these JSPs are generated for you in some phase
you will have to pick a phase after that one.

-- Lee

On Thu, May 14, 2009 at 3:59 AM, Komal Bhardwaj <komalbhard...@gmail.com>wrote:

> Hello,
>
> As a part of building a WAR (web archive) file for my project from maven, I
> want to execute a script. If the script returns true, then the build should
> go further to create the .war file, otherwise the build process should not
> proceed further.
>
> How can I achieve this using maven? I am using maven version 1.2, for
> building .war file for my project.
>
> My use case is:
> I want to check for a certain patter in all the .jsp files that have been
> written in the project. Now, if anyone one of the jsp file does not contain
> that pattern, then the build should fail. I've written a script to do this.
> However, I want this script to be executed every time someone builds
> creates
> a war file using maven 1.2.
>
> Thanks,
> Komal Bhardwaj
>



-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

Reply via email to