Proposal groovy-bom

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal groovy-bom

Leonard Brünings

Hi,

the switch to fine grained artifacts with groovy-2.5 made it harder to consistently mange package versions.

Many projects offer a bom pom (https://www.baeldung.com/spring-maven-bom), that manages all the packages so users of maven have to just import the bom pom instead of having to manage every artifact.

So you can do just this

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-bom</artifactId>
      <version>${groovy-version}</version>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Instead of

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy</artifactId>
      <version>${groovy-version}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-ant</artifactId>
      <version>${groovy-version}</version>
    </dependency>
... repeat for every package to be managed
  </dependencies>
</dependencyManagement>

This should be fairly easy to do as the current groovy-all is almost a bom pom, all that is needed is to move the dependency declaration into a dependencyManagement block.


https://github.com/spockframework/spock/issues/892#issuecomment-418659404

Reply | Threaded
Open this post in threaded view
|

Re: Proposal groovy-bom

Jochen Theodorou
On 17.09.2018 02:44, Leonard Brünings wrote:

> Hi,
>
> the switch to fine grained artifacts with groovy-2.5 made it harder to
> consistently mange package versions.
>
> Many projects offer a bom pom
> (https://www.baeldung.com/spring-maven-bom), that manages all the
> packages so users of maven have to just import the bom pom instead of
> having to manage every artifact.
>
> So you can do just this
>
> <dependencyManagement>
>    <dependencies>
>      <dependency>
>        <groupId>org.codehaus.groovy</groupId>
>        <artifactId>groovy-bom</artifactId>
>        <version>${groovy-version}</version>
>        <scope>import</scope>
>      </dependency>
>    </dependencies>
> </dependencyManagement>

what is wrong with this pom?
http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.2/groovy-all-2.5.2.pom

bye Jochen

Reply | Threaded
Open this post in threaded view
|

Re: Proposal groovy-bom

Leonard Brünings
Hi,

as I said, it needs to be in the dependencyManagement section, to be
importable into the dependencyManagement of another pom.
You can add groovy-all to dependencyManagement, but that only affects
the version of the artifact itself not the version of its transitive
dependencies, which can be affected by transitive dependencies of other
artifacts.

If you don't want to add another project it is possible to add the
dependencyManagement section into groovy-all and remove the version in
the normal dependencies block.

cheers

Leonard


Am 17.09.2018 um 20:42 schrieb Jochen Theodorou:

> On 17.09.2018 02:44, Leonard Brünings wrote:
>> Hi,
>>
>> the switch to fine grained artifacts with groovy-2.5 made it harder
>> to consistently mange package versions.
>>
>> Many projects offer a bom pom
>> (https://www.baeldung.com/spring-maven-bom), that manages all the
>> packages so users of maven have to just import the bom pom instead of
>> having to manage every artifact.
>>
>> So you can do just this
>>
>> <dependencyManagement>
>>    <dependencies>
>>      <dependency>
>>        <groupId>org.codehaus.groovy</groupId>
>>        <artifactId>groovy-bom</artifactId>
>>        <version>${groovy-version}</version>
>>        <scope>import</scope>
>>      </dependency>
>>    </dependencies>
>> </dependencyManagement>
>
> what is wrong with this pom?
> http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.2/groovy-all-2.5.2.pom
>
> bye Jochen
>

Reply | Threaded
Open this post in threaded view
|

Re: Proposal groovy-bom

Cédric Champeau
Moving from the `dependencies` to `dependencyManagement` block is not semantically equivalent. In the `dependencies` block you get all the dependencies transitively, meaning that if you request groovy-all, you'd get all the individual modules. If it's moved to `<dependencyManagement>` then you only get _recommendations_ for modules you actually use. That said, I think having a "groovy-platform" module would be a good idea, as it would also let Gradle align those modules.

Le lun. 17 sept. 2018 à 20:49, Leonard Brünings <[hidden email]> a écrit :
Hi,

as I said, it needs to be in the dependencyManagement section, to be
importable into the dependencyManagement of another pom.
You can add groovy-all to dependencyManagement, but that only affects
the version of the artifact itself not the version of its transitive
dependencies, which can be affected by transitive dependencies of other
artifacts.

If you don't want to add another project it is possible to add the
dependencyManagement section into groovy-all and remove the version in
the normal dependencies block.

cheers

Leonard


Am 17.09.2018 um 20:42 schrieb Jochen Theodorou:
> On 17.09.2018 02:44, Leonard Brünings wrote:
>> Hi,
>>
>> the switch to fine grained artifacts with groovy-2.5 made it harder
>> to consistently mange package versions.
>>
>> Many projects offer a bom pom
>> (https://www.baeldung.com/spring-maven-bom), that manages all the
>> packages so users of maven have to just import the bom pom instead of
>> having to manage every artifact.
>>
>> So you can do just this
>>
>> <dependencyManagement>
>>    <dependencies>
>>      <dependency>
>>        <groupId>org.codehaus.groovy</groupId>
>>        <artifactId>groovy-bom</artifactId>
>>        <version>${groovy-version}</version>
>>        <scope>import</scope>
>>      </dependency>
>>    </dependencies>
>> </dependencyManagement>
>
> what is wrong with this pom?
> http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.2/groovy-all-2.5.2.pom
>
> bye Jochen
>