You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "vychtrle (JIRA)" <ji...@codehaus.org> on 2010/12/19 17:18:57 UTC

[jira] Created: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250412#action_250412 ] 

Kristian Rosenvold commented on SUREFIRE-667:
---------------------------------------------

The common way this problem is handled is by making a maven-plugin that handles the starting the container environment. Such a plugin runs in its own classloader, and can use configuration/classpath that is totally separate from the module being built.

This would normally mean the module itself (the portlet) will not have direct dependencies to the container environment, and this would normally avoid most of the problems you describe. There are a *lot* of different examples of this, for instance weblogic-maven-plugin, weblogic-jetty-plugin or some of the cargo stuff.

I do not know if Liferay has/uses a plugin of its own or can use plugins for the underlying container. In combination with failsafe it should be fairly easy to fix. If you need to adapt one of the existing plugins to make it work with Liferay, that should also be fairly simple and could probably be contributed back to Liferay.

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250499#action_250499 ] 

lisak commented on SUREFIRE-667:
--------------------------------

The resources (spring configs mainly) in Liferay plugins are being loaded very traditionally within containers. From container's web application context webapps/APP/WEB-INF/classes/META-INF/spring-stuff.xml ... Liferay portal is webapp depending on a standard jar having META-INF/spring-stuff.xml inside .... I really don't see what is wrong with it. It is actually very convenience as far as I know. You know, Liferay is build with Ant, and there appears to be an effort lastly to slowly migrate to maven. So far there is a possibility to use it for plugins development, but still using Ant is considered the default and it works very well. I prefer maven and the guy who maintains Maven stuff in Liferay isn't very communicative, I sent him some patches a month ago and I didn't even get response back.  

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=252618#action_252618 ] 

Kristian Rosenvold commented on SUREFIRE-667:
---------------------------------------------

Please submit a minimal test project using Liferay (or any other relevant technology) that demonstrate why this feature is necessary.

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250391#action_250391 ] 

lisak commented on SUREFIRE-667:
--------------------------------

the main problem is :  naming conflict on the classpath :  project[ target/classes/META-INF/spring-hibernate-stuff.xml ] & dependency[ META-INF/spring-hibernate-stuff.xml ]   

- In general terms, what If I needed resources of this dependency for testing purposes, but I had them also in project[ target/classes ] ? For example in Liferay portal,  Portal portlet and plugin portlet use different classloaders in container, but when testing I can use only one classloader ... and portal portlet (dependency) must be loaded up prior plugin portlet .... both have the same directory structure .... 

I can simulate the container environment perfectly except one thing....I need to load up (initialize) the dependency first,  BUT my plugin's/projects META-INF is on the claspath prior to dependency's META-INF and I can't do anything about it except of really UGLY workarounds....

and because it should be a Liferay archetype that would be used be a lot of people, it's kinda important for me 

possibility to modify /src/main/resources in <testResources> would be a fix that should be done by somebody who can see the consequences...

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250485#action_250485 ] 

Kristian Rosenvold commented on SUREFIRE-667:
---------------------------------------------

It seems to me like these problems also arise due to overuse of wildcard scanning of the classpath. A lot of people consider wildcard scanning to be a significant antipattern in for instance spring configuration. If Liferay does this by default I'd recommend filing an issue on Liferay too.


> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250416#action_250416 ] 

lisak commented on SUREFIRE-667:
--------------------------------

Thank you Kristian, 

it is totally container irrelevant issue. It's just about initialization of spring application contexts. The MAIN just must be initialized first. 

It's like Container.initSpring(MAIN) and then Container.initSpring(plugin)

In test environment I just call Initializer.init(MAIN) and then Initializer.init(plugin)

And as I have MAIN as a dependency, it's all very easy to arrange, except the one thingy :-)

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250359#action_250359 ] 

lisak commented on SUREFIRE-667:
--------------------------------

Yeah, I also needed surefire-plugin to do this many times. It often can be done differently in some way or another but it complicates things ..

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Updated: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold updated SUREFIRE-667:
----------------------------------------

    Component/s: Maven Surefire Plugin

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=252632#action_252632 ] 

lisak commented on SUREFIRE-667:
--------------------------------

Here is a blog post about the archetype, the last paragraph explains it...

http://liferayblog.appspot.com/blog/liferay-spring-plugin-with-unit-testing-support

and it can be checked out here : https://github.com/l15k4/liferay-spring-plugin-with-unit-testing-support

It is not finished (working) due to 2 facts, 
  they are doing tool, that generates maven dependencies (definitions) based on list of jars that liferay is using. There is more then hundreds of them, so it doesn't make sense to hardcode them into pom.xml but generate them (versions mainly) based on Liferay version. 
  
  and this resources issue I'm dealing with ...

if these two issues were gone, it'd would be ready for use

> 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
>          Components: Maven Surefire Plugin
>    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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249064#action_249064 ] 

Kristian Rosenvold commented on SUREFIRE-667:
---------------------------------------------

Your issue describes only a solution without describing the actual use-case or the problem you are trying to solve, and provides little explanation as to why this issue should be solved; especially since most people seem to get along fine without it.

Please add  far more information about the use-case and possibly maybe also a suggestion of why this is the appropriate way to fix this issue.



> 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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "vychtrle (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249247#action_249247 ] 

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

I just wanted to say, that defining "src/main/*" in <testResources> should be allowed because it would help a lot in various use cases that developers usually work around.  

> 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

        

[jira] Commented: (SUREFIRE-667) Setting up maven resources when testing in addition to testResources

Posted by "vychtrle (JIRA)" <ji...@codehaus.org>.
    [ 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