You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nigel Deakin <Ni...@spiritsoft.com> on 2004/02/05 13:16:46 UTC

Are unit test includes and excludes inherited?

I have a question about project inheritance which I haven't been able to
find out an answer to from searching the documentation or the archives
of this list.

I have two maven projects, one which extends the others. In general the
inheritence is working as I would expect.

In the parent project I have defined which unit tests I want to run and
which ones I want to omit:

  <build>  
    <!-- snip other stuff -->

    <unitTest>
       <includes>
        <include>com/**/Test*.java</include>
      </includes>
      <excludes>
        <exclude>**/foo/TestBar*.java</exclude>      
      </excludes>     
    </unitTest>
  </build>

In the child project I simply have:

  <build>  
    <!-- snip other stuff -->

  </build>

Now when I run the tests in the child project it runs everything in the
unitTestSourceDirectory, ignoring the excludes defined in the parent
project. So it looks as if the includes and excludes are not being
inherited.

Is this expected behaviour?   

(This is with 1.0-rc1)

Nigel


This message contains confidential information and is intended only for the named individual and may not be disseminated without prior permission.  If you are not the named addressee, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this message in error and delete this e-message from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, delayed in transmission, incomplete, or may contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this Message which arise as a result of e-mail transmission.  If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any software or services.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. http://www.messagelabs.com
________________________________________________________________________

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


Re: Are unit test includes and excludes inherited?

Posted by Emmanuel Venisse <em...@venisse.net>.
In Maven, only dependencies are merged when you inherit a project.
In your case, you redeclare a build tag, so only the child part is used and
not the parent part.

Emmanuel

----- Original Message ----- 
From: "Nigel Deakin" <Ni...@spiritsoft.com>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Thursday, February 05, 2004 1:16 PM
Subject: Are unit test includes and excludes inherited?


I have a question about project inheritance which I haven't been able to
find out an answer to from searching the documentation or the archives
of this list.

I have two maven projects, one which extends the others. In general the
inheritence is working as I would expect.

In the parent project I have defined which unit tests I want to run and
which ones I want to omit:

  <build>
    <!-- snip other stuff -->

    <unitTest>
       <includes>
        <include>com/**/Test*.java</include>
      </includes>
      <excludes>
        <exclude>**/foo/TestBar*.java</exclude>
      </excludes>
    </unitTest>
  </build>

In the child project I simply have:

  <build>
    <!-- snip other stuff -->

  </build>

Now when I run the tests in the child project it runs everything in the
unitTestSourceDirectory, ignoring the excludes defined in the parent
project. So it looks as if the includes and excludes are not being
inherited.

Is this expected behaviour?

(This is with 1.0-rc1)

Nigel


This message contains confidential information and is intended only for the
named individual and may not be disseminated without prior permission.  If
you are not the named addressee, you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have
received this message in error and delete this e-message from your system.
E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, delayed in
transmission, incomplete, or may contain viruses. The sender therefore does
not accept liability for any errors or omissions in the contents of this
Message which arise as a result of e-mail transmission.  If verification is
required please request a hard-copy version. This message is provided for
informational purposes and should not be construed as a solicitation or
offer to buy or sell any software or services.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. http://www.messagelabs.com
________________________________________________________________________

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



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