0

i have a scala project using the scala plugin. I need to use this monocle library, (https://www.optics.dev/Monocle/) for a project, but I just have no idea how to add it to my project. For sbt projects, there should be a build.sbt file, where I could simply put in something like this:

libraryDependencies ++= Seq(
 "com.github.julien-truffaut" %% "monocle-core"  % "2.0.3",
 "com.github.julien-truffaut" %% "monocle-macro" % "2.0.3",
)

Which should add the dependency for me. However, I have no idea how I should do this in my current project, and can't really find any leads online, theres no.jar-files anywhere that I can download.

I also tried linking to the library documentation with this thing:

enter image description here

Which did not work. My directory structure looks like this:

enter image description here

n00bster
  • 379
  • 4
  • 12
  • 2
    Which build tool are you using? if any and just your IDE then you can either download the jars from [**Maven central**](https://mvnrepository.com/artifact/com.github.julien-truffaut/monocle-core) and place them in a `lib` folder, but don't do this. An IDE is not a build tool, doing this will only make it harder for other people to collaborate in your project and almost impossible to automatize a deployment _(in general adopt any CI strategy)_ - Finally, humble opinion, if you didn't know this, I do not believe it would be good to use one of the most advanced libraries outther like **monocle**. – Luis Miguel Mejía Suárez Nov 22 '20 at 21:08
  • collaboration is not an issue, it's for a smaller uni assignment. Should I just add a reference to the jar files in the "external libs"? – n00bster Nov 22 '20 at 21:13
  • 2
    Yes but again, I really would recommend you not do depend on an IDE for doing everything. Adding a small `build.sbt` file will not take you more than 5 minutes. – Luis Miguel Mejía Suárez Nov 22 '20 at 21:18

0 Answers0