On Thu, 10 Nov 2005, Pablo wrote:

Hi,

AFAIK the WEB-INF/web.xml is not needed in the classpath - only the
servlet container uses it. However, usually the struts-config.xml etc.
are also placed in the WEB-INF/ directory, and they need to be in the
classpath.

A simple solution is NOT to place the struts-config.xml etc. in the
WEB-INF/ directory, but in a place that is automatically added to the
classpath.

You can accomplish that by placing those .xml files in src/main/resources/
(and/or src/test/resources for tests).

That should fix it.

-- Kenney


> Hi there
>
> I have a problem with running my junit tests based on StrutsTestCase
> (run by surefire:test) for my web application and reported it in
> Maven-users mailing list.
> One of solutions I was given was to report the problem to this list.
>
> A short description:
> I've got a few tests based on StrutsTestCase. StrutsTestCase requires
> that /WEB-INF/web.xml file was in a classpath.
> Therefore I need a way to include the directory /WEB-INF in the classpath.
> I tried to options:
> 1) Tried to change a parameter in surefire:test called
> classpathElements. As name suggests I could add a classpath so the
> directory /WEB-INF would be visible for StrutsTestCase.
> However this parameter is read-only. At least maven claims so.
>
> Then I thought about the second option to set <testResources>
> Even though /WEB-INF was copied to target/test-classes directory, I got
> other errors like ClassNotFound and it didn't halp at all.
>
> The question I have is what should I do to run these tests without problems?
> I was suggested to file a request for an "additionalClasspathElements"
> field for the plugin. Does any body have a different solution?
>
> Cheers
> Pablo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to