eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
http://www.eclipse.org/collections
2.39k stars 593 forks source link

Add a bill of materials (BOM) POM #1503

Open marschall opened 10 months ago

marschall commented 10 months ago

It would be nice if the project provided a Bill of Materials (BOM) POMs that contain all the artifacts of the project.

Many projects like Spring and JUnit provide BOM POMs so that versions have to be specified only once.

Right now if somebody wants to use Eclipse Collections the version has to be specified twice.

<dependencies>
  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections-api</artifactId>
    <version>11.1.0</version>
  </dependency>

  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections</artifactId>
    <version>11.1.0</version>
  </dependency>

With a BOM POM the version has to be specified only once.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.collections</groupId>
      <artifactId>eclipse-collections-bom</artifactId>
      <version>11.1.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections-api</artifactId>
  </dependency>

  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections</artifactId>
  </dependency>
</dependencies>

It is a bit more verbose. There are other solutions for this like properties. Using BOM POMs is completely optional to users.

danthe1st commented 10 months ago

If both dependencies should have the same version, you can also use properties:

<properties>
  <eclipse-collections.version>11.1.0</eclipse-collections.version>
</properties>
<dependencies>
  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections-api</artifactId>
    <version>${eclipse-collections.version}</version>
  </dependency>

  <dependency>
    <groupId>org.eclipse.collections</groupId>
    <artifactId>eclipse-collections</artifactId>
    <version>${eclipse-collections.version}</version>
  </dependency>
</dependencies>
AnamuddinAhmad commented 9 months ago

Hello sir, "I'm eager to make a meaningful contribution to this codebase and help resolve any issues that may arise."