0

I'm using xsbt-web-plugin to create an exploded WAR file of a project containing both Java and Scala sources. The file is src/main/java/conf/application.conf and this is the way I believed would work:

webappWebInfClasses := true

// ...

mappings in (Compile, packageBin) += {
    ((javaSource in Compile).value / "conf" / "application.conf") -> "conf/application.conf"
}

When using show compile:packageBin::mappings in sbt, I see that the mapping is created correctly, but the file is never copied.

Note that xsbt-web-plugin goes over all of the files and manually copies them since webappWebInfClasses is set to true.

I'm using sbt 0.13.8, xsbt-web-plugin 2.0.2.

Omer van Kloeten
  • 11,800
  • 9
  • 42
  • 53
  • I would also appreciate any advice on how to debug an sbt build (add a breakpoint?) inside IntelliJ IDEA... – Omer van Kloeten Jul 19 '15 at 18:35
  • 1
    To debug an xsbt-web-plugin application, you can enable the standard Java remote debugging port via `javaOptions in Jetty ++= Seq("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000")`. – earldouglas Jul 19 '15 at 23:05

1 Answers1

1

It's funny how it takes only a few minutes from putting it to writing to finding the issue. I was looking for the file in the target/scala-2.11/classes directory after running compile, when the scope is the WAR file itself.

Running package and extracting the WAR file showed the file where it was supposed to be.

Omer van Kloeten
  • 11,800
  • 9
  • 42
  • 53
  • 1
    The *classes/* directory (if any) included in the *.war* file by the `package` task can be found in *target/webapp/WEB-INF/classes/* after running `webappPrepare`. – earldouglas Jul 19 '15 at 23:08