Adding Resource Files
This section describes a specific application of the technique
described in Adding Resource Transformers.
You might need to do this if you have extended some of the core
widgets in some way and need to add your own string definitions. These
need to be added in the appropriate locations with each widget, but
kept in separate files from the supplied strings. We'll assume that
your objective is to generate an output properties file called
com/escenic/framework/custom/CustomResources.properties
.
To do this you need to:
-
Find the required widget folders under your Widget Framework distribution's
misc/widgets
folder (misc/widgets/widget-core-teaser
, for example). -
Create a
custom
folder in each of the widgets'src/main/resources/com/escenic/framework
folders. -
Create a
CustomResources.properties
file in each of the custom folders -
Add the required property definitions to your
CustomResources.properties
files -
Run
mvn clean install
in the distribution'smisc/widgets
folder. This will install the updated widget artifacts in your local repository. -
Add a resource transformer to merge your new resource file, as described in Adding Resource Transformers:
<configuration> <transformers combine.children="append"> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>WEB-INF/classes/CustomResources.properties</resource> </transformer> </transformers> </configuration>
Now, when you build your publication, your merged
CustomResource.properties
will be included in the
WEB-INF/classes/com/escenic/framework/custom
folder
of your publication WAR file.