Clojure pedestal.io code is not resolved in IntelliJ

649 views Asked by At

I have a small application of Clojure and Pedestal that I grabbed from pedestal.io tutorial. It works fine in the terminal. When I open it in IntelliJ some "cannot be resolved" tips are appearing. And some code parts are getting a beige background.

enter image description here

I have Cursive plugin installed. The code is executed by boot repl. Is any way to resolve full code by IntelliJ? If so, which settings?

Update

"Indexed Maven Repositories" field

enter image description here

1

There are 1 answers

1
Alan Thompson On BEST ANSWER

Check your settings to make sure both Clojars and Maven repos are indexed:

IntelliJ IDEA Settings

Navigate to:

File
-> Settings
   -> Build, Execution, Deployment 
      -> Build Tools
         -> Maven
            -> Repositories

And make sure it looks like the above picture. If necessary, highlight both the Maven & Clojars repos and click "Update", then "OK" (you don't need to wait for it to finish as it is a background process).


Also, it is frequently helpful to do

File 
  -> Invalidate Caches / Restart

Then it will resolve correctly:

How Cursive Should Look


Update #2

OK, I see you have a boot project. I have a lein project, and Cursive populated my list automatically (from project.clj I assume). Two ways forward:

  1. Search the docs, SO, & Cursive mailing list for boot info. The Cursive author is very responsive to items on the mailing list:

  2. If the above doesn't work, maybe convert it to a lein project just to make Cursive/IntelliJ happy. You can still run it as a boot project from the command line (or however you normally use boot).

For more info, see also this question: IntelliJ IDEA: "Indexed Maven Repositories" list - how to add remote maven repository in this list?

and the reference: http://maven.apache.org/settings.html#Repositories


Update #3:

OK, just found this boot Cursive info, which looks good: https://github.com/boot-clj/boot/wiki/For-Cursive-Users