jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: Cactus plugin classpath for compilation
Date Sat, 05 Jun 2004 10:21:41 GMT
Hi Mark,

The cactus plugin for Maven is actually hosted by the Cactus project.
Thus all discussions happen there.
See below.

> -----Original Message-----
> From: Mark Slater [mailto:mark@analogsoftware.com]
> Sent: 05 June 2004 02:38
> To: users@maven.apache.org
> Subject: Cactus plugin classpath for compilation
> I've got a multiproject-based Maven setup. Currently, there's only one
> (more coming after I get all the build kinks like this one ironed
> and
> that gets built into an EAR.
> /
> +-root/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
> +-EJB/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
>   +-src/
>     +-java/
>       +-mycp/
>         +-MyBean.java
> +-EAR/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
>   +-src/
>     +-test-cactus/
>       +-mycp/
>         +-test/
>           +-MyBeanTest.java

That would be a good structure. However the current version of the
Cactus plugin for Maven does not support running the Cactus plugin at
the level of the EAR project (we need to add support for this). Thus
ATM, you need to run the cactus:test-ear goal at the level of the EJB

> I may be misunderstanding how/where to put and run the cactus tests...
> first inclination was to put it in the EJB folder next to the Bean
> implementation. However, that project's goal is a .jar file (with the
> EJB), so
> I can't build an EAR there also. 

True but that's not supported yet.

> But when I run "maven cactus:test-ear" in
> the
> EAR/ directory, or "maven multiproject:site" in the / directory (which
> runs
> the cactus:test-ear goal in the EAR/ directory), javac is unable to
> the
> EJB's jar file, even though I have it configured as a dependency in
> project.xml.

Just make sure you have a src/webapp/WEB-INF/web.xml file in your EJB
project tree (the Cactus requires a war file and at this current it is
not yet able to create a default one all by itself).

When you call cactus:test-ear, the Cactus plugin will then create a WAR
containing your Cactus tests (the creation of the WAR currently requires
a web.xml file - we should actually create one if none exists). Then it
will compile your EJB and package the whole thing in an EAR.

> I've got a preGoal on cactus:compile that echos a bunch of classpaths,
> which
> are all empty: ${cactus.classpath}, ${maven.classpath},
> ${maven.ear.classpath}, ${maven.war.classpath}, ${classpath},
> ${maven.dependency.classpath}
> Is there a way I can explicitly add the EJB's jar file (which is in
> local
> repository), or is there a way to get cactus to create a correct EAR
> for
> testing as a goal of the EJB project and still have the "normal" goal
> create
> the standard EJB jar file?
> Thanks!

Feel free to send some patch if you want it to work the way you
described (and/or open some JIRA issues).


View raw message