You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Slater <ma...@analogsoftware.com> on 2004/06/05 02:38:03 UTC

Cactus plugin classpath for compilation

I've got a multiproject-based Maven setup. Currently, there's only one EJB 
(more coming after I get all the build kinks like this one ironed out), 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

I may be misunderstanding how/where to put and run the cactus tests... my 
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. 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 find the 
EJB's jar file, even though I have it configured as a dependency in EAR/
project.xml.

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 the local 
repository), or is there a way to get cactus to create a correct EAR file for 
testing as a goal of the EJB project and still have the "normal" goal create 
the standard EJB jar file?

Thanks!

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Cactus plugin classpath for compilation

Posted by Vincent Massol <vm...@pivolis.com>.
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
EJB
> (more coming after I get all the build kinks like this one ironed
out),
> 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
project.

> 
> I may be misunderstanding how/where to put and run the cactus tests...
my
> 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
find
> the
> EJB's jar file, even though I have it configured as a dependency in
EAR/
> 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
the
> local
> repository), or is there a way to get cactus to create a correct EAR
file
> 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).

Thanks
-Vincent


RE: Cactus plugin classpath for compilation

Posted by Vincent Massol <vm...@pivolis.com>.
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
EJB
> (more coming after I get all the build kinks like this one ironed
out),
> 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
project.

> 
> I may be misunderstanding how/where to put and run the cactus tests...
my
> 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
find
> the
> EJB's jar file, even though I have it configured as a dependency in
EAR/
> 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
the
> local
> repository), or is there a way to get cactus to create a correct EAR
file
> 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).

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org