Widget Packaging
Widgets are packaged as Maven WAR artifacts. The Widget Framework includes two artifacts for assisting in the development and packaging of widgets:
widget-framework-widgets
-
A master artifact that acts as the parent POM for all widget artifacts and manages the process of building widgets.
widget-framework-webapp-sdk
-
This artifact acts as an SDK for widget development. Including a dependency on this module reduces the number of framework dependencies needed for widget development.
The following pom.xml
snippet shows how to
package the example Hello world widget described in
Creating a JSP Custom Widget.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>widget-framework-widgets</artifactId> <groupId>com.escenic.widget-framework>/groupId> <version>3.6.0.179792</version> </parent> <groupId>custom.widget</groupId> <artifactId>widget-hello-world</artifactId> <version>$version</version> <packaging>war</packaging> <dependencies> <dependency> <groupId>com.escenic.sdk</groupId> <artifactId>widget-framework-webapp-sdk</artifactId> <version>3.6.0.179792</version> <type>pom</type> </dependency> ... other dependencies ... </dependencies> </project>
This will result in the production of three artifacts:
widget-hello-world-
version-blueprint.war
-
This WAR file contains the configuration components of your widget, and is intended for use in blueprints.
widget-hello-world-
version-site.war
-
This WAR file contains the presentation components of your widget, and is intended for use in site publications.
widget-hello-world-
version.war
-
This WAR file contains both the configuration and presentation components of your widget, and is intended for use in legacy publications.