You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Ni...@arsoe-trelaze.com on 2004/07/20 10:50:17 UTC

Maven not include test resource in the test webapp

I have a project whitch build a jar artifact.

For this project I have junit test whitch includes some resources in the 
build/junit/resources section of my project.properties. This resources are 
in the junit section because i don't want them to be include in the jar 
finall artifact.

I have too some cactus test. It use a webapp in src/test/webapp. When I 
launch cactus test none of my junit resources are include in the 
WEB-INF/classes of the webapp.
I understand it is normal because junit resources are not include in the 
war artifact but in my case the webapp is some thing like a test webapp.

So is there a way to include build resources and test resources in the 
webapp during a cactus test ?
Or did I have to make an indepedant project for wy cactus test ?

Nicolas


RE: Maven not include test resource in the test webapp

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Nicolas,

> -----Original Message-----
> From: Nicolas.CHALUMEAU@arsoe-trelaze.com [mailto:Nicolas.CHALUMEAU@arsoe-
> trelaze.com]
> Sent: mardi 20 juillet 2004 10:50
> To: 'Cactus Users List'
> Subject: Maven not include test resource in the test webapp
> 
> I have a project whitch build a jar artifact.
> 
> For this project I have junit test whitch includes some resources in the
> build/junit/resources section of my project.properties. This resources are
> in the junit section because i don't want them to be include in the jar
> finall artifact.
> 
> I have too some cactus test. It use a webapp in src/test/webapp. When I
> launch cactus test none of my junit resources are include in the
> WEB-INF/classes of the webapp.

First, if your project produces a jar artifact, you need a separate project
to generate the runtime war. You would put the Cactus tests in this ar
project.

> I understand it is normal because junit resources are not include in the
> war artifact but in my case the webapp is some thing like a test webapp.
> 
> So is there a way to include build resources and test resources in the
> webapp during a cactus test ?
> Or did I have to make an indepedant project for wy cactus test ?

It's simply that we've not had this use case so far. I guess the Cactus
plugin could copy some resources. However, the resources that Cactus would
copy (during the cactifywar step) would need to be defined as properties
(and not in the POM as there's not way currently to extend the POM and I
think we shouldn't reuse the junit resources which are for pure JUnit
tests).

If you wish to provide a patch, I can apply it quickly. In any case, feel
free to open a JIRA issue for this (just not sure when I'll have time to
look at it as I'm going on holiday soon...).

Otherwise, you can use some custome pre/postGoal to include cactus resources
in the WAR/EAR.

Thanks
-Vincent

> 
> Nicolas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org