I answered a similar question at fooobar.com/questions/1004889 / .... I think the same answer will be applied to you.
You can choose the location that you prefer rather than in dedicated folders for specific tasks. For example, you can create the / resources folder. Do not create a resource folder inside the folder / application, as this is only a place to store code. The same thing happens with other specific folders. Then you can use
import import play.Play; Play.application().getFile("relative_path_from_<Project_Root>);
to access the file inside your code.
Only this works fine in the dev environment. But once you put this into production using the dist file, it will not work, since the entire resource folder that you put will not be added to dist. To do this, you need to explicitly ask the game to add the / resources folder to your level. To do this, you need to go to your /build.sbt and add these lines
import com.typesafe.sbt.packager.MappingsHelper._ mappings in Universal ++= directory(baseDirectory.value / "resources")
Now, if you take and check your level, you can see that it has additional resources of "resources". Then it will work for the production environment.
source share