Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Deploy test resource to Tomcat Server
Deploy test resource to Tomcat Server [message #1416491] Thu, 04 September 2014 19:29 Go to next message
Mark Beierl is currently offline Mark BeierlFriend
Messages: 3
Registered: September 2014
Junior Member
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] Fri, 05 September 2014 03:42 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 13:06 Go to previous message
Mark Beierl is currently offline Mark BeierlFriend
Messages: 3
Registered: September 2014
Junior Member
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.
Previous Topic:Error Trying to Run JUnit Tests
Next Topic:Confused about Eclipse Indigo
Goto Forum:
  


Current Time: Tue Oct 22 18:54:16 GMT 2019

Powered by FUDForum. Page generated in 0.02974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top