You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Leonard Brünings <gr...@bruenings-it.net> on 2018/09/17 00:44:56 UTC

Proposal groovy-bom

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


Re: Proposal groovy-bom

Posted by Leonard Brünings <gr...@bruenings-it.net>.
Playing necromancer here, I still would strongly suggest adding a
"groovy-bom" or "groovy-platform" module,
as even gradle implemented support for platform boms

https://docs.gradle.org/current/userguide/java_platform_plugin.html

I hope we can get this for 3.0 final, and maybe even backported to
earlier releases.

cheers

Leonard

Am 18.09.2018 um 16:02 schrieb 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
> <groovy-dev@bruenings-it.net <ma...@bruenings-it.net>> 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
>     >
>

Re: Proposal groovy-bom

Posted by Cédric Champeau <ce...@gmail.com>.
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 <gr...@bruenings-it.net>
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
> >
>
>

Re: Proposal groovy-bom

Posted by Leonard Brünings <gr...@bruenings-it.net>.
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
>


Re: Proposal groovy-bom

Posted by Jochen Theodorou <bl...@gmx.org>.
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