Home > Enterprise >  Why does arrow-core not work with my kotlin maven project?
Why does arrow-core not work with my kotlin maven project?

Time:02-02

I created a kotlin(1.6.10) project with maven(3.8.3) and spring boot 2.6.2 from https://start.spring.io/

I then included the following dependency:

        <dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-core</artifactId>
            <version>1.0.1</version>
        </dependency>

If I now try to include arrow.core.Either in my kotlin files it doesn't work. It cannot find the arrow package.

If I change the dependency to the -jvm version it works:

        <dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-core-jvm</artifactId>
            <version>1.0.1</version>
        </dependency>

I have also experienced the same issue with:

<dependency>
      <groupId>io.github.microutils</groupId>
      <artifactId>kotlin-logging-jvm</artifactId>
      <version>2.1.21</version>
</dependency>

I would like to know the reason for this? Why does the -jvm dependency work and the other one doesn't? This issue seems to be related to maven, with gradle the -jvm is not needed.

CodePudding user response:

Please see this issue:

https://github.com/arrow-kt/arrow/issues/2658

So there was an issue in the 1.0.1 release and reverting to 1.0.0 should work for now, or you can use the arrow-jvm version with 1.0.1 for now and change it once the next release becomes available.

  •  Tags:  
  • Related