Adding New Resource Bundles

Let's assume that you want to add a new resource bundle (/com/escenic/framework/custom/CustomResources.properties) for the core widgets. You need to go through the following steps :

  • Go to the misc/widgets directory of the Widget Framework Core distribution. Create CustomResources.properties files in the src/main/resources/com/escenic/framework/custom directory in various maven modules and put appropriate key-value pairs in them.

  • Run mvn clean install command in misc/widgets folder. All the updated artifacts will now be installed in your local repository.

  • Go to the misc/demo directory.

  • The shade plugin configuration in the pom.xml file in misc/demo folder should be updated so that it merges CustomResources.properties files during the build. To be specific, the following additional configuration should be added :

    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
       <resource>WEB-INF/classes/com/escenic/framework/custom/CustomResources.properties</resource>
    </transformer>
            
  • The pom.xml file should also be updated so that an additional argument is passed to the class com.escenic.widgetframework.DemoWebappResourceModifier during the build :

    <argument>/com/escenic/framework/custom/CustomResources.properties</argument>
            
  • Run mvn clean install command in misc/demo directory. The demo webapp war file will be available under misc/demo/target folder. The merged CustomResources.properties file will be in WEB-INF/classes/com/escenic/framework/custom folder within the war. It will contain all the key-value pairs that you defined in the first step.