4 Replies Latest reply on Apr 9, 2010 12:56 PM by jaikiran pai

    ejb3_1 and its relation with ejb3 bom

    jaikiran pai Master

      Right now we are duplicating the version info for EJB3 modules/components in 2 places:

       

      1) bom as-6 http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/bom/as6/trunk/pom.xml
      2) ejb3_1 module http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/ejb3_1/pom.xml

       

      The ejb3_1 module is a pom which declares all the "dependencies" that will be pulled in when some other project depends on this (ex: AS_Trunk/ejb3). On the other hand, the bom as-6 is "dependency management" which enforces the versions for ejb3 modules/components.

       

      As such, I think that the ejb3 bom as-6 should be the parent for the ejb3_1 module. That way, the ejb3_1 module pom will just declare the dependencies and let the parent bom declare the dependency versions.

       

      But then, the bom has different artifacts, one for each AS version. So making the bom as the parent of ejb3_1 won't play out well when there are multiple AS version boms.

       

      All I am trying to avoid is, having multiple poms specify the versions of EJB3 modules/components.

        • 1. Re: ejb3_1 and its relation with ejb3 bom
          Andrew Rubinger Master

          jaikiran pai wrote:

          As such, I think that the ejb3 bom as-6 should be the parent for the ejb3_1 module. That way, the ejb3_1 module pom will just declare the dependencies and let the parent bom declare the dependency versions.

          I think this is good, though there's something worthy of noting here.

           

          If the BOM is the parent of the ejb3_1 module, then the ejb3_1 module will have the correct exported dependencies.  Now something else, project X, makes a depedendency upon ejb3_1.  Any "exclusion"s defined by the BOM will be *ignored*.  This is because Project X doesn't have the BOM in its hierarchy.  The way around this is to declare in Project X a dependency twice upon ejb3_1; once in "dependencies", once in "dependencyManagement" (with scope import).

           

          S,

          ALR

          • 2. Re: ejb3_1 and its relation with ejb3 bom
            jaikiran pai Master

            Andrew Rubinger wrote:

             

            jaikiran pai wrote:

            As such, I think that the ejb3 bom as-6 should be the parent for the ejb3_1 module. That way, the ejb3_1 module pom will just declare the dependencies and let the parent bom declare the dependency versions.

            I think this is good

             

            (I think) there's a catch though. The ejb3_1 module can go into both AS6.0 and AS6.1 (let's assume we have it). And AS6.0 and AS6.1 will have separate bom artifacts. So we won't be able to mark this bom as the parent for ejb3_1.

            • 3. Re: ejb3_1 and its relation with ejb3 bom
              jaikiran pai Master

              Andrew Rubinger wrote:

               


              If the BOM is the parent of the ejb3_1 module, then the ejb3_1 module will have the correct exported dependencies.  Now something else, project X, makes a depedendency upon ejb3_1.  Any "exclusion"s defined by the BOM will be *ignored*.  This is because Project X doesn't have the BOM in its hierarchy.  The way around this is to declare in Project X a dependency twice upon ejb3_1; once in "dependencies", once in "dependencyManagement" (with scope import).

               

              S,

              ALR

              The project X that I was considering was AS. So we would have something like:

               

              ejb3_1 module pom.xml:

              <parent>
                <artifactId>bom-as6</artifactId>
                <version>0.1.3</version>
              </parent>
              
              <artifactId>jboss-ejb3_1</artifactId>
              

               

               

              bom-as6 pom.xml:

              <artifactId>bom-as6</artifactId>
              
              <dependencyManagement>
                  <dependency>
                      <artifactId>jboss-ejb3-core</artifactId>
                      <version>1.3.2</version>
                  </dependency>
              <!-- rest of the dep management -->
              </dependencyManagement>
              

               

               

              JBoss AS component-matrix pom.xml (or some module which "imports" the bom)

               

              <dependencyManagement>
                  <dependency>
                    <artifactId>bom-as6</artifactId>
                    <scope>import</scope>
                 </dependency>
              </dependencyManagement>
              

               

              The AS/ejb3 module pom.xml would add "dependency" on *ejb3_1*

               

              <dependencies>
                   <dependency>
                        <artifactId>jboss-ejb3_1</artifactId>
                        <!-- We don't specify any version here, it will be picked up from bom -->
                   </dependency>
              </dependencies>
              
              

               

              But like I said in my previous post, making bom-as6 the parent of ejb3_1 may not work out.

              • 4. Re: ejb3_1 and its relation with ejb3 bom
                jaikiran pai Master

                The other option that I have been thinking of is to get rid of ejb3_1 entirely. That way we will have a bom which will both have dependencyManagement and dependencies specified. Effectively, that will act as the entity which manages the right versions and also let's the consuming projects (like AS) "depend" (so that dependencies are pulled in the CP) as well as import it. So we would probably end up having bom-as6 (multiple version), bom-as-6.1 (multiple versions) artifacts.