jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Slater <m...@analogsoftware.com>
Subject Re: Cactus plugin classpath for compilation
Date Sun, 06 Jun 2004 09:17:28 GMT
So I finally discovered maven's -X option and was able to track down  
the problem. Everything was working correctly in the script side, but  
my code was broken. It now compiles and tries to run JBoss.

The plugin is trying to start JBoss incorrectly though. I'm on MacOS X,  
so JBoss is started with run.sh. However, it appears from the Cactus  
source that it always uses run.bat to start JBoss:

integration/ant/src/scripts/j2ee13/build-tests-jboss3x.xml
integration/ant/src/java/org/apache/cactus/integration/ant/container/ 
jboss/JBoss3xContainer.java

Is it possible to redefine the "program.name" value in a properties  
file, or do I need to rebuild the plugin with the run.sh value instead?

Thanks,
Mark

On Jun 6, 2004, at 12:40 AM, Mark Slater wrote:

> I apologize if this is a double post... It's been 6 hours since I sent  
> it and I don't see it on the web site.
>
> Hi Vincent,
>
> Sorry for the confusion, I'm pretty new to this part of the world. So  
> I took your suggestions and moved my structure around, and it now  
> looks like this:
>
> /
> +-root/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
> +-EJB/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
>   +-src/
>     +-java/
>     | +-mycp/
>     |   +-MyBean.java
>     +-test-cactus/
>       +-mycp/
>         +-test/
>           +-MyBeanTest.java
> +-EAR/
>   +-project.xml
>   +-project.properties
>   +-maven.xml
>
> However, when I run the cactus:test-ear goal, in the EJB directory, I  
> still have the same class not found errors. Looking at what does  
> happen, I have this target directory structure:
>
> +EJB/target/
>   +-classes/
>   | +-META-INF/
>   | | +-ejb-jar.xml
>   | | +-jboss.xml
>   | | +-jbosscmp-jdbc.xml
>   | +-mycp/
>   |   +-My*.class (all classes related to the Bean)
>   +-test-cactus-classes/
>   +-test-cactus-reports/
>     +-jboss3x/
>   +-xdoclet/
>     +-ejbdoclet/
>       +-META-INF/
>       | +-ejb-jar.xml
>       | +-jboss.xml
>       | +-jbosscmp-jdbc.xml
>       +-mycp/
>         +-My*.java (all xdoclet generated classes from the Bean source)
>
> So it is running xdoclet and generating the .java files, and then  
> compiling them to the target/classes directory. But that's not being  
> added to the classpath for compiling the test-cactus/**/*Test.java  
> files and that step is failing.
>
> I printed out the classpath variables at the compile:cactus and they  
> are all still empty: ${cactus.classpath}, ${maven.classpath},  
> ${maven.ear.classpath}, ${maven.war.classpath}, ${classpath},  
> ${maven.dependency.classpath}
>
> Any suggestions?
>
> Thanks,
>
> Mark
>
>> 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:[EMAIL PROTECTED]
>> > Sent: 05 June 2004 02:38
>> > To: [EMAIL PROTECTED]
>> > 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
>>
>


Mime
View raw message