3 Replies Latest reply on Jun 5, 2008 5:25 PM by brian.stansberry

    Use of

    brian.stansberry

      Is there any preference for using the "mapping" element in a thirdparty/pom.xml dependency element? My take on it is it's used to prevent breaking the legacy paths that are all over the build system and that for new additions it's better to just have the thirdparty structure mirror the maven repo structure. E.g. I'm adding the org.hibernate/hibernate-jbosscache2 jar while there's an existing hibernate-core:

       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-core</artifactId>
       <mapping>
       <componentId>hibernate</componentId>
       </mapping>
       </dependency>
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-jbosscache2</artifactId>
       <!-- No mapping element so this jar will not be located next
       to hibernate-core -->
       </dependency>
      


        • 1. Re: Use of
          pgier

          Yes, the mapping is there just to map to existing paths. So if this is a new dependency, I would prefer that you use the maven path and then you won't need any mapping configuration.

          Eventually, I would like to remove all the mapping configs and simplify the pom, but in the short term I just didn't want to risk breaking the build.

          • 2. Re: Use of
            brian.stansberry

            Thanks; that's exactly what I figured your plan was. :-)

            Seems forum doesn't like quotation marks in subject line.

            • 3. Re: Use of
              brian.stansberry

              BTW, anyone reading this thread, please ignore my example above. The thirdparty/pom.xml has a maven-buildmagic-thirdparty-plugin with a plugin config that uses a bunch "dependency" elements inside a "mappedDependencies" element. Don't put a lib without a "mapping" element there; it doesn't work. Scroll down and put it in the regular maven dependencies section.