Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-3354

Scope of some dependencies for EJB client applications is wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.GA
    • None
    • Documentation
    • None

      In the EJB development guide, section 1.9.3. Project Dependencies for Remote EJB Clients
      there is this pom.xml snippet:

       <!-- Import the transaction spec API.
              We use runtime scope because we aren't using any
              direct reference to the spec API in our client code -->
          <dependency>
              <groupId>org.jboss.spec.javax.transaction</groupId>
              <artifactId>jboss-transaction-api_1.2_spec</artifactId>
              <scope>runtime</scope>
          </dependency>
      
          <!-- Import the EJB API.
              We use runtime scope because we aren't using any
              direct reference to EJB spec API in our client code -->
          <dependency>
              <groupId>org.jboss.spec.javax.ejb</groupId>
              <artifactId>jboss-ejb-api_3.2_spec</artifactId>
              <scope>runtime</scope>
          </dependency>
      

      The runtime scope and the comment about it are wrong. In cases where the client code contains deferences to JTA/EJB apis, then you need this dependency in the compile scope.

      Now if I assume that this is taken from the ejb-remote quickstart, then strictly speaking, these two dependencies are not needed at all, because the client-side code of it doesn't contain any references to these APIs. But in some other cases it might be needed, so I don't think that we have to remove these dependencies (depending on the approach, some users will need it).

      So what I would like to change is...
      I suggest to change the scope in the documentation to compile and change the comments to something like this is only needed if the client application contains direct references to EJB API (or JTA api, in the other case)

            sgilda_jira Sande Gilda (Inactive)
            jmartisk@redhat.com Jan Martiska
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: