Multi-project play dependency auto-reloading problems

43 views
Skip to first unread message

Joao Lemos

unread,
Jul 29, 2015, 9:47:56 AM7/29/15
to play-framework
Hi,

I have a play project - lets call this app as appA -  that has a dependency for another play project - appB.

I'm running in dev mode the appA using the command sbt run.

Any change that are made in my code in appA, accordingly with the default behavior of Play, I'm hoping to refresh my web page and see the result of that change. However, although in the console appears the message  "Compiling 1 Java source to xpto\app\appA\target\scala-2.11\classes..." my web page remains with the same content and do not show the changes made.

If I remove the dependency from my build settings, any change that are made in appA are shown in each refresh of my web page.

I'm using build.scala that extends sbt.Build to set the build properties of the project.

appA settings:
organization := "com.example",
version := "1.0-SNAPSHOT",
scalaVersion := "2.11.5",
scalaVersion in GlobalScope := "2.11.5"

appB settings:
organization := "com.example.example",
scalaVersion := "2.11.5",
version := "1.0-SNAPSHOT",
dependencyOverrides += "org.scala-lang" % "scala-library" % scalaVersion.value,
resolvers := baseResolvers,
publishMavenStyle := true,
parallelExecution := false,
publishArtifact in(Compile, packageDoc) := false,
scalacOptions := Seq("-g:vars", "-unchecked", "-deprecation", "-feature", "-optimize", "-encoding", "UTF8","-language:reflectiveCalls"),
javacOptions in Compile ++= Seq(
"-encoding", "UTF8", "-Xlint:-options", "-source", "1.7", "-target", "1.7",
"-Xlint:-serial", "-Xlint:-path"),
crossPaths := false,
cleanFiles <+= baseDirectory { base => base / "project/project/target" },
cleanFiles <+= baseDirectory { base => base / "project/target" },
cleanFiles <+= baseDirectory { base => base / "target" },
outputStrategy := Some(StdoutOutput),
packagedArtifacts in publish := {
val artifacts: Map[sbt.Artifact, java.io.File] = (packagedArtifacts in publish).value
val assets: java.io.File = (playPackageAssets in Compile).value
artifacts + (Artifact(moduleName.value, "jar", "jar", "assets") -> assets)
},
packagedArtifacts in publishLocal := {
val artifacts: Map[sbt.Artifact, java.io.File] = (packagedArtifacts in publishLocal).value
val assets: java.io.File = (playPackageAssets in Compile).value
artifacts + (Artifact(moduleName.value, "jar", "jar", "assets") -> assets)
},
packagedArtifacts in publishM2 := {
val artifacts: Map[sbt.Artifact, java.io.File] = (packagedArtifacts in publishM2).value
val assets: java.io.File = (playPackageAssets in Compile).value
artifacts + (Artifact(moduleName.value, "jar", "jar", "assets") -> assets)
}

Useful information about the environment set up:
sbt version 0.13.5
scala version 2.11.5
play framework 2.3.9 (sbt-plugin)

Any help will be very appreciated.

Thanks! 
Reply all
Reply to author
Forward
0 new messages