Scala project keeps discarding libraries added to modules

Hello,

I have a scala project called playground, created with IntelliJ idea to begin with. It has two modules, playground and playground-build.

I added a bunch of libraries in the lib sub-folder, that I use in the project. I also added these libraries in the Libraries list under Project Settings, I right-clicked on each library and I added them to the Playground and Playground-build modules. All good.

The problem that I have is that whenever I restart IJ and re-open the project, it keeps loosing the association of these libraries with the two modules and I have to add them again and again, and I am tired of it. 

Any ideas of what could be wrong? I am not using sbt at all, though there is a build.sbt file. I always build the apps using IJ. The libraries that I use and are in the lib sub-folder are not referenced in the sbt file. I don't need to, because sbt is supposed to include the jar files in that folder automatically.

Thanks

2 comments

If there is a build.sbt file, you may have imported the project as sbt, and if auto-refresh is active, it may be reimporting the build and resetting your project configuration. In this case, try removing the `build.sbt`, `project` directory and `.idea` directory from your project and then configure it again.

0

I think you are right, that's what's happening, however, the jar files added in the lib folder are automatically added to the class path by the build.sbt and I think IJ should do the same without me having to do anything. I ended up using git to discard the changes after I restart IJ (I commit code every day).

0

Please sign in to leave a comment.