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 theWidget Framework Core
distribution. CreateCustomResources.properties
files in thesrc/main/resources/com/escenic/framework/custom
directory in various maven modules and put appropriate key-value pairs in them. -
Run
mvn clean install
command inmisc/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 inmisc/demo
folder should be updated so that it mergesCustomResources.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 classcom.escenic.widgetframework.DemoWebappResourceModifier
during the build :<argument>/com/escenic/framework/custom/CustomResources.properties</argument>
-
Run
mvn clean install
command inmisc/demo
directory. The demo webapp war file will be available undermisc/demo/target
folder. The mergedCustomResources.properties
file will be inWEB-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.