I’m working on a rather large project and recently we have been getting more an more builds on the build server failing due to what seems to be a race condition between generating the routes files and compiling them and compiling the scala.html files. We get errors like the following
[info] Compiling 752 Scala sources and 2695 Java sources to /home/********/target/classes...
[error] /home/********/app/views/bookingarea/main.scala.html:14: value Application is not a member of object controllers.extranet.routes
[error] <script src="@controllers.extranet.routes.Application.javascriptRoutes" type="text/javascript" ></script>
[error] ^
[error] /home/********/app/views/extranet/accommodations/accommodation.scala.html:23: value Products is not a member of object controllers.extranet.routes
[error] url: '@controllers.extranet.routes.Products.listSlugs(controllers.extranet.ProductCategoryW.forProduct(accommodation), accommodation.getId())',
[error] ^
The exact same code will then successfully build in a second attempt.
Is there a way to ensure the routes have been generated before the twirl templates are compiled?