You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Markus KARG <ma...@quipsy.de> on 2006/09/14 11:22:58 UTC

EJB Client JAR

Using Maven2's ejb package, I was able to create an ejb-jar from my sources.
But not I want Maven to create an "EJB Client JAR", that only contains 
the interfaces, and make another JAR dependent of that "EJB Client JAR" 
(by means of Class-Path: entry in MANIFEST.MF).

How to do that?

Re: EJB Client JAR

Posted by Markus KARG <ma...@quipsy.de>.
Thanks a lot for this link, in fact I have learned from it that it is 
possible (a) to create EJB3 compliant JARs (b) to not only specify 
excludes but also includes.

Markus

Markku Saarela schrieb:

> And you can config this ejb client jar with |clientExcludes parameter 
> in |maven-ejb-plugin as documented here: 
> http://maven.apache.org/plugins/maven-ejb-plugin/ejb-mojo.html
>
> Regards,
>
> Markku
>
> Markus KARG wrote:
>
>> Markku,
>>
>> thanks a lot for your kind help!
>>
>> We will try out tomorrow!
>>
>> Thanks a lot
>> Markus
>>
>> Markku Saarela wrote:
>>  
>>
>>> Configure you ejb plugin like this:
>>>
>>>  <build>
>>>    <plugins>
>>>      <plugin>
>>>        <artifactId>maven-ejb-plugin</artifactId>
>>>        <inherited>true</inherited>
>>>        <configuration>
>>>          <archive>
>>>            <manifest>
>>>              <addClasspath>true</addClasspath>
>>>            </manifest>
>>>          </archive>
>>>          <generateClient>true</generateClient>
>>>        </configuration>
>>>      </plugin>
>>>    </plugins>
>>>  </build>
>>>
>>> then in you module where you have dependency of this ejb client jar :
>>>
>>>  <dependencies>
>>>    <dependency>
>>>      <groupId>your_group_id</groupId>
>>>      <artifactId>dbserviceejb</artifactId>
>>>      <version>${version}</version>
>>>      <type>ejb-client</type>
>>>    </dependency>
>>>  </dependencies>
>>>
>>> regards,
>>>
>>> Markku
>>>
>>>
>>> Markus KARG wrote:
>>>    
>>>
>>>> Actually I don't want to do that but I want to know and do the
>>>> maven-ejb-plugin way.
>>>>
>>>> Nevertheless,
>>>> thanks a lot!
>>>>
>>>> Markus
>>>>
>>>> Daryl.Dwyer@tdameritrade.com schrieb:
>>>>
>>>>      
>>>>
>>>>> Not necessarily the maven-ejb-plugin way, but you can create a 
>>>>> separate
>>>>> module for the EJB client and then add a compile dependency on the 
>>>>> that
>>>>> project in your EJB project's pom.  We did this to get around the 
>>>>> fact
>>>>> that using the generateClient option on the maven-ejb-plugin
>>>>> generates a
>>>>> pom for the client with way too many dependencies (includes all of 
>>>>> the
>>>>> EJBs dependencies) and so that we could compile the EJB in 1.5 but
>>>>> compile the client under 1.4.
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Markus KARG [mailto:markus.karg@quipsy.de] Sent: Thursday,
>>>>> September 14, 2006 4:23 AM
>>>>> To: Maven Users List
>>>>> Subject: EJB Client JAR
>>>>>
>>>>> Using Maven2's ejb package, I was able to create an ejb-jar from my
>>>>> sources.
>>>>> But not I want Maven to create an "EJB Client JAR", that only 
>>>>> contains
>>>>> the interfaces, and make another JAR dependent of that "EJB Client
>>>>> JAR" (by means of Class-Path: entry in MANIFEST.MF).
>>>>>
>>>>> How to do that?
>>>>>  
>>>>>
>>>>>         
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>     
>>
>>
>>   
>
>
>


Re: EJB Client JAR

Posted by Markku Saarela <ma...@kolumbus.fi>.
And you can config this ejb client jar with |clientExcludes parameter in 
|maven-ejb-plugin as documented here: 
http://maven.apache.org/plugins/maven-ejb-plugin/ejb-mojo.html

Regards,

Markku

Markus KARG wrote:
> Markku,
>
> thanks a lot for your kind help!
>
> We will try out tomorrow!
>
> Thanks a lot
> Markus
>
> Markku Saarela wrote:
>   
>> Configure you ejb plugin like this:
>>
>>  <build>
>>    <plugins>
>>      <plugin>
>>        <artifactId>maven-ejb-plugin</artifactId>
>>        <inherited>true</inherited>
>>        <configuration>
>>          <archive>
>>            <manifest>
>>              <addClasspath>true</addClasspath>
>>            </manifest>
>>          </archive>
>>          <generateClient>true</generateClient>
>>        </configuration>
>>      </plugin>
>>    </plugins>
>>  </build>
>>
>> then in you module where you have dependency of this ejb client jar :
>>
>>  <dependencies>
>>    <dependency>
>>      <groupId>your_group_id</groupId>
>>      <artifactId>dbserviceejb</artifactId>
>>      <version>${version}</version>
>>      <type>ejb-client</type>
>>    </dependency>
>>  </dependencies>
>>
>> regards,
>>
>> Markku
>>
>>
>> Markus KARG wrote:
>>     
>>> Actually I don't want to do that but I want to know and do the
>>> maven-ejb-plugin way.
>>>
>>> Nevertheless,
>>> thanks a lot!
>>>
>>> Markus
>>>
>>> Daryl.Dwyer@tdameritrade.com schrieb:
>>>
>>>       
>>>> Not necessarily the maven-ejb-plugin way, but you can create a separate
>>>> module for the EJB client and then add a compile dependency on the that
>>>> project in your EJB project's pom.  We did this to get around the fact
>>>> that using the generateClient option on the maven-ejb-plugin
>>>> generates a
>>>> pom for the client with way too many dependencies (includes all of the
>>>> EJBs dependencies) and so that we could compile the EJB in 1.5 but
>>>> compile the client under 1.4.
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Markus KARG [mailto:markus.karg@quipsy.de] Sent: Thursday,
>>>> September 14, 2006 4:23 AM
>>>> To: Maven Users List
>>>> Subject: EJB Client JAR
>>>>
>>>> Using Maven2's ejb package, I was able to create an ejb-jar from my
>>>> sources.
>>>> But not I want Maven to create an "EJB Client JAR", that only contains
>>>> the interfaces, and make another JAR dependent of that "EJB Client
>>>> JAR" (by means of Class-Path: entry in MANIFEST.MF).
>>>>
>>>> How to do that?
>>>>  
>>>>
>>>>         
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>   


Re: EJB Client JAR

Posted by Markus KARG <ma...@gmx.net>.
Markku,

thanks a lot for your kind help!

We will try out tomorrow!

Thanks a lot
Markus

Markku Saarela wrote:
> Configure you ejb plugin like this:
>
>  <build>
>    <plugins>
>      <plugin>
>        <artifactId>maven-ejb-plugin</artifactId>
>        <inherited>true</inherited>
>        <configuration>
>          <archive>
>            <manifest>
>              <addClasspath>true</addClasspath>
>            </manifest>
>          </archive>
>          <generateClient>true</generateClient>
>        </configuration>
>      </plugin>
>    </plugins>
>  </build>
>
> then in you module where you have dependency of this ejb client jar :
>
>  <dependencies>
>    <dependency>
>      <groupId>your_group_id</groupId>
>      <artifactId>dbserviceejb</artifactId>
>      <version>${version}</version>
>      <type>ejb-client</type>
>    </dependency>
>  </dependencies>
>
> regards,
>
> Markku
>
>
> Markus KARG wrote:
>> Actually I don't want to do that but I want to know and do the
>> maven-ejb-plugin way.
>>
>> Nevertheless,
>> thanks a lot!
>>
>> Markus
>>
>> Daryl.Dwyer@tdameritrade.com schrieb:
>>
>>> Not necessarily the maven-ejb-plugin way, but you can create a separate
>>> module for the EJB client and then add a compile dependency on the that
>>> project in your EJB project's pom.  We did this to get around the fact
>>> that using the generateClient option on the maven-ejb-plugin
>>> generates a
>>> pom for the client with way too many dependencies (includes all of the
>>> EJBs dependencies) and so that we could compile the EJB in 1.5 but
>>> compile the client under 1.4.
>>>
>>>
>>> -----Original Message-----
>>> From: Markus KARG [mailto:markus.karg@quipsy.de] Sent: Thursday,
>>> September 14, 2006 4:23 AM
>>> To: Maven Users List
>>> Subject: EJB Client JAR
>>>
>>> Using Maven2's ejb package, I was able to create an ejb-jar from my
>>> sources.
>>> But not I want Maven to create an "EJB Client JAR", that only contains
>>> the interfaces, and make another JAR dependent of that "EJB Client
>>> JAR" (by means of Class-Path: entry in MANIFEST.MF).
>>>
>>> How to do that?
>>>  
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


Re: EJB Client JAR

Posted by Markku Saarela <ma...@kolumbus.fi>.
Configure you ejb plugin like this:

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-ejb-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
          <generateClient>true</generateClient>
        </configuration>
      </plugin>
    </plugins>
  </build>

then in you module where you have dependency of this ejb client jar :

  <dependencies>
    <dependency>
      <groupId>your_group_id</groupId>
      <artifactId>dbserviceejb</artifactId>
      <version>${version}</version>
      <type>ejb-client</type>
    </dependency>
  </dependencies>

regards,

Markku


Markus KARG wrote:
> Actually I don't want to do that but I want to know and do the 
> maven-ejb-plugin way.
>
> Nevertheless,
> thanks a lot!
>
> Markus
>
> Daryl.Dwyer@tdameritrade.com schrieb:
>
>> Not necessarily the maven-ejb-plugin way, but you can create a separate
>> module for the EJB client and then add a compile dependency on the that
>> project in your EJB project's pom.  We did this to get around the fact
>> that using the generateClient option on the maven-ejb-plugin generates a
>> pom for the client with way too many dependencies (includes all of the
>> EJBs dependencies) and so that we could compile the EJB in 1.5 but
>> compile the client under 1.4.
>>
>>
>> -----Original Message-----
>> From: Markus KARG [mailto:markus.karg@quipsy.de] Sent: Thursday, 
>> September 14, 2006 4:23 AM
>> To: Maven Users List
>> Subject: EJB Client JAR
>>
>> Using Maven2's ejb package, I was able to create an ejb-jar from my
>> sources.
>> But not I want Maven to create an "EJB Client JAR", that only contains
>> the interfaces, and make another JAR dependent of that "EJB Client 
>> JAR" (by means of Class-Path: entry in MANIFEST.MF).
>>
>> How to do that?
>>  
>>
>


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


Re: EJB Client JAR

Posted by Markus KARG <ma...@quipsy.de>.
Actually I don't want to do that but I want to know and do the 
maven-ejb-plugin way.

Nevertheless,
thanks a lot!

Markus

Daryl.Dwyer@tdameritrade.com schrieb:

>Not necessarily the maven-ejb-plugin way, but you can create a separate
>module for the EJB client and then add a compile dependency on the that
>project in your EJB project's pom.  We did this to get around the fact
>that using the generateClient option on the maven-ejb-plugin generates a
>pom for the client with way too many dependencies (includes all of the
>EJBs dependencies) and so that we could compile the EJB in 1.5 but
>compile the client under 1.4.
> 
>
>-----Original Message-----
>From: Markus KARG [mailto:markus.karg@quipsy.de] 
>Sent: Thursday, September 14, 2006 4:23 AM
>To: Maven Users List
>Subject: EJB Client JAR
>
>Using Maven2's ejb package, I was able to create an ejb-jar from my
>sources.
>But not I want Maven to create an "EJB Client JAR", that only contains
>the interfaces, and make another JAR dependent of that "EJB Client JAR" 
>(by means of Class-Path: entry in MANIFEST.MF).
>
>How to do that?
>  
>


Re: EJB Client JAR

Posted by Markus KARG <ma...@quipsy.de>.
I am not sure whether this is the only benefit, maybe in will understand 
it completely once I have more experience with it it looked at the 
source code. Unfortunately Maven2's Plugins are not documented very well.

The single artefact policy is a drawback in many ways, since we often 
have source codes that in fact shall result in two or more artefacts 
(from a technical view) or infact shall not be split up into several 
projects (from a management view). In fact I am not aware what the 
Maven2 authors intended when they introduced this policy, since it often 
makes sense to have more than one artefact and I don't see a large 
problem to introduce one more <artefact> tag in the pom or change the 
API of Maven to make plugins aware of more than one artefact.

But this is another discussion... ;-)

Thanks
Markus

Daryl.Dwyer@tdameritrade.com schrieb:

>One other concern would be that in general, the EJB client generation
>from the same EJB module violates Maven's principle of one artifact per
>project/module.  As I understand it today, the only benefit of using it
>is that it will generate a separate JAR file in the repo that can be
>referenced by a client as an EJB client dependency and that you can
>selectively filter out classes (bean classes, etc.) from the client jar
>(but not dependencies carried over from the EJB or any of its transitive
>dependencies).
>
>-Daryl
>
> 
>
>-----Original Message-----
>From: Markus KARG [mailto:markus.karg@gmx.net] 
>Sent: Thursday, September 14, 2006 11:51 AM
>To: Maven Users List
>Cc: karg@quipsy.de
>Subject: Re: EJB Client JAR
>
>Daryl,
>
>thanks a lot for your answer once again. Indeed we managed to let the
>ejb packager create the client jar and now understand why you have not
>been using it. Actually it is scary to see all the Class-Path entries in
>the client... Maybe we should file a feature request.
>
>Thanks again
>Markus
>
>Daryl.Dwyer@tdameritrade.com wrote:
>  
>
>>Not necessarily the maven-ejb-plugin way, but you can create a 
>>separate module for the EJB client and then add a compile dependency 
>>on the that project in your EJB project's pom.  We did this to get 
>>around the fact that using the generateClient option on the 
>>maven-ejb-plugin generates a pom for the client with way too many 
>>dependencies (includes all of the EJBs dependencies) and so that we 
>>could compile the EJB in 1.5 but compile the client under 1.4.
>> 
>>
>>-----Original Message-----
>>From: Markus KARG [mailto:markus.karg@quipsy.de]
>>Sent: Thursday, September 14, 2006 4:23 AM
>>To: Maven Users List
>>Subject: EJB Client JAR
>>
>>Using Maven2's ejb package, I was able to create an ejb-jar from my 
>>sources.
>>But not I want Maven to create an "EJB Client JAR", that only contains
>>    
>>
>
>  
>
>>the interfaces, and make another JAR dependent of that "EJB Client
>>    
>>
>JAR"
>  
>
>>(by means of Class-Path: entry in MANIFEST.MF).
>>
>>How to do that?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>  
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>  
>


RE: EJB Client JAR

Posted by Da...@tdameritrade.com.
One other concern would be that in general, the EJB client generation
from the same EJB module violates Maven's principle of one artifact per
project/module.  As I understand it today, the only benefit of using it
is that it will generate a separate JAR file in the repo that can be
referenced by a client as an EJB client dependency and that you can
selectively filter out classes (bean classes, etc.) from the client jar
(but not dependencies carried over from the EJB or any of its transitive
dependencies).

-Daryl

 

-----Original Message-----
From: Markus KARG [mailto:markus.karg@gmx.net] 
Sent: Thursday, September 14, 2006 11:51 AM
To: Maven Users List
Cc: karg@quipsy.de
Subject: Re: EJB Client JAR

Daryl,

thanks a lot for your answer once again. Indeed we managed to let the
ejb packager create the client jar and now understand why you have not
been using it. Actually it is scary to see all the Class-Path entries in
the client... Maybe we should file a feature request.

Thanks again
Markus

Daryl.Dwyer@tdameritrade.com wrote:
> Not necessarily the maven-ejb-plugin way, but you can create a 
> separate module for the EJB client and then add a compile dependency 
> on the that project in your EJB project's pom.  We did this to get 
> around the fact that using the generateClient option on the 
> maven-ejb-plugin generates a pom for the client with way too many 
> dependencies (includes all of the EJBs dependencies) and so that we 
> could compile the EJB in 1.5 but compile the client under 1.4.
>  
>
> -----Original Message-----
> From: Markus KARG [mailto:markus.karg@quipsy.de]
> Sent: Thursday, September 14, 2006 4:23 AM
> To: Maven Users List
> Subject: EJB Client JAR
>
> Using Maven2's ejb package, I was able to create an ejb-jar from my 
> sources.
> But not I want Maven to create an "EJB Client JAR", that only contains

> the interfaces, and make another JAR dependent of that "EJB Client
JAR"
> (by means of Class-Path: entry in MANIFEST.MF).
>
> How to do that?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>   


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


RE: EJB Client JAR

Posted by Da...@tdameritrade.com.
Markus,

No problem.  

I think because of transitive dependencies, the only way they could make
it work would be to qualify the dependencies which would introduce
problems elsewhere.  Even if the plugin did provide this feature,
unfortunately for me, I don't think it would be able to accommodate my
team's requirement for compiling the client at a different JRE target
level, though.

-Daryl

-----Original Message-----
From: Markus KARG [mailto:markus.karg@gmx.net] 
Sent: Thursday, September 14, 2006 11:51 AM
To: Maven Users List
Cc: karg@quipsy.de
Subject: Re: EJB Client JAR

Daryl,

thanks a lot for your answer once again. Indeed we managed to let the
ejb packager create the client jar and now understand why you have not
been using it. Actually it is scary to see all the Class-Path entries in
the client... Maybe we should file a feature request.

Thanks again
Markus

Daryl.Dwyer@tdameritrade.com wrote:
> Not necessarily the maven-ejb-plugin way, but you can create a 
> separate module for the EJB client and then add a compile dependency 
> on the that project in your EJB project's pom.  We did this to get 
> around the fact that using the generateClient option on the 
> maven-ejb-plugin generates a pom for the client with way too many 
> dependencies (includes all of the EJBs dependencies) and so that we 
> could compile the EJB in 1.5 but compile the client under 1.4.
>  
>
> -----Original Message-----
> From: Markus KARG [mailto:markus.karg@quipsy.de]
> Sent: Thursday, September 14, 2006 4:23 AM
> To: Maven Users List
> Subject: EJB Client JAR
>
> Using Maven2's ejb package, I was able to create an ejb-jar from my 
> sources.
> But not I want Maven to create an "EJB Client JAR", that only contains

> the interfaces, and make another JAR dependent of that "EJB Client
JAR"
> (by means of Class-Path: entry in MANIFEST.MF).
>
> How to do that?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>   


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


Re: EJB Client JAR

Posted by Markus KARG <ma...@gmx.net>.
Daryl,

thanks a lot for your answer once again. Indeed we managed to let the
ejb packager create the client jar and now understand why you have not
been using it. Actually it is scary to see all the Class-Path entries in
the client... Maybe we should file a feature request.

Thanks again
Markus

Daryl.Dwyer@tdameritrade.com wrote:
> Not necessarily the maven-ejb-plugin way, but you can create a separate
> module for the EJB client and then add a compile dependency on the that
> project in your EJB project's pom.  We did this to get around the fact
> that using the generateClient option on the maven-ejb-plugin generates a
> pom for the client with way too many dependencies (includes all of the
> EJBs dependencies) and so that we could compile the EJB in 1.5 but
> compile the client under 1.4.
>  
>
> -----Original Message-----
> From: Markus KARG [mailto:markus.karg@quipsy.de] 
> Sent: Thursday, September 14, 2006 4:23 AM
> To: Maven Users List
> Subject: EJB Client JAR
>
> Using Maven2's ejb package, I was able to create an ejb-jar from my
> sources.
> But not I want Maven to create an "EJB Client JAR", that only contains
> the interfaces, and make another JAR dependent of that "EJB Client JAR" 
> (by means of Class-Path: entry in MANIFEST.MF).
>
> How to do that?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>   


RE: EJB Client JAR

Posted by Da...@tdameritrade.com.
Not necessarily the maven-ejb-plugin way, but you can create a separate
module for the EJB client and then add a compile dependency on the that
project in your EJB project's pom.  We did this to get around the fact
that using the generateClient option on the maven-ejb-plugin generates a
pom for the client with way too many dependencies (includes all of the
EJBs dependencies) and so that we could compile the EJB in 1.5 but
compile the client under 1.4.
 

-----Original Message-----
From: Markus KARG [mailto:markus.karg@quipsy.de] 
Sent: Thursday, September 14, 2006 4:23 AM
To: Maven Users List
Subject: EJB Client JAR

Using Maven2's ejb package, I was able to create an ejb-jar from my
sources.
But not I want Maven to create an "EJB Client JAR", that only contains
the interfaces, and make another JAR dependent of that "EJB Client JAR" 
(by means of Class-Path: entry in MANIFEST.MF).

How to do that?

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