Deploy test resource to Tomcat Server [message #1416491] |
Thu, 04 September 2014 15:29  |
Eclipse User |
|
|
|
I have a Maven war project that I can run in Eclipse by deploying it to a Tomcat server. This works fine for developing and debugging, but I also have a test.xml resource file that I would like to deploy to my webapp when I debug it. I do not want this test.xml file to end up in the final war though.
So:
1) If I put the test.xml file into src/main/webapp/WEB-INF, it is included in the war file and as a result is visible when debugging.
2) If I put the test.xml file into src/test/resources, or src/test/webapp/WEB-INF, it is not deployed to tomcat on debug, and therefore not visible.
Can this be done, or is there another way to go about this?
|
|
|
Re: Deploy test resource to Tomcat Server [message #1417265 is a reply to message #1416491] |
Thu, 04 September 2014 23:42   |
Eclipse User |
|
|
|
On 09/04/2014 04:13 PM, Mark Beierl wrote:
> I have a Maven war project that I can run in Eclipse by deploying it to
> a Tomcat server. This works fine for developing and debugging, but I
> also have a test.xml resource file that I would like to deploy to my
> webapp when I debug it. I do not want this test.xml file to end up in
> the final war though.
>
> So:
>
> 1) If I put the test.xml file into src/main/webapp/WEB-INF, it is
> included in the war file and as a result is visible when debugging.
> 2) If I put the test.xml file into src/test/resources, or
> src/test/webapp/WEB-INF, it is not deployed to tomcat on debug, and
> therefore not visible.
>
> Can this be done, or is there another way to go about this?
First, this is a question for the Eclipse Web Tools Platform forum,
however, let me see if I can confuse you more before you go there...
When I put such a file on a path such as src/test/resources/test.xml, I
do indeed see it when running Tomcat from within Eclipse. I would expect
to see it on a path very similar to:
<workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/<project>/resources/test.xml.
When the WAR is built, I would not expect to see it in the final product
unless you specifically ask for src/test/resources stuff to get put there.
I hope this helps.
|
|
|
Re: Deploy test resource to Tomcat Server [message #1417450 is a reply to message #1417265] |
Fri, 05 September 2014 09:06  |
Eclipse User |
|
|
|
Thanks, but it is not working that way for me:
src/main/webapp/WEB-INF/main.xml
src/test/resources/test.xml
ls eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/<app>:
META-INF/
WEB-INF/main.xml
-- no test.xml
If I put test.xml under src/test/webapp/WEB-INF/test.xml, same thing. It seems no matter what resources I put under src/test, they never end up in the deploy directory.
|
|
|
Powered by
FUDForum. Page generated in 0.08333 seconds