Unable to import Arrow core classes after adding Maven dependency

已回答

Hi all, I'm having trouble adding Arrow to a Maven project created from a simple start.spring.io skeleton.

I've added Arrow core as a dependency to the POM and refreshed Maven. I can "Navigate -> Class" in the IDE and input an Arrow class such as Either, and IntelliJ finds it in arrow-core-1.0.1.jar. However, if I "import arrow.core.Either", it complains with "Unresolved reference arrow".

A similar start.spring.io skeleton using Gradle works fine. 

I've tried invalidating caches as well as removing the .idea/ directory and re-importing the project. And along the way I upgraded the Kotlin plugin from 1.5.10 to 1.6.10-RC. I'm using Intellij 2021.3 on Windows 10. 

I'm out of ideas and any help/suggestions are appreciated.

 

0

may you share the maven project you generated? You can do that via GutHub, or uploads.jetbrains.com

0

Done, file reference: 2021_12_14_TSRNsppPAtvJVGRy

It's a barebones start.spring.io with arrow-core added. Thanks for looking at it.

0

I mean the whole project sample, not only pom.xml. 

Where do you insert the import? Is it Kotlin, or Java file? 

0

Ah sorry, done and at 2021_12_15_4GhqMhrRgeVcJT73.

I added the import to ArrowTestApplication.kt ("import arrow.core.Either"). And here's what I get:

0

It is hardly related to IntelliJ IDEA. Maven does not compile the project in the command line also: https://i.imgur.com/2BU15Yi.jpg

I'd submit an issue to arrow core github: https://github.com/arrow-kt/arrow-core/issues

0

Just found a similar Kotlin bug: https://youtrack.jetbrains.com/issue/KT-25709#focus=Comments-27-3728739.0-0

That could be related. 

I've added Kotlin team to CC, maybe they can shed some light on that. 

0

Does it work if you depend on `arrow-core-jvm` instead of `arrow-core`? If yes, please file an issue to https://github.com/arrow-kt/arrow so that the maintainers of Arrow update the documentation on how to use the library from Maven.

2

Alexey Belkov thanks, that does indeed work! I'll file an issue with Arrow momentarily. And thanks Konstantin Annikov for getting me to the right person to solve this.

0

请先登录再写评论。