ufoss-org / kotysa

The idiomatic way to write type-safe SQL in Kotlin
The Unlicense
121 stars 2 forks source link

Importing Kotysa via maven imposes tight coupling on Spring milestone/RC #23

Closed dominic-jones closed 4 years ago

dominic-jones commented 4 years ago

Problem

In uploads to jcenter, kotysa-spring-data-r2dbc does not provide a natural maven pom, instead relying on a pom generated from gradle.

This pom declares Spring as a bom import, for example

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-framework-bom</artifactId>
        <version>5.3.0-RC1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

In my project, I am already importing the Spring bom at a higher priority, so it should override Kotysa's import. No problem there so far.

The problem however is in the milestone or RC imports. These are only present in Spring's Milestone repository. As the Kotysa spike branch in out project does not depend on this repository, it fails to find this version of Spring's bom (even though these versions would have been overridden anyway). As far as I can see so far, bom imports in a dependency cannot be excluded so I cannot prevent Kotysa from taking this action from my pom.

The error is simple enough and looks like Failed to read artifact descriptor for org.ufoss.kotysa:kotysa-spring-r2dbc:jar:0.1.7: Failure to find org.springframework:spring-framework-bom:pom:5.3.0-RC1

Possible Solutions

The local solution here is simple enough, to add that dependency on Spring Milestone to my pom. That's not always possible though in company projects.

I'm not sure if this is Kotysa's fault, or the gradle-to-maven conversion's fault, but unfortunately, this repo has the problem.

Unless Kotysa is depending on bleeding edge Spring features (which is possible, I haven't dug into the source yet), it might be best to use stable releases. Or change the build file in some way to encourage a conversion to a better pom.

pull-vert commented 4 years ago

Hello @dominic-jones Thanks for your feadback, you are perfectly right Kotysa is supposed to be an extension on the supported SQL clients, it should not fail because of any BOM import !

Starting with 0.1.8 I will no longer use Spring bom to resolve versions, it will not fail like this anymore.

Note that since kotysa-spring-r2dbc 0.1.7, it explicitly needs at least a spring-framewok 5.3.x (currently in RC) because this module now depends on the new spring-r2dbc module that was added in Spring core 5.3.x.

pull-vert commented 4 years ago

@dominic-jones little update for Kotysa 0.1.8 that will be released very soon :