Build Plug-ins

How to build and install a plug-in

This page describes how to build new Weasis plug-ins and how they can be incorporated into the distributions, see also this page for the IDE configuration.

List of plug-ins types

  • Media viewer or editor (main central panel that implements ViewerPlugin or ImageViewerPlugin and the factory implements SeriesViewerFactory)
  • Toolbar associated with a viewer (implements Toolbar)
  • Tool associated with a viewer (right panel that implements DockableTool)
  • Data Explorer (data model implements DataExplorerModel and data view implements DataExplorerView, and the factory implements DataExplorerViewFactory)
  • Import data into an explorer (ex. ImportDicom and the factory implements DicomImportFactory)
  • Export data into an explorer (ex. ExportDicom and the factory implements DicomExportFactory)
  • DICOM editor or viewer for special modalities (DicomSpecialElementFactory and SeriesViewerFactory), see weasis-dicom-sr
  • Media codec (implements Codec)
  • Preferences (implements PreferencesPageFactory)
  • UI aggregator. This is the application main user interface bundle. The maven artifact of this bundle must be defined in (ex. weasis.main.ui=weasis-base-ui)

See the Weasis Architecture to understand the plug-in hierarchy.

Build plug-ins from Maven archetype

  1. From the folder Weasis/archetype execute: mvn install
  2. Generate a sample project by executing the following command: mvn archetype:generate -DarchetypeCatalog=local
  3. Select the archetype:
    • weasis-plugin-base-viewer-archetype (example of a toolbar and a tool for the non DICOM viewer)
    • weasis-plugin-dicom-viewer-archetype (example of a toolbar and a tool for the DICOM viewer)

From Eclipse: File > New > Maven Project and Search for weasis archetype in catalog filter.
From Intellij: File > New Project > Maven, select the “Maven Archetype” generators and select a Weasis archetype from Default local catalog.


In the pom.xml of the new plug-in, the tag <relativePath> must be adapted to your relative path of Weasis sources.
The default value is <relativePath>../Weasis/weasis-parent/pom.xml</relativePath>

Install plug-ins


This documentation has not been updated since version 4.2.0 where the properties configuration files have been replaced by json files.

The way to add plugins will also evolve soon with the new weasis-manager component.

For the installed distribution

The file “app/conf/” must be adapted and plug-ins must be placed in the directory “app/plugins”.

Example with weasis-isowriter:

  • Add in app/conf/${weasis.codebase.url}/plugins/weasis-isowriter-2.6.1.jar

    If you want to use another directory for a plugin on your computer, you should use one of the following properties:
    On Windows:
    On linux:
    On macOS:


    For not modifying the current create a new file and add to the launcher the following VM argument:"file:///your_plugin_path/"

  • Place the file “weasis-isowriter-2.6.1.jar” in the directory “/weasis/plugins”

For the WEB distribution

Build a new war file containing the plug-ins and the file.

  • Build “weasis-ext.war” with the following structure:

        ├── conf/
        │   ├──
        ├── WEB-INF/
        │   ├── web.xml
        ├── plugin1.jar
        └── plugin2.jar

  • In /weasis-ext/conf/, add the plug-ins references: \
     ${weasis.codebase.ext.url}/plugin1.jar \

    Using ${weasis.codebase.ext.url} allows you to keep the base URL abstract, so moving the package to another server won’t be a problem. Otherwise absolute URLs must be used. The default value of ${weasis.codebase.ext.url} is ${weasis.codebase.url}-ext.

  • weasis-ext is the default web context when launching Weasis, using another web context requires modifying the property weasis.ext.url, it can be done by:


  • Changing the property in weasis-pacs-connector configuration.


    It is also possible to add the code base for plugins (cdb-ext) directly in the URL:



For debugging a specific configuration: add to the launcher the following VM argument:"http://server:port/weasis-ext/conf/

An example that makes a package of weasis-isowriter plugin:

  • Build “weasis-ext.war”:
        ├── conf/
        │   ├──
        ├── WEB-INF/
        │   ├── web.xml
        └── weasis-isowriter-2.0.3.jar

Build OSGi services

All the plug-in type described in the list above are OSGi services that are registered and aggregated in the GUI. Building the plug-in from the Maven archetype will configure the OSGi service automatically. For adding new OSGi services, here is the procedure:

  1. Create a class implementing one of the plug-in types and add at least the annotations @Component and @Service, for instance:

    @Component(immediate = false)
    public class SamplePrefFactory implements PreferencesPageFactory {

    For more information about annotations see the Apache Felix SCR Annotations.

  2. Add in pom.xml of the plug-in the maven-scr-plugin (to generate XML file from the Java annotations) and the property for loading any XML file in maven-bundle-plugin: