jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x EJB Plugin
  • MEJB-33

Add support for fewer dependencies in client-jars

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.1
  • Fix Version/s: None
  • Labels:
    None

Description

Given a scenario, where several application tiers are installed on different servers, are realized as EJB3 applications, and packaged using maven.

When configuring an ejb module, I give dependencies to all dependency jars that are used to implement the features. However, they are currently all added as dependency to the client-jar artifacts as well, so that unused libraries are deployed on client servers.

I'd like to mark dependencies as server-jar only, e.g. by an clientJarExclusions configuration element to the plugin, which takes a set of exclusion elements like the exclusions-element in a dependency. These dependencies should behave as compile-scope in the server- and provided-scope in the client-jars.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    ejb-client-packaging-problem.zip
    14/May/10 3:41 AM
    8 kB
    Hans Guldager Knudsen
    1. XML File
      ear/pom.xml 1 kB
    2. File
      ejb/.project 0.4 kB
    3. XML File
      ejb/pom.xml 2 kB
    4. Java Source File
      ejb/src/main/.../ejb/impl/ClientBean.java 0.5 kB
    5. Java Source File
      ejb/src/.../interfaces/ClientRemote.java 1.0 kB
    6. XML File
      pom.xml 5 kB
    7. File
      war/.project 0.4 kB
    8. XML File
      war/pom.xml 2 kB
    9. Java Source File
      war/src/main/.../test/war/TestServlet.java 1 kB
    10. File
      war/src/main/webapp/index.jsp 0.1 kB
    11. XML File
      war/src/main/webapp/WEB-INF/web.xml 0.2 kB
    Download Zip
    Show
    Zip Archive
    ejb-client-packaging-problem.zip
    14/May/10 3:41 AM
    8 kB
    Hans Guldager Knudsen

Issue Links

is related to

Improvement - An improvement or enhancement to an existing feature or task. MNG-4804 EJB dependencies are included when using the ejb-client packaging/type

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Karsten Tinnefeld added a comment - 24/Sep/08 3:40 PM

As a partial workaround, I found I can add server-only dependencies as optional dependencies to the ejb module. Giving them as mandatory dependencies for any ear module containing the server-ear, the dependencies (and also transitive dependencies, as mentioned above) are worked out fine.

The manifest.mf however, having the classpath added (<configuration><archive> <manifest><addClasspath>true</addClasspath> </manifest></archive></configuration>) still has all server library entries referenced which are not available in client.jar packages (Which is, at least, ugly, but should not lead to trouble except when ill-naming dependency jars or depending on different dependency jar versions in different parts of the system.)

Show
Karsten Tinnefeld added a comment - 24/Sep/08 3:40 PM As a partial workaround, I found I can add server-only dependencies as optional dependencies to the ejb module. Giving them as mandatory dependencies for any ear module containing the server-ear, the dependencies (and also transitive dependencies, as mentioned above) are worked out fine. The manifest.mf however, having the classpath added (<configuration><archive> <manifest><addClasspath>true</addClasspath> </manifest></archive></configuration>) still has all server library entries referenced which are not available in client.jar packages (Which is, at least, ugly, but should not lead to trouble except when ill-naming dependency jars or depending on different dependency jar versions in different parts of the system.)
Hide
Permalink
Gabriel Guerrero added a comment - 02/Sep/09 7:17 PM

Hey guys I had a lot of issues because of this, some class loading problems because one of my ejb-client was bringing to much unnecesary dependencies it was also very used in several projects so we endend excluding lots of libs everywhere, the work arround works, so could you guys add the workaround at least to usage guide in the site or FAQ, it will save many people a lot of time

Thanks

Show
Gabriel Guerrero added a comment - 02/Sep/09 7:17 PM Hey guys I had a lot of issues because of this, some class loading problems because one of my ejb-client was bringing to much unnecesary dependencies it was also very used in several projects so we endend excluding lots of libs everywhere, the work arround works, so could you guys add the workaround at least to usage guide in the site or FAQ, it will save many people a lot of time Thanks
Hide
Permalink
Hans Guldager Knudsen added a comment - 14/May/10 3:41 AM

Hi!

we have run into this problem when using 'ejb-client' in jboss ESB and jboss PAR as well as WAR where all dependencies of the 'ejb' module are included..

i have created a small sample project with an 'ejb', 'ear' and a 'war' (the war is not included in ear)

as a workaround i have tried adding 'exclusions' to the 'ejb-client' - for dependencies only needed on server and if i run

'mvn dependency:tree' (from root folder) it looks ok :

[INFO] ------------------------------------------------------------------------
[INFO] Building war
[INFO] task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] dk.lenio.maven.ejb.client:war:war:0.1-SNAPSHOT
[INFO] +- dk.lenio.maven.ejb.client:ejb:ejb-client:client:0.1-SNAPSHOT:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- log4j:log4j:jar:1.2.15:provided
[INFO] | +- javax.mail:mail:jar:1.4:provided
[INFO] | | - javax.activation:activation:jar:1.1:provided
[INFO] | - javax.jms:jms:jar:1.1:provided
[INFO] - junit:junit:jar:3.8.1:test

but if i run 'mvn clean install' from root folder - the server side jars are included..

1768 05-14-10 09:59 WEB-INF/classes/test/war/TestServlet.class
62983 04-27-09 11:12 WEB-INF/lib/activation-1.1.jar
3792 05-14-10 09:59 WEB-INF/lib/ejb-0.1-SNAPSHOT-client.jar
XX 215885 01-29-10 11:38 WEB-INF/lib/webservices-api-2.0.jar
XX 13051007 01-22-10 11:14 WEB-INF/lib/webservices-rt-2.0.jar
215 04-14-10 12:18 WEB-INF/web.xml

if i cd (change directory) to the 'war' folder and 'mvn clean install' - the jars are excluded :

1768 05-14-10 10:32 WEB-INF/classes/test/war/TestServlet.class
3792 05-14-10 09:59 WEB-INF/lib/ejb-0.1-SNAPSHOT-client.jar
215 04-14-10 12:18 WEB-INF/web.xml

How is depending on a 'ejb-client' supposed to work ?

Show
Hans Guldager Knudsen added a comment - 14/May/10 3:41 AM Hi! we have run into this problem when using 'ejb-client' in jboss ESB and jboss PAR as well as WAR where all dependencies of the 'ejb' module are included.. i have created a small sample project with an 'ejb', 'ear' and a 'war' (the war is not included in ear) as a workaround i have tried adding 'exclusions' to the 'ejb-client' - for dependencies only needed on server and if i run 'mvn dependency:tree' (from root folder) it looks ok : [INFO] ------------------------------------------------------------------------ [INFO] Building war [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ [INFO] [dependency:tree {execution: default-cli}] [INFO] dk.lenio.maven.ejb.client:war:war:0.1-SNAPSHOT [INFO] +- dk.lenio.maven.ejb.client:ejb:ejb-client:client:0.1-SNAPSHOT:compile [INFO] +- javax.servlet:servlet-api:jar:2.5:provided [INFO] +- log4j:log4j:jar:1.2.15:provided [INFO] | +- javax.mail:mail:jar:1.4:provided [INFO] | | - javax.activation:activation:jar:1.1:provided [INFO] | - javax.jms:jms:jar:1.1:provided [INFO] - junit:junit:jar:3.8.1:test but if i run 'mvn clean install' from root folder - the server side jars are included.. 1768 05-14-10 09:59 WEB-INF/classes/test/war/TestServlet.class 62983 04-27-09 11:12 WEB-INF/lib/activation-1.1.jar 3792 05-14-10 09:59 WEB-INF/lib/ejb-0.1-SNAPSHOT-client.jar XX 215885 01-29-10 11:38 WEB-INF/lib/webservices-api-2.0.jar XX 13051007 01-22-10 11:14 WEB-INF/lib/webservices-rt-2.0.jar 215 04-14-10 12:18 WEB-INF/web.xml if i cd (change directory) to the 'war' folder and 'mvn clean install' - the jars are excluded : 1768 05-14-10 10:32 WEB-INF/classes/test/war/TestServlet.class 3792 05-14-10 09:59 WEB-INF/lib/ejb-0.1-SNAPSHOT-client.jar 215 04-14-10 12:18 WEB-INF/web.xml How is depending on a 'ejb-client' supposed to work ?
Hide
Permalink
Dennis Lundberg added a comment - 26/May/10 4:38 AM

If someone can write up some text about the workaround, with an example POM configuration, I can add it to the Plugin site.

Show
Dennis Lundberg added a comment - 26/May/10 4:38 AM If someone can write up some text about the workaround, with an example POM configuration, I can add it to the Plugin site.
Hide
Permalink
Dennis Lundberg added a comment - 27/Oct/11 2:25 AM

This is a problem for me as well. Having thought about different ways to solve this I have come to the sad comclusion that it is very difficult to do.

As long as the ejb and ejb-client are two variants of the same artifact, with different classifiers, they share the same POM. When another project uses the client, that project will resolve the transitive dependencies of the ejb-client using this shared POM. To really solve this we would need to have a separate POM for the client.

Show
Dennis Lundberg added a comment - 27/Oct/11 2:25 AM This is a problem for me as well. Having thought about different ways to solve this I have come to the sad comclusion that it is very difficult to do. As long as the ejb and ejb-client are two variants of the same artifact, with different classifiers, they share the same POM. When another project uses the client, that project will resolve the transitive dependencies of the ejb-client using this shared POM. To really solve this we would need to have a separate POM for the client.

People

  • Assignee:
    Unassigned
    Reporter:
    Karsten Tinnefeld
Vote (5)
Watch (5)

Dates

  • Created:
    19/Sep/08 8:19 AM
    Updated:
    27/Oct/11 2:25 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.