Red Hat Training

A Red Hat training course is available for Red Hat JBoss Operations Network

3.3. Validating Server-Side Plug-ins

The JBoss ON server includes special classes that validate server-side plug-ins as part of the Maven build process.
Validation means that the build process checks that the server-side plug-in descriptor is acceptable and complete. Every server-side plug-in is checked for a handful of things:
  • The XML is well-formed and validates with the configured server plug-in XML schema
  • If a plug-in component is specified, its class is found in the plug-in JAR and can be instantiated
  • All scheduled jobs are configured properly
  • The plug-in has a valid version
  • The plug-in configuration is declared correctly
NOTE
Plug-in validation is executed during the Maven build process when creating the JAR file. If the plug-in JAR is built using another system or on a different machine, then validation isn't run.
To automatically validate a plug-in during a build using Maven; any plug-ins to be validated must be added to the validator's pom.xml configuration file.
  1. Open the pom.xml file in the sourceRoot/modules/enterprise/server/plugins/validate-all-serverplugins/ directory.
  2. Add a <pathelement> line to the file which points to the custom server-side plug-in JAR file. For example:
    <pathelement location="../myPlugin/target/myPlugin.jar" />
    
  3. Build the plug-in.
    mvn install
    
TIP
The RHQ source code includes a validator utility which can be used with custom plug-in infrastructure. This is contained in the org.rhq.enterprise.server.plugin.pc.ServerPluginValidatorUtil class.