title: How to add local maven projects as modules to an sbt/Play project?
body: <p>I have a Maven project ("example-square"), which provides classes to calculate the square and cube of an integer.
  I also have a sbt/Play framework project ("sbt_hello"), which uses the square and cube classes from "example-square". I want to extend my "example-square" project with a number of new classes (e.g. adding a square-root class) as I go.</p>
  
  <p>To get everything work together, I've included my Maven project as a library dependency in my <code>build.sbt</code>, but I've also added it as a module in IntelliJ (using <code>File &gt; Project Structure &gt; Modules &gt; sbt_hello &gt; Dependencies &gt; Add Module Dependency...</code>).
  Running my test classes, which use the square and cube classes, is completely successful. All changes in the code are immediately reflected into the tests.</p>
  
  <p>However, when I'm refreshing my sbt project or try to run the Play project, I get the error message that there is an unresolved dependency path. </p>
  
  <p>I guess adding it as a module in IntelliJ is what allows the tests to run successfully, and adding it to the library dependencies is what makes sbt look for the jars (which I do want?), it's just looking at the wrong places. According to the error log, sbt is only looking at following folders:</p>
  
  <pre><code>[warn]  module not found: example#example-square;1.0-SNAPSHOT
  [warn] ==== local: tried
  [warn]   C:\Users\just_me\.ivy2\local\example\example-square\1.0-SNAPSHOT\ivys\ivy.xml
  [warn] ==== public: tried
  [warn]   https://repo1.maven.org/maven2/example/example-square/1.0-SNAPSHOT/example-square-1.0-SNAPSHOT.pom
  [warn] ==== local-preloaded-ivy: tried
  [warn]   C:\Users\just_me\.sbt\preloaded\example\example-square\1.0-SNAPSHOT\ivys\ivy.xml
  [warn] ==== local-preloaded: tried
  [warn]   file:/C:/Users/just_me/.sbt/preloaded/example/example-square/1.0-SNAPSHOT/example-square-1.0-SNAPSHOT.pom
  </code></pre>
  
  <p>Of course the package is not there, since it's a Maven project and I didn't run mvn install (even if I did, the jars would have been installed into <code>.m2</code>).</p>
  
  <p>I've tried adding my module via <code>File &gt; Project Structure &gt; Modules &gt; sbt_hello &gt; Sources &gt; Add Content Root</code> before, as it is documented <a href="https://www.jetbrains.com/help/idea/creating-and-managing-modules.html" rel="nofollow noreferrer">here</a>, but IntelliJ keeps removing this module, when I update my sbt project.</p>
  
  <p><strong>Q: How do I properly point to the actual Maven project from my sbt/Play project when using IntelliJ?</strong> </p>
  
  <p>Btw, I'm totally new to sbt/Play and Scala in general (I've worked with Java before though).</p>