You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Spencer <pa...@apache.org> on 2005/11/22 19:44:45 UTC

[m2] surefire not honoring

The surefire plugin is not honoring the <excludes>

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <fork>true</fork>
           <includes>
             <include>**/*TestCase.java</include>
           </includes>
           <excludes>
             <exclude implementation="java.lang.String">
                com/foo/util/**
             </exclude>
           </excludes>
         </configuration>
       </plugin>

o The <exclude> is the same one used for the maven-compiler-plugin.
o mvn -X does not list the exclusion of the test source, just the source
   [DEBUG]   (f) excludes = [com/foo/util/**]

Paul Spencer

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


Re: [m2] surefire not honoring

Posted by Brett Porter <br...@gmail.com>.
On 11/23/05, Paul Spencer <pa...@apache.org> wrote:
> Brett,
> 1) The current behavior allows abstract test classes to be compiled but
>     NOT executed, which is good.  I currently use this functionality
>     on other projects.

ok, so that's a reason to keep it as is with both configurations.

>
> 2) The exclude list form the compiler plugin is not honored by the
>     surefire plugin relative compilation of the test source.  In my
>     case the exclude list of the compiler plugin was the same as the
>     exclude list for the surefire plugin.  All things considered, I am
>     not sure if the surefire plugin should inherit the compiler's exclude
>     list.

the surefire plugin doesn't inspect it at all. the only way it is
inherited is that if the test case is not compiled, surefire won't
find it to run so it is implicitly excluded.

>
> 3) Is their a different compiler plugin used by surefire?
>     If yes, this what how is it addressed, i.e. artifactId?
>     I have verified that the compiler configuration tags, like <source>
>     and <target> in the surefire plugin configuration are not passed
>     to the compiler plugin.  To me, this is a very minor issue.  I
>     just mentioned it to pass along what I have learned.

same artifact ID - to affect compilation the configuration must be on
maven-compiler-plugin.

Cheers,
Brett

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


Re: [m2] surefire not honoring

Posted by Paul Spencer <pa...@apache.org>.
Brett,
1) The current behavior allows abstract test classes to be compiled but
    NOT executed, which is good.  I currently use this functionality
    on other projects.

2) The exclude list form the compiler plugin is not honored by the
    surefire plugin relative compilation of the test source.  In my
    case the exclude list of the compiler plugin was the same as the
    exclude list for the surefire plugin.  All things considered, I am
    not sure if the surefire plugin should inherit the compiler's exclude
    list.

3) Is their a different compiler plugin used by surefire?
    If yes, this what how is it addressed, i.e. artifactId?
    I have verified that the compiler configuration tags, like <source>
    and <target> in the surefire plugin configuration are not passed
    to the compiler plugin.  To me, this is a very minor issue.  I
    just mentioned it to pass along what I have learned.

Paul Spencer

Brett Porter wrote:
> I've noticed this recently too. You can exclude sources from
> compilation in the compiler plugin (check the compiler plugin
> reference for the configuration item name).
> 
> Cheers,
> Brett
> 
> On 11/23/05, Paul Spencer <pa...@mindspring.com> wrote:
> 
>>I should further clarify "not honoring the <excludes>".  My expectation
>>was the exclusion applied to the compiler and test runner.  It appear to
>>apply to only the test runner.
>>So, is it correct the excluded test are compiled and not run?
>>
>>Is their a way to prevent a the compilation?
>>
>>Paul Spencer
>>
>>Paul Spencer wrote:
>>
>>>The surefire plugin is not honoring the <excludes>
>>>
>>>      <plugin>
>>>        <groupId>org.apache.maven.plugins</groupId>
>>>        <artifactId>maven-surefire-plugin</artifactId>
>>>        <configuration>
>>>          <fork>true</fork>
>>>          <includes>
>>>            <include>**/*TestCase.java</include>
>>>          </includes>
>>>          <excludes>
>>>            <exclude implementation="java.lang.String">
>>>               com/foo/util/**
>>>            </exclude>
>>>          </excludes>
>>>        </configuration>
>>>      </plugin>
>>>
>>>o The <exclude> is the same one used for the maven-compiler-plugin.
>>>o mvn -X does not list the exclusion of the test source, just the source
>>>  [DEBUG]   (f) excludes = [com/foo/util/**]
>>>
>>>Paul Spencer
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [m2] surefire not honoring

Posted by Brett Porter <br...@gmail.com>.
I've noticed this recently too. You can exclude sources from
compilation in the compiler plugin (check the compiler plugin
reference for the configuration item name).

Cheers,
Brett

On 11/23/05, Paul Spencer <pa...@mindspring.com> wrote:
> I should further clarify "not honoring the <excludes>".  My expectation
> was the exclusion applied to the compiler and test runner.  It appear to
> apply to only the test runner.
> So, is it correct the excluded test are compiled and not run?
>
> Is their a way to prevent a the compilation?
>
> Paul Spencer
>
> Paul Spencer wrote:
> > The surefire plugin is not honoring the <excludes>
> >
> >       <plugin>
> >         <groupId>org.apache.maven.plugins</groupId>
> >         <artifactId>maven-surefire-plugin</artifactId>
> >         <configuration>
> >           <fork>true</fork>
> >           <includes>
> >             <include>**/*TestCase.java</include>
> >           </includes>
> >           <excludes>
> >             <exclude implementation="java.lang.String">
> >                com/foo/util/**
> >             </exclude>
> >           </excludes>
> >         </configuration>
> >       </plugin>
> >
> > o The <exclude> is the same one used for the maven-compiler-plugin.
> > o mvn -X does not list the exclusion of the test source, just the source
> >   [DEBUG]   (f) excludes = [com/foo/util/**]
> >
> > Paul Spencer
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: [m2] surefire not honoring

Posted by Paul Spencer <pa...@mindspring.com>.
I should further clarify "not honoring the <excludes>".  My expectation 
was the exclusion applied to the compiler and test runner.  It appear to 
apply to only the test runner.
So, is it correct the excluded test are compiled and not run?

Is their a way to prevent a the compilation?

Paul Spencer

Paul Spencer wrote:
> The surefire plugin is not honoring the <excludes>
> 
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <fork>true</fork>
>           <includes>
>             <include>**/*TestCase.java</include>
>           </includes>
>           <excludes>
>             <exclude implementation="java.lang.String">
>                com/foo/util/**
>             </exclude>
>           </excludes>
>         </configuration>
>       </plugin>
> 
> o The <exclude> is the same one used for the maven-compiler-plugin.
> o mvn -X does not list the exclusion of the test source, just the source
>   [DEBUG]   (f) excludes = [com/foo/util/**]
> 
> Paul Spencer
> 
> ---------------------------------------------------------------------
> 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


Re: [m2] surefire not honoring

Posted by Paul Spencer <pa...@apache.org>.
Jesse,
I was trying to use <excludes> to exclude tests from compiling when 
converting my project from m1 to m2.  The <excludes> only affect what is 
executed, not compiled.

Paul Spencer


Jesse McConnell wrote:
> I was just poking through this code...and it was excluding all the right
> stuff for me :/
> 
> so for this setup below, you want all test cases that end in
> TestCase.javaexcept for those in the com/foo/util directory...right?
> and this is in
> src/test/java...
> 
> this doesn't add to the existing patterns to find tests, if you specify
> includes and excludes those are the only patterns used to find/exclude tests
> 
> jesse
> 
> On 11/22/05, Paul Spencer <pa...@apache.org> wrote:
> 
>>The surefire plugin is not honoring the <excludes>
>>
>><plugin>
>><groupId>org.apache.maven.plugins</groupId>
>><artifactId>maven-surefire-plugin</artifactId>
>><configuration>
>><fork>true</fork>
>><includes>
>><include>**/*TestCase.java</include>
>></includes>
>><excludes>
>><exclude implementation="java.lang.String">
>>com/foo/util/**
>></exclude>
>></excludes>
>></configuration>
>></plugin>
>>
>>o The <exclude> is the same one used for the maven-compiler-plugin.
>>o mvn -X does not list the exclusion of the test source, just the source
>>[DEBUG] (f) excludes = [com/foo/util/**]
>>
>>Paul Spencer
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> 
> --
> jesse mcconnell
> 


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


Re: [m2] surefire not honoring

Posted by Jesse McConnell <je...@gmail.com>.
I was just poking through this code...and it was excluding all the right
stuff for me :/

so for this setup below, you want all test cases that end in
TestCase.javaexcept for those in the com/foo/util directory...right?
and this is in
src/test/java...

this doesn't add to the existing patterns to find tests, if you specify
includes and excludes those are the only patterns used to find/exclude tests

jesse

On 11/22/05, Paul Spencer <pa...@apache.org> wrote:
>
> The surefire plugin is not honoring the <excludes>
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <fork>true</fork>
> <includes>
> <include>**/*TestCase.java</include>
> </includes>
> <excludes>
> <exclude implementation="java.lang.String">
> com/foo/util/**
> </exclude>
> </excludes>
> </configuration>
> </plugin>
>
> o The <exclude> is the same one used for the maven-compiler-plugin.
> o mvn -X does not list the exclusion of the test source, just the source
> [DEBUG] (f) excludes = [com/foo/util/**]
>
> Paul Spencer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
jesse mcconnell