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

Unnecessary dependencies for the ejb-remote quickstart's client side

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.0.0.ER6
    • 7.0.0.ER5
    • Quickstarts
    • None

      The client-side pom of the ejb-remote quickstart contains this

           <!-- 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 first thing is that the implication that "if we don't have direct reference to API then the dependency needs to be in runtime scope" is a nonsense - because if we don't have direct reference to the API on the client side, we don't need this dependency at all. Only the server needs to depend on an implementation, but that's a different story.

      Now the fact is that the EJB api will be imported transitively anyway, because the client-side project depends on the server-side bean interfaces, and these interfaces actually do have a direct reference to EJB api.

      That means that currently, the EJB api is imported twice - once from the root project, once imported by the jboss-ejb-remote-server-side dependency.

      The Transaction (JTA) api is imported once, and it's not needed, because the client side doesn't have any dependencies on JTA api (nor in the code, neither in runtime, because it will be the server side that will handle transactions)

      So what I would like to change...
      The two mentioned dependencies are not needed in the client's pom (ejb-remote/client/pom.xml) at all. It could confuse some users to add these dependencies when it's not needed

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

              Created:
              Updated:
              Resolved: