You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eugeny N Dzhurinsky <bo...@redwerk.com> on 2009/01/07 15:22:52 UTC

skipping execution of plugins, which are creating the environment for tests

Hello!

Can somebody please advice, is it possible to skip execution of certain
plugins, which are only needed when performing the tests?

For instance, we need to prepare the correct SQL database for our tests, we
are using sql-maven-plugin to create the database and insert the required data
into it. 

What we found is the test database is being created even in case if
-Dmaven.test.skip option was provided, and this is a bit confusing, since we
don't want to drop/create/fill database if we want to build a package w/o
testing (yes, I know that's the bad idea, but sometimes we need go go this
way).

The plugin is bound to the prepare-test-resources phase, and looks like it is
invoked all the time, no matter whether the tests are to be invoked or not.

Thank you in advance!

-- 
Eugene N Dzhurinsky

Re: skipping execution of plugins, which are creating the environment for tests

Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Wed, Jan 07, 2009 at 09:35:16AM -0500, John Stoneham wrote:
> On Wed, Jan 7, 2009 at 9:22 AM, Eugeny N Dzhurinsky <bo...@redwerk.com> wrote:
> > Can somebody please advice, is it possible to skip execution of certain
> > plugins, which are only needed when performing the tests?
> 
> You could create a profile that contains these plugins, which is
> activated in the absence of the property maven.test.skip. This would
> be a general solution.
> 
> Alternatively if, like many plugins, the ones in question have a
> "skip" configuration parameter to enable use cases like yours, you
> could pass ${maven.test.skip} as the value of that parameter.

Okay, thank you very much! I already did in this way and it worked.

-- 
Eugene N Dzhurinsky

Re: skipping execution of plugins, which are creating the environment for tests

Posted by John Stoneham <ly...@lyrically.net>.
On Wed, Jan 7, 2009 at 9:22 AM, Eugeny N Dzhurinsky <bo...@redwerk.com> wrote:
> Can somebody please advice, is it possible to skip execution of certain
> plugins, which are only needed when performing the tests?

You could create a profile that contains these plugins, which is
activated in the absence of the property maven.test.skip. This would
be a general solution.

Alternatively if, like many plugins, the ones in question have a
"skip" configuration parameter to enable use cases like yours, you
could pass ${maven.test.skip} as the value of that parameter.

- John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: skipping execution of plugins, which are creating the environment for tests

Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Wed, Jan 07, 2009 at 03:36:44PM +0100, Baptiste MATHUS wrote:
> Hi,
> Just an idea, I see here (
> http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html#skip) there's a
> skip option.
> Have you tried adding the corresponding configuration, and just put
> something like:
> 
> <configuration>
> <skip>${maven.test.skip}</skip>
> </configuration>

Well, I did in a bit different way - I have introduced the profile and
provided it with the activation option 

<property>
    <name>!maven.test.skip</name>
</property>

and this seems to work.

-- 
Eugene N Dzhurinsky

Re: skipping execution of plugins, which are creating the environment for tests

Posted by Baptiste MATHUS <ml...@batmat.net>.
Hi,
Just an idea, I see here (
http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html#skip) there's a
skip option.
Have you tried adding the corresponding configuration, and just put
something like:

<configuration>
<skip>${maven.test.skip}</skip>
</configuration>

HTH.
Cheers

2009/1/7 Eugeny N Dzhurinsky <bo...@redwerk.com>

> Hello!
>
> Can somebody please advice, is it possible to skip execution of certain
> plugins, which are only needed when performing the tests?
>
> For instance, we need to prepare the correct SQL database for our tests, we
> are using sql-maven-plugin to create the database and insert the required
> data
> into it.
>
> What we found is the test database is being created even in case if
> -Dmaven.test.skip option was provided, and this is a bit confusing, since
> we
> don't want to drop/create/fill database if we want to build a package w/o
> testing (yes, I know that's the bad idea, but sometimes we need go go this
> way).
>
> The plugin is bound to the prepare-test-resources phase, and looks like it
> is
> invoked all the time, no matter whether the tests are to be invoked or not.
>
> Thank you in advance!
>
> --
> Eugene N Dzhurinsky
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !