Introduction

This part of the documentation explains how to build extensions on top of the SPARTA meta-models and threat elicitation engine. SPARTA’s functionality is available in two forms:

  • as Eclipse plug-ins, for extensions that run inside Eclipse or an Eclipse-based tool such as the SPARTA product, and

  • as standalone Maven libraries and command-line tools, for Java programs and build pipelines that run outside Eclipse.

Both forms share the same code: the standalone libraries package the Eclipse plug-ins as plain Maven artifacts. SPARTA is open source under the Eclipse Public License 2.0 (EPL-2.0).

Note

If you are developing extensions on top of SPARTA, please use the following citation:

Laurens Sion, Dimitri Van Landuyt, Koen Yskout, Wouter Joosen, SPARTA: Security & Privacy Architecture through Risk-driven Threat Assessment, 2018 International Conference on Software Architecture Companion (ICSA-C), Seattle, United States, May 3, 2018.

Contents of the developer guide

Building SPARTA from source

How to get the SPARTA source code, build the plug-ins, update site, product and standalone libraries with Maven, and set up Eclipse to work on SPARTA itself.

Advanced concepts in SPARTA

Overview of the SPARTA meta-model covering DFD models, solution catalogs, threat type catalogs, attacker profiles and data models.

SPARTA Java API

The Java classes to work with SPARTA models, run the threat elicitation and risk analysis, and aggregate and export the results; the same in Eclipse and standalone.

SPARTA in Eclipse

The SPARTA Eclipse plug-ins and features, their dependencies, the parts you can extend, and the SPARTA product.

SPARTA Standalone libraries

The standalone Maven libraries (sparta-model, sparta-core, sparta-analysis, sparta-io), how to add them to a Maven project, and what is specific to using them outside Eclipse.

Command-line tools

The sparta-cli and sparta-ci command-line tools.

Development scenarios

Code for common tasks: creating, saving and loading models, pairing a threat type catalog, creating and applying solutions, running the threat elicitation and risk analysis, reading, analyzing and exporting the results, and extending the meta-model.

Example project

A complete example project that uses the standalone libraries.

Writing the threat patterns of a threat type catalog does not require any programming; it is described in the user guide (see Writing threat type patterns).

Prerequisites

Hint

Before continuing make sure that you are familiar with the basic concepts used in SPARTA. These are explained in the user guide, see Concepts used in SPARTA.

Eclipse Prerequisites

The following setup is recommended for development using Eclipse:

  • Eclipse IDE for RCP and RAP Developers (2025-06),

  • Java 21 (a JDK 21).

SPARTA 2026.2 is built for Eclipse 2025-06 and uses EMF, Sirius 7.4 and VIATRA 2.9.1. The SPARTA plug-ins are compiled for Java 21.

Changed in version 2026.2: The SPARTA plug-ins are compiled for Java 21; earlier releases were compiled for Java 11, and the plug-ins generated from the meta-model for Java 8.

To develop your own plug-ins on top of SPARTA, make the SPARTA plug-ins available to your workspace in one of the following ways:

  • Install the SPARTA features into your Eclipse IDE with Help ‣ Install New Software… from the SPARTA update site (see Installing SPARTA). The update site also contains the third-party plug-ins SPARTA needs, such as Sirius and VIATRA. Eclipse’s default target platform, which is named “Running Platform”, contains the plug-ins installed in the IDE, so your plug-in projects can then use the SPARTA plug-ins directly.

  • Add the SPARTA update site, or a local update site that you built yourself (see Building SPARTA from source), as a location to your own target definition.

The plug-ins and features you can depend on are described in SPARTA in Eclipse. To work on the SPARTA plug-ins themselves, clone the repository and use the SPARTA target platform, as explained in Building SPARTA from source.

Which modeling tooling you need in the IDE depends on what you want to develop. The SPARTA target platform already contains these components to compile and run against, but their editors and code generators must be installed into the IDE itself:

EMF - Eclipse Modeling Framework SDK

For editing the meta-model (spartamodel.ecore) and generating EMF code from a .genmodel, for example to extend the meta-model (see Development scenarios).

Ecore Diagram Editor (SDK), provided by EcoreTools

For viewing and editing the meta-model as a class diagram (model/spartamodel.aird in the sparta.spartamodel plug-in).

Sirius 7.4 specification tooling

For editing the Sirius specification of the graphical DFD editor (description/sparta.odesign in sparta.design) or developing your own graphical representations.

VIATRA Query SDK 2.9.1

For editing VIATRA query patterns (.vql files), including the generic patterns in sparta.queries, and generating their Java code.

The graphical meta-model editor is the EcoreTools Ecore Diagram Editor. You do not need to install the Graphical Modeling Framework (GMF) yourself: the GMF runtime is a dependency of Sirius.

The SPARTA target platform takes these components from the following repositories:

Standalone Prerequisites

The standalone libraries are regular Maven artifacts. They all have the groupId be.kuleuven.cs.distrinet.sparta and, for this release, the version 2026.2.0:

  • sparta-model: the SPARTA meta-model, to create, load and save models,

  • sparta-core: the threat elicitation engine and risk analysis,

  • sparta-analysis: aggregate analyses over lists of threats,

  • sparta-io: exports of threats to various file formats,

  • sparta-cli and sparta-ci: the command-line tools, each also available as a runnable shaded jar.

Each library brings in the libraries it builds on, for example sparta-io depends on sparta-analysis, sparta-core and sparta-model. SPARTA Standalone libraries describes the libraries in detail, and Command-line tools describes the command-line tools.

The libraries are compiled for Java 21, so your project needs Java 21 or later.

Changed in version 2026.2: The libraries require Java 21; earlier releases were compiled for Java 11.

Released versions are published to the SPARTA Maven repository, https://maven.sparta.distrinet-research.be. Some of the dependencies, such as VIATRA 2.9.1, are not available from Maven Central but from the Eclipse repository https://repo.eclipse.org/content/groups/releases/. The SPARTA parent POM already declares this repository, but declaring it in your own project as well makes the setup explicit, and makes sure you include it if you use a repository mirror.

<repositories>
   <repository>
      <id>sparta-repository</id>
      <url>https://maven.sparta.distrinet-research.be</url>
   </repository>
   <repository>
      <id>eclipse</id>
      <url>https://repo.eclipse.org/content/groups/releases/</url>
   </repository>
</repositories>

Then import the BOM (bill of materials) be.kuleuven.cs.distrinet.sparta:standalone and add the libraries you need as dependencies, for example:

<dependencyManagement>
   <dependencies>
      <dependency>
         <groupId>be.kuleuven.cs.distrinet.sparta</groupId>
         <artifactId>standalone</artifactId>
         <version>2026.2.0</version>
         <type>pom</type>
         <scope>import</scope>
      </dependency>
   </dependencies>
</dependencyManagement>

<dependencies>
   <dependency>
      <groupId>be.kuleuven.cs.distrinet.sparta</groupId>
      <artifactId>sparta-core</artifactId>
      <version>2026.2.0</version>
   </dependency>
</dependencies>

The standalone BOM sets the versions of the third-party libraries that SPARTA is built with (see SPARTA Standalone libraries). Do not leave it out: without it, Maven resolves an older org.eclipse.equinox.common (3.17.100) that is signed differently from org.eclipse.core.runtime, and the first analysis fails with java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package.

Changed in version 2026.2: Import the standalone BOM.

Warning

In SPARTA 2026.2, the threat analysis fails when the path of the SPARTA jars contains a space, for example when your local Maven repository is in C:\Users\Jane Doe\.m2. new Engine(...) or runAnalysis then fails with a com.google.inject.ProvisionException caused by a NoSuchFileException for the jar be.kuleuven.cs.distrinet.sparta.queries-2026.2.0.jar. Move the local Maven repository to a folder without spaces, for example with <localRepository>C:\m2\repository</localRepository> in your Maven settings.xml.

You do not need any Tycho plug-in in your own project. Maven may print warnings that it cannot access repositories “with type p2”. These repositories are inherited from the SPARTA parent POMs, which are used to build SPARTA itself, and you can ignore the warnings.

API documentation

The Javadoc of SPARTA 2026.2.0 is available online at https://downloads.sparta.distrinet-research.be/docs/2026.2.0/apidocs/. From the 2026.2 sources, you can only generate the Javadoc of the command-line tools sparta-cli and sparta-ci (see Signing and Javadoc). The Javadoc covers the meta-model (spartamodel, spartamodel.provider, spartamodel.util), the engine (core and its subpackages), the generic queries (queries and queries.internal), the exporters (io and its subpackages), the aggregated threat analyses and the Eclipse user interface (analysis and its subpackages, design) and the command-line tools (cli and its subpackages); all package names start with be.kuleuven.cs.distrinet.sparta. The meta-model implementation classes (spartamodel.impl) and the generated tree editor (spartamodel.presentation) are not included.