[ 
http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249077#action_249077
 ] 

vychtrle commented on SUREFIRE-667:
-----------------------------------

Hi Kristian,

When testing, I want to exclude some src/main/resources because :

I need to use resources from project dependencies (different ones, but
same directory structure and names as some src/main/resources ), which happens
quite often to me especially when testing.
... And since the target/classes resources are loaded before dependencies -> 
...they are loaded first....

Sometimes the fact that target/test-classes are loaded before target/classes
isn't enough. Let say that I have 20
spring-context files in META-INF (but only 10 is used for testing) loaded from 
the application.
I can't say grab all *.xml in META-INF and load spring beans when testing, 
because it
would load beans from all those 20 files instead of 10. As a result I have to 
hardcode 
their names and everytime I make a change I have to change the code.

There are tons of such scenarios... No, it is not critical feature, but it 
means a lot of
setting and workarounds...

 If it is a huge project, more than 700 spring beans in various contexts, tons 
of configuration etc., absence of such a feature can hurt a lot 



> Setting up maven resources when testing in addition to testResources
> --------------------------------------------------------------------
>
>                 Key: SUREFIRE-667
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-667
>             Project: Maven Surefire
>          Issue Type: New Feature
>    Affects Versions: 2.6
>            Reporter: vychtrle
>
> Hey,
> I think that developers would need resource goal of resource plugin to be set 
> up differently for
> test phase, than for build phase. When testing one needs to exclude stuff
> from src/main/resources. It seems it can't be done, testResources goal
> is irrelevant for this because it can't operate on src/main/* and resource 
> goal can have only one
> setting in pom definition, that takes effect in both test and build
> phase...
> For example, I'd need following settings to look differently (some
> excludes) in testing phase :
>                <resources>
>                  <resource>
>                    <directory>${project.basedir}/src/main/java</directory>
>                    <includes>
>                        <include>**/*.java</include>
>                        <include>service.properties</include>
>                    </includes>
>                  </resource>
>                  <resource>
>                    
> <directory>${project.basedir}/src/main/resources</directory>
>                    <includes>
>                        <include>**/*.xml</include>
>                        <include>**/*.properties</include>
>                    </includes>
>                  </resource>
>                </resources>
> The ideal behavior would be if one could define "src/main/*" in
> <testResources> but it unfortunately can't be done right now

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to