You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "David H. DeWolf" <dd...@apache.org> on 2005/07/15 04:03:41 UTC
[M2] Mix between Provided and Test Scopes
I'm attempting to utilize the servlet api within some mock tests (in
addition to needing it to compile my main source). I have attempted to
mark the scope of the servlet api in the following manners:
1) Provided Scope
2) Test Scope
3) Two Separate Dependencies of Provided Scope AND Test Scope
And none of these seem to work. When the scope is 'provided', the tests
throw a class not found exception. When the scope is 'test' the main
source fails to compile. When I attempt to use both, it appears as
though the second dependency is ignored.
Has anyone else encountered this and found a work around?
Thanks,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M2] Mix between Provided and Test Scopes
Posted by Dennis Geurts <de...@gmail.com>.
Hi David,
I encountered the same problem a while ago.
The following was suggested:
'The workaround is to split your war files and your sources. Put all your
java sources in an other project and add them in the new jar dep of your
war.'
So, make a multi module project, one 'jar-project' containing all classes
( servletapi in compile scope )
and a 'war-project' that depends on the 'jar-project' ( runtime scope )
the tests are then run while installing the 'jar-project'
and the war-project will automatically package the 'jar-project.jar'
Dennis
On 7/15/05, Kenney Westerhof <fo...@neonics.com> wrote:
>
> On Thu, 14 Jul 2005, David H. DeWolf wrote:
>
> What you could do is depend on a pom, <scope>test</scope>,
> that itself depends on the servlet api.
>
> -- Kenney
>
> > I'm attempting to utilize the servlet api within some mock tests (in
> > addition to needing it to compile my main source). I have attempted to
> > mark the scope of the servlet api in the following manners:
> >
> > 1) Provided Scope
> > 2) Test Scope
> > 3) Two Separate Dependencies of Provided Scope AND Test Scope
> >
> > And none of these seem to work. When the scope is 'provided', the tests
> > throw a class not found exception. When the scope is 'test' the main
> > source fails to compile. When I attempt to use both, it appears as
> > though the second dependency is ignored.
> >
> > Has anyone else encountered this and found a work around?
> >
> > Thanks,
> >
> > David
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: [M2] Mix between Provided and Test Scopes
Posted by Kenney Westerhof <fo...@neonics.com>.
On Thu, 14 Jul 2005, David H. DeWolf wrote:
What you could do is depend on a pom, <scope>test</scope>,
that itself depends on the servlet api.
-- Kenney
> I'm attempting to utilize the servlet api within some mock tests (in
> addition to needing it to compile my main source). I have attempted to
> mark the scope of the servlet api in the following manners:
>
> 1) Provided Scope
> 2) Test Scope
> 3) Two Separate Dependencies of Provided Scope AND Test Scope
>
> And none of these seem to work. When the scope is 'provided', the tests
> throw a class not found exception. When the scope is 'test' the main
> source fails to compile. When I attempt to use both, it appears as
> though the second dependency is ignored.
>
> Has anyone else encountered this and found a work around?
>
> Thanks,
>
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org