Description

This article discusses best practices for defining and structuring resource subdirectories.  To understand why and where resource subdirectories are useful with GenRocket, see What are V2 Receivers? 


resourceSubDir

The resourceSubDir parameter is used to define a subdirectory, under the resourcePath, where one or more configuration files may exist. This allows a user the ability to organize the configuration files in a very structured manner. For example, on my local computer, we might place each configuration file within its own subdirectory:

  • /Users
    • /htaylor
      • dbConfigs
        • oracle
          • config.properties
        • mssql
          • config.properties
        • mysql
          • config.properties

However we decide to structure our configuration files, we only need one global resource variable, resource.jdbc.directory, to be referenced by any V2 Receiver to establish a base directory for all resource configuration files on the local computer.


As an example, in the scenario we described above, where the user needs to reference six different databases, three for Project Version A and another three for Project Version B, we can create a set of subdirectories under a base directory to manage my configuration files, and set the subdirectory and resourceName parameters on any V2 Receiver, in either Project Version, with ease and flexibility. For example, on a local computer, we might create the following structure:

  • /Users
    • /htaylor
      • dbConfigs
        • oracleV1
          • config.properties
        • mssqlV1
          • config.properties
        • mysqlv1
          • config.properties
        • oracleV2
          • config.properties
        • mssqlV2
          • config.properties
        • mysqlV2
          • config.properties

We could also set up my structure in a completely different way:

  • /Users
    • /htaylor
      • dbConfigs
        • oracle
          • config.v1.properties
          • config.v2.properties
        • mssql
          • config.v1.properties
          • config.v2.properties
        • mysql
          • config.v1.properties
          • config.v2.properties

Setting up your directory structure really depends on what best suits your needs. For example, the subdirectories could be names of clients or names of releases. 


A Note About V2 Receivers

The power of the V2 Receivers is that you will have the flexibility to create the directory structure you want with no major management overhead to setting or modifying V2 Receiver parameters.