title: Play Framework: How to configure compileable [LESS] assets outside of /app
body: <p>I have a play 2.0.2 (scala) project which uses bootstrap.  I've added bootstrap as a git submodule so that I can easily change its version without having to copy individual files around.</p>
  
  <p>My project structure looks like:</p>
  
  <pre><code>project
    |_ bootstrap
    |    \_ img
    |    \_ js
    |    \_ less
    |         \_ bootstrap.less
    |         \_ responsive.less
    |_ app
         \_ assets
              \_ css
                  \_ my.less
  </code></pre>
  
  <p>My Build.scala has:</p>
  
  <pre><code>def customLessEntryPoints(base: File): PathFinder = (
      (base / "app" / "assets" / "css" * "*.less") +++
      (base / "bootstrap" / "less" / "bootstrap.less") +++
      (base / "bootstrap" / "less" / "responsive.less")
  )
  
  def externalAssets(base: File): PathFinder = (base / "bootstrap")
  val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
    playAssetsDirectories &lt;+= baseDirectory / "bootstrap",
    playExternalAssets &lt;+= baseDirectory.apply(file =&gt; (file, externalAssets(_), "bootstrap")),
    lessEntryPoints &lt;&lt;= baseDirectory(customLessEntryPoints)
    // other settings
  )
  </code></pre>
  
  <p>When I access the web application after doing "~ run", (or if I run play-copy-assets) I get:</p>
  
  <pre><code>[error] {file:/&lt;path_to_project&gt;/}&lt;project&gt;/*:play-copy-assets: No mapping for &lt;path_to_project&gt;\bootstrap\less\bootstrap.less
  [error] application -
  
  ! Internal server error, for request [GET /] -&gt;
  
  play.api.UnexpectedException: Unexpected exception [RuntimeException: No mapping for &lt;path_to_project&gt;\bootstrap\less\bootstrap.less]
      at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:233) ~[na:na]
      at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:226) ~[na:na]
      at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
      at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4.apply(PlayReloader.scala:226) ~[na:na]
      at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4.apply(PlayReloader.scala:224) ~[na:na]
      at scala.Either$LeftProjection.map(Either.scala:183) ~[scala-library.jar:0.11.3]
  java.lang.RuntimeException: No mapping for &lt;path_to_project&gt;\bootstrap\less\bootstrap.less
      at scala.sys.package$.error(package.scala:27) ~[scala-library.jar:na]
      at scala.Predef$.error(Predef.scala:66) ~[scala-library.jar:0.11.3]
      at sbt.Mapper$$anonfun$fail$1.apply(PathMapper.scala:26) ~[na:na]
      at sbt.Mapper$$anonfun$fail$1.apply(PathMapper.scala:26) ~[na:na]
      at sbt.Alternatives$$anon$1$$anonfun$$bar$1$$anonfun$apply$3.apply(PathMapper.scala:61) ~[na:na]
      at sbt.Alternatives$$anon$1$$anonfun$$bar$1$$anonfun$apply$3.apply(PathMapper.scala:61) ~[na:na]
  </code></pre>
  
  <p>I'd like the img and js subfolders of bootstrap to be served as assets (alongside or in a different path to the static ones in public) and the bootstrap|responsive.less files compiled into css and served as well.  </p>
  
  <p>The custom entry points work fine.  That is, if I change them so they're all under /app and move the less files from bootstrap in there, they work.  If I move the image and js files under public, that works too.  But what I'm trying to achieve is the clean separation.</p>
  
  <p>I'm pretty sure I haven't correctly understood how to use playAssetsDirectories and playExternalAssets, I've tried many variations for these settings.  I'm not sure if what I'm trying is possible or how the settings should relate - e.g. does a lessEntryPoint have to be in an asset directory, and are externalAssets considered asset directories?  Can anyone point out where I'm going wrong?  Thanks in advance.</p>