I’m quite new to Gatling and I’m wondering if there is a possibility to have some resources outside the simulations folder. As the project size is growing up quickly, I want to have only simulations in the simulations folder and all other files in the resources folder. So the exemplary file structure looks like this:
I thought that it would be enough to create a package called “folder1” for file1 and file2 but importing this doesn’t work for sim1 and sim2 file. I’ve also tried calling this package resources.folder1 but then I’ve got this problem:
not found: object resources
So my first question is if that solution with the “resources” folder is even possible. If so, I would be grateful if someone can give me a lead how can I do this
Thanks in advance!
P.S. Sorry for using such meaningless names but the project is commercial.
That can’t works. resources are for files that don’t need to get compiled, eg feeders and body templates. Scala files must go in simulations.
Maybe I didn’t write is such clearly as I thought but that’s exactly what I wanted to do - move some basic configuration (as urls), feeders and templates to the resources folder mentioned in my previous post.
Btw, all of the files (including templates and feeders) have .scala extension, so I think I don’t understand your last sentence.
You can code your project using standard conventions if you use either Maven or SBT to do the building. Then, you can keep your source code in one folder, and the resources in another, and all that fun stuff. To learn how that is done, you can read the docs for each of the respective plugins:
And you may be able to find seed projects to use as a starting point. I have one for SBT here: https://github.com/JohnArrowwood/gatling-sbt-seed
Side note, to echo what Stéphane said: You can’t put things that need to be compiled into a resources folder. You said that all of the files, including templates and feeders, have a .scala extension. If they are actually Scala source files, you can’t move them to Resources. If they are just regular files (e.g. csv files) with a .scala extension . . . don’t do that!