Test Resources being deployed in Tomcat for Web App

76 views
Skip to first unread message

Dre

unread,
Sep 17, 2010, 6:12:48 PM9/17/10
to Q for Eclipse users list
Hi,

Not sure if this is by design, but I'm seeing my test resources be
deployed to Tomcat when I'm trying to test my web application. Is this
by design?

i.e.

- I have a pom.xml which is defined as 'packaging' war. Doesn't have
anything special other than dependencies.
- I have in src/main/resources/X.properties
- I have in src/test/resources/Y.properties

When I 'Run On Server' in Eclipse and deploy to Tomcat, if I go to the
tmp directory Eclipse creates for running my web app, I see
Y.properties. My web app doesn't run fully with Y.properties.

Is this somehow by design? My test resources are for my unit tests to
run, but when I package the web app I want it to run with the
resources from 'main'.

If this is by design, then I'll have to think how to work around it.
If it's not, then I can dig further to try to reproduce.

Thanks,

Dre

car...@apache.org

unread,
Sep 17, 2010, 6:45:51 PM9/17/10
to Q for Eclipse users list
the problem is that Eclipse doesn't differentiate test resources from
main resources, so when you launch it in Eclipse it will package both
of them.

Dre

unread,
Sep 17, 2010, 8:19:46 PM9/17/10
to Q for Eclipse users list
Hmmm... so is there a work around for this? That seems like a pretty
typical use case I would think. I want to run my unit tests in Eclipse
for debugging so I need the test config, but I don't want Eclipse to
deploy the resources when creating the web app.

car...@apache.org

unread,
Sep 18, 2010, 1:42:36 PM9/18/10
to Q for Eclipse users list
you have to manage no to use the test resources on your webapp.
Not much else that can be done without Eclipse support
Reply all
Reply to author
Forward
0 new messages