Hi,

Is it possible to create a valid ear file within ejb project using
maven-ear-plugin? If so - how to configure it?

I need to be able to assemble an ear file containing my ejb build artifact
to be able to run unit-tests tests on the ejbs.

Currently this is what I have in my pom.xml:

(...)
<plugin>
        <artifactId>maven-ejb-plugin</artifactId>
        <executions>
                <execution>
                        <phase>test-compile</phase>
                        <goals>
                                <goal>ejb</goal>
                        </goals>
                        <configuration>
                                <generateClient>false</generateClient>
                                <archive>
                                        <manifest>
<addClasspath>true</addClasspath>
                                        </manifest>
                                </archive>
                        </configuration>
                </execution>
        </executions>
</plugin>
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <executions>
                <execution>
                        <phase>test-compile</phase>
                        <goals>
                                <goal>generate-application-xml</goal>
                                <goal>ear</goal>
                        </goals>
                        <configuration>
                        </configuration>
                </execution>
        </executions>
</plugin>
(...)

This _almost_ works. I mean it creates a dodgy ear file that has no ejb jar,
but unpacked classes instead (why would anybody need that? - bug?). Is there
any way to configure the ear plugin to somehow pick up the ejb jar built by
ejb plugin?

The ejb jar is not installed in the repo yet (and won't be until the tests
are run).

I could hack the ear plugin to force it do what needs to be done, but this
seems to be such a terrible idea that I thought I will ask someone. The
other (equally terrible) idea is to plug an Ant task that would repackage
the ear at the very end, but I might as well ditch Maven and go back to Ant.

Please help! I am pulling my hair out of my head.

Maciej Mastalarczuk


PS. And frankly - is anybody at all using Maven 2 to build EJBs? I mean real
ones, no "HelloWorld" stuff. And if so - how do you do the testing? (or you
don't :-))

What was a piece of cake with Ant seems to be absolutely impossible task
with Maven.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to