You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Ballard, Ken" <Ke...@ACS-INC.com> on 2005/07/21 19:36:37 UTC
EJB client jars
In Maven 1.0.2, I can create an EJB client jar by running ejb:ejb-client.
I'm left with a myproject-ejb-1.0-client.jar. But then when I run
ejb:install-client it uploads it to the repository as myproject-ejb-1.0.jar.
In the plugin.jelly for the ejb plugin, the ejb:install-client goal looks
like this:
<!--==================================================================-->
<!-- Install the ejb client in the local repository -->
<!--==================================================================-->
<goal name="ejb:install-client"
prereqs="ejb:ejb-client"
description="Install the ejb client in the local repository">
<artifact:install
artifact="${maven.ejb.build.dir}/${maven.final.name}-client.jar"
type="jar"
project="${pom}"/>
</goal>
Why don't I see the "-client" part of the file name in the repository? Also,
every once in a while I'll run a goal and it will create a "ejb-clients"
folder in my repository, but why isn't my client jar being installed there?
Then, once I have the client jar in the repository, how should I declare a
dependency on it in the project.xml? Like this:
<dependency>
<groupId>myproject</groupId>
<artifactId>myproject-ejb</artifactId>
<version>${pom.currentVersion}</version>
<properties>
<ejb.manifest.classpath>true</ejb.manifest.classpath>
<ear.bundle>true</ear.bundle>
<eclipse.dependency>true</eclipse.dependency>
</properties>
</dependency>
Would that work?
Thanks,
Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: EJB client jars
Posted by Dennis Geurts <de...@gmail.com>.
Hi Ken,
the thing is (AFAIK) as follows (others: please correct me if i'm wrong):
If you run ejb:ejb in the target-directory the 'final.name.jar' is created
that contains *all* classes.
however, if you run ejb:ejb-client, the client jar is created that only
contains the (local and) remote interfaces,
which is all you need as a client user (right ??)
So as another project that depends on this project you only need the client
interfaces !
This is therefore the jar that ends up in the
repository/${projectId}/jars/${projectId}-${version}.jar
(by means of the install-goal)
in the project target-directory, a distinction needs to be made between the
jar that contains all classes ${artifactID}-${version}.jar
and the one that only contains the interfaces ${artifactID}-${version}-
client.jar.
the EJB -jar that contains ALL classes is during the install nicely copied
to repository/${projectId}/*ejbs*/${projectId}-${version}.jar
so to wrap it up:
if you're only interested in the client interfaces (happens most of the
time)
you add the dependency:
<projectId>projectId</projectId>
<artifactId>artifactId</artifactId>
<version>version</version>
*<type>jar</type>*
If you really need the ejb as dependency (which possibly is not a good
idea)
you add the dependency:
<projectId>projectId</projectId>
<artifactId>artifactId</artifactId>
<version>version</version>
*<type>ejb</type>*
<jar>artifactId-version.jar</jar> <-- i don't really know if this is
neccessary
Hope this all is true...
Dennis
On 7/21/05, Ballard, Ken <Ke...@acs-inc.com> wrote:
>
> In Maven 1.0.2, I can create an EJB client jar by running ejb:ejb-client.
> I'm left with a myproject-ejb-1.0-client.jar. But then when I run
> ejb:install-client it uploads it to the repository as
> myproject-ejb-1.0.jar.
> In the plugin.jelly for the ejb plugin, the ejb:install-client goal looks
> like this:
>
> <!--==================================================================-->
> <!-- Install the ejb client in the local repository -->
> <!--==================================================================-->
>
> <goal name="ejb:install-client"
> prereqs="ejb:ejb-client"
> description="Install the ejb client in the local repository">
>
> <artifact:install
> artifact="${maven.ejb.build.dir}/${maven.final.name<http://maven.final.name>
> }-client.jar"
> type="jar"
> project="${pom}"/>
>
> </goal>
>
> Why don't I see the "-client" part of the file name in the repository?
> Also,
> every once in a while I'll run a goal and it will create a "ejb-clients"
> folder in my repository, but why isn't my client jar being installed
> there?
> Then, once I have the client jar in the repository, how should I declare a
> dependency on it in the project.xml? Like this:
>
> <dependency>
> <groupId>myproject</groupId>
> <artifactId>myproject-ejb</artifactId>
> <version>${pom.currentVersion}</version>
> <properties>
> <ejb.manifest.classpath>true</ejb.manifest.classpath>
> <ear.bundle>true</ear.bundle>
> <eclipse.dependency>true</eclipse.dependency>
> </properties>
> </dependency>
>
> Would that work?
>
> Thanks,
> Ken
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>