Building SPARTA from source

This page explains how to build SPARTA, including the Eclipse plug-ins and features, the update site, the SPARTA product, and the standalone libraries and command-line tools. It also explains how to set up Eclipse to work on the SPARTA code.

You only need this if you want to change SPARTA or need a build that is not available for download (see Installing SPARTA). To develop extensions on top of a SPARTA release, see Eclipse Prerequisites and Standalone Prerequisites instead.

Getting the source

SPARTA is developed on GitHub at https://github.com/SPARTA-Threat-Modeling/SPARTA and is licensed under the Eclipse Public License 2.0 (see the LICENSE file in the repository). Release 2026.0 is the first public version of the code, with version number 2026.0.0. Release 2026.1.0 has the git tag 2026.1.0. Release 2026.2.0 has the git tags 2026.2.0 and v2026.2.0, which point to the same commit. To build it, clone the repository and check out the tag:

git clone https://github.com/SPARTA-Threat-Modeling/SPARTA.git
cd SPARTA
git checkout 2026.2.0

Prerequisites

JDK 21

The build uses Java 21, and all SPARTA code is compiled for Java 21. Tycho resolves the plug-ins against the JavaSE-21 execution environment, and the product build bundles a Java 21 runtime.

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

Maven

Use Maven 3.9.0 or later, which is the minimum version for Tycho 4.0.13, the Tycho version that SPARTA 2026.2 uses.

Network access

The build downloads the Eclipse platform, Sirius, VIATRA and third-party libraries from the repositories below. If downloads from the Eclipse mirrors fail, add -Declipse.p2.mirrors=false to the Maven command, as the continuous integration builds do.

The Maven build resolves its dependencies from the repositories declared in the root pom.xml:

eclipse-release

Eclipse platform, EMF, Sirius and other Eclipse projects (p2 repository). https://download.eclipse.org/releases/2025-06

viatra-p2

VIATRA plug-ins (p2 repository). https://download.eclipse.org/viatra/updates/release/2.9.1

viatra-mvn

VIATRA Maven artifacts. https://repo.eclipse.org/content/groups/viatra2/

eclipse-orbit

Third-party libraries, such as Apache POI, Jackson and Commons Math (p2 repository). https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2025-06

jre-updates

Java 21 runtime (Eclipse JustJ) for the product (p2 repository). https://download.eclipse.org/justj/jres/21/updates/release/latest

gitlab-maven

SPARTA artifacts in the public SPARTA Maven repository. https://maven.sparta.distrinet-research.be

In addition, the standalone modules use Maven Central and https://repo.eclipse.org/content/groups/releases/, and the sparta.queries plug-in loads the VIATRA code generator (viatra-maven-plugin) from https://repo.eclipse.org/content/groups/viatra2/.

Project structure

The root directory of the repository contains the root Maven project be.kuleuven.cs.distrinet.sparta.root (pom.xml) with the shared build configuration, and the following folders:

bundles

The 11 SPARTA plug-ins: sparta.spartamodel, sparta.spartamodel.edit, sparta.spartamodel.editor, sparta.spartamodel.tests, sparta.design, sparta.rcp, sparta.queries, sparta.analysis, sparta.core, sparta.io and sparta.threatanalysis, and the test plug-ins sparta.core.tests, sparta.analysis.tests, sparta.io.tests and sparta.threatanalysis.tests (all prefixed with be.kuleuven.cs.distrinet.). They are described in SPARTA in Eclipse.

features

The four SPARTA Eclipse features: sparta.feature, sparta.modeling.feature, sparta.graphicalmodeling.feature and sparta.threatanalysis.feature.

releng

Release engineering: be.kuleuven.cs.distrinet.sparta.update (the p2 update site), be.kuleuven.cs.distrinet.sparta.product (the SPARTA product definition, its icons, and the target platform file target-platform.target, see Working in Eclipse), and updatesite (the files for the update site server, see Release pipelines).

standalone

The standalone Maven modules sparta-model, sparta-core, sparta-analysis, sparta-io, sparta-cli and sparta-ci (see SPARTA Standalone libraries), with their parent POM standalone.

Other files in the root directory include LICENSE (EPL-2.0), EPL-header.txt (the license header template for source files), README.md, README.maintainers.md, and the GitHub Actions workflows in .github/workflows.

Building with Maven

The entire project can be built with Maven from the root directory of the repository:

mvn clean package

This will:

  • clean all target directories,

  • generate the VIATRA pattern Java code,

  • compile all plug-ins and features,

  • generate the update site,

  • build the standalone libraries and command-line tools, and run their tests.

The SPARTA product archives are not created by mvn package: the product module materializes and archives the products in the pre-integration-test and post-integration-test phases, which come after package. To also build the product, run verify (or install) instead:

mvn clean verify

Even with package, the product module (packaging type eclipse-repository) still assembles a p2 repository with the product and its dependencies. To reduce the build time, you can exclude the product module entirely:

mvn -pl '!releng/be.kuleuven.cs.distrinet.sparta.product' clean package

On Windows (cmd.exe), use double quotes instead:

mvn -pl "!releng/be.kuleuven.cs.distrinet.sparta.product" clean package

The build packages the platform-specific parts for three environments: Linux (linux/gtk/x86_64), Windows (win32/win32/x86_64) and macOS (macosx/cocoa/x86_64).

Running the tests

The tests are in the test plug-ins sparta.core.tests, sparta.analysis.tests, sparta.io.tests and sparta.threatanalysis.tests, which Tycho runs in an OSGi runtime, and in the standalone modules sparta-cli and sparta-ci. mvn verify and mvn install run all of them; the test plug-ins run in the integration-test phase, after package. The test reports are written to target/surefire-reports in each project. The test plug-ins are not part of any feature, so they are not in the update site or the product. sparta.spartamodel.tests is still an empty placeholder.

Installing the libraries in your local Maven repository

The released SPARTA artifacts are available from the SPARTA Maven repository (see Standalone Prerequisites). To use artifacts that you built yourself in your own Maven projects, for example with your own changes, install them into your local Maven repository:

mvn clean install

install also runs the integration-test phases, so this builds the SPARTA product and runs all tests as well. If you only need the libraries, exclude the product module:

mvn -pl '!releng/be.kuleuven.cs.distrinet.sparta.product' clean install

On Windows (cmd.exe), use double quotes instead:

mvn -pl "!releng/be.kuleuven.cs.distrinet.sparta.product" clean install

Afterward, the artifacts be.kuleuven.cs.distrinet.sparta:* with the version of your checkout, for example 2026.2.0, are resolvable by other Maven projects on the same machine. This includes the standalone libraries (sparta-model, sparta-core, sparta-analysis, sparta-io, sparta-cli, sparta-ci) and the plug-in artifacts they depend on, such as be.kuleuven.cs.distrinet.sparta.spartamodel.

This version comes from the POMs of your checkout, not from a release: a build of a branch such as main can have the same version as a published release. Maven then uses your local build instead of the published artifacts with that version. To use the published artifacts again, delete the folder be/kuleuven/cs/distrinet/sparta in your local Maven repository (by default ~/.m2/repository).

Generated code

The be.kuleuven.cs.distrinet.sparta.queries plug-in contains the generic VIATRA query patterns in .vql files under src. During the build, the viatra-maven-plugin (version 2.9.1) generates the corresponding Java query classes into the src-gen folder of that plug-in. mvn clean empties src-gen, and the folder is not under version control. The other plug-ins (sparta.core, sparta.analysis) only compile once this code exists.

The Java code of the meta-model (sparta.spartamodel, sparta.spartamodel.edit and sparta.spartamodel.editor) is generated with EMF from model/spartamodel.genmodel, but it is part of the repository and the build does not regenerate it. If you change spartamodel.ecore, regenerate the code in Eclipse from the .genmodel file.

Build results

Update site

releng/be.kuleuven.cs.distrinet.sparta.update/target/repository

A p2 repository named “SPARTA Updatesite” with the four SPARTA features in the category “Threat Modeling”. It also contains all third-party dependencies (Sirius, VIATRA, EMF and so on), so you can install SPARTA from it without access to other update sites. Tycho also packs the repository as a zip file in releng/be.kuleuven.cs.distrinet.sparta.update/target; a release publishes this file as sparta-updatesite-<version>.zip.

SPARTA product

releng/be.kuleuven.cs.distrinet.sparta.product/target/products

Created by mvn verify or mvn install (not by mvn package), with one archive per platform: SPARTA-win32.win32.x86_64.zip, SPARTA-linux.gtk.x86_64.tar.gz and SPARTA-macosx.cocoa.x86_64.tar.gz. Each archive contains a SPARTA-2026.2.0 folder (SPARTA.app on macOS) with the SPARTA launcher (SPARTA.exe on Windows) and a bundled Java 21 runtime, so it runs without a separate Java installation. The unpacked products are in target/products/SPARTA/<os>/<ws>/<arch>/.

Plug-ins and features

The target folder of each module in bundles and features.

Standalone libraries and tools

standalone/<module>/target

For example, standalone/sparta-cli/target/sparta-cli-2026.2.0-shaded.jar and standalone/sparta-ci/target/sparta-ci-2026.2.0-shaded.jar are the runnable jars described in Command-line tools.

Working in Eclipse

All SPARTA projects are Maven projects with Eclipse project metadata. To work on SPARTA in Eclipse:

  1. Set up Eclipse IDE for RCP and RAP Developers (2025-06) with a JDK 21, and install the modeling tooling you need (see Eclipse Prerequisites). Install at least the VIATRA Query SDK if you want Eclipse to generate the query code of sparta.queries.

  2. Import the projects with File ‣ Import… ‣ Maven ‣ Existing Maven Projects, and select the root directory of your clone. This imports the root project be.kuleuven.cs.distrinet.sparta.root, the aggregator projects bundles, features, releng and standalone, and all modules.

  3. Set the SPARTA target platform: open releng/be.kuleuven.cs.distrinet.sparta.product/target-platform.target, wait until Eclipse has resolved its contents, and click Set as Active Target Platform in the target editor once. Wait until Eclipse has finished loading the target platform before you continue.

  4. Make sure that the generated query code exists in sparta.queries/src-gen. The sparta.queries project has the VIATRA Query and Xtext project natures, so Eclipse generates the code when it builds the project if the VIATRA Query SDK is installed. Alternatively, run the Maven build once (see Building with Maven).

During and after the import, Eclipse reports the following problems for SPARTA 2026.2, which you can ignore:

  • The dialog Error Updating Maven Configuration with the message Cannot nest 'sparta-core/src/main/resources' inside 'sparta-core/src/' for the projects sparta-core, sparta-analysis, sparta-io and sparta-model. These four projects package the plug-ins as Maven libraries and contain no sources of their own; click OK. The dialog can appear again whenever Eclipse updates the Maven projects.

  • The warning No required execution environment has been set for every plug-in except sparta.queries. These plug-ins declare that they require Java 21 with a Require-Capability header, which the Eclipse plug-in tooling does not recognize as an execution environment; the Maven build uses it.

  • The warnings Unknown referenced nature for the Sirius, VIATRA Query and Xtext natures, if you did not install that tooling in step 1.

Caution

The SPARTA target definition is named “Running Platform”, the same name as Eclipse’s default target platform. If you select the target platform in Window ‣ Preferences ‣ Plug-in Development ‣ Target Platform, make sure that you select the SPARTA definition and not the default one, which has no path. The SPARTA definition can appear up to three times, with the paths /be.kuleuven.cs.distrinet.sparta.product/..., /be.kuleuven.cs.distrinet.sparta.releng/... and /be.kuleuven.cs.distrinet.sparta.root/releng/...: these are the same file, seen through the nested projects, so you can select any of them. Until the SPARTA target platform is active, the projects show errors such as Bundle 'org.eclipse.viatra.query.runtime' cannot be resolved. If loading fails with the error Profile ... is not current, for example because you clicked Set as Active Target Platform twice, select the SPARTA definition in Window ‣ Preferences ‣ Plug-in Development ‣ Target Platform, click Reload…, and click Apply and Close.

Note

The target definition sets its environment to Windows (win32/win32/x86_64, locale en_US). On Linux or macOS, change the operating system, windowing system and architecture on the Environment tab of the target editor to match your machine.

The target platform contains the following components:

Eclipse SDK and EMF SDK, in the latest version of this repository (4.36 and 2.42)

https://download.eclipse.org/releases/2025-06

Apache Commons Math 3, Commons IO, Commons Codec, Apache POI (with OOXML), Jackson, Google Guice and SnakeYAML

https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2025-06/

m2e SDK

https://download.eclipse.org/technology/m2e/releases/latest/

Sirius 7.4.11 runtime and specification tooling

https://download.eclipse.org/sirius/updates/releases/7.4.11/2023-03

EcoreTools 3.5.2

https://download.eclipse.org/ecoretools/updates/releases/3.5.2/2023-06

VIATRA Query SDK and data binding runtime 2.9.1

https://download.eclipse.org/viatra/updates/release/2.9.1

Note

The Maven build does not use this target platform. It resolves its dependencies from the repositories in the root pom.xml (see Prerequisites), so a change to target-platform.target does not affect the Maven build.

Running SPARTA from the IDE

The product definition is the file releng/be.kuleuven.cs.distrinet.sparta.product/be.kuleuven.cs.distrinet.sparta.product. To start SPARTA with your changes, open this file in the product configuration editor and launch it as an Eclipse application. See SPARTA in Eclipse for the configuration of the product.

Known limitations in 2026.2

  • There are no builds for ARM (aarch64) platforms.

  • You cannot generate the Javadoc of the Eclipse plug-ins from the sources: javadoc:javadoc fails for them, either because the classes of the other plug-ins are missing or, together with package, because it cannot derive a module descriptor for a jar of the Eclipse platform. The other standalone modules than sparta-cli and sparta-ci have no sources of their own, so they have no Javadoc either. Use the online Javadoc instead (see API documentation); to generate the Javadoc of the command-line tools, see Signing and Javadoc.

Notes for maintainers

Updating versions

All modules must have the same version, because the standalone modules depend on the plug-in jars of the same version. We therefore strongly recommend using the Tycho versions plug-in to update versions using the following command, which changes all versions in the POMs, all MANIFEST.MF files, the four feature.xml files and the .product file together:

mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=major.minor.service.qualifier

Afterward, check the places that contain version numbers outside the Maven and OSGi metadata: in 2026.2, these are the About texts in about.ini and plugin.properties of bundles/be.kuleuven.cs.distrinet.sparta.rcp. The update site URLs in the feature.xml files and the .product file contain the year of the release (/updates/2026); a release build sets this year from the tag.

Release pipelines

A tag in the form of a version, such as 2026.2.0 or v2026.2.0 (optionally followed by .<qualifier>), starts a release build (.github/workflows/release.yml). Other tags build nothing. The release build sets the version of all projects to the version of the tag, runs the tests, creates the GitHub release with the product archives, the update site archive and the command-line tools, and updates the composite update site metadata on the gh-pages branch, from which the update site https://downloads.sparta.distrinet-research.be/updates/<year>/ is served. The plug-ins, features and standalone libraries of each release are published to the public SPARTA Maven repository (see Prerequisites). README.maintainers.md describes the pipelines and the deployment of the update site in detail.

Besides the release builds, the continuous integration runs mvn verify on pushes to main and on pull requests.

Updating license headers

All Java source files carry an EPL-2.0 license header based on EPL-header.txt (owner “DistriNet, KU Leuven”, years 2018-2026). The license-maven-plugin checks and adds these headers:

mvn license:check
mvn license:format

license:check reports the files with a missing or different header, and license:format adds or updates the headers. The configuration in the root pom.xml applies to the Java files under src in the be.kuleuven.cs.distrinet packages.

Signing and Javadoc

The POMs contain a sign profile that signs the jars and the Windows launcher. It needs signing properties that are not part of the repository, so it is only usable by the SPARTA maintainers. The release pipelines do not use it.

Javadoc generation is disabled by default (property javadoc.skip is true), and the regular build does not generate Javadoc: the root pom.xml configures the maven-javadoc-plugin without executions. In 2026.2, you can only generate the Javadoc of the command-line tools sparta-cli and sparta-ci from the sources (see Known limitations in 2026.2). First install the libraries in your local Maven repository (see Installing the libraries in your local Maven repository), and then run the goal explicitly for these two modules and enable it:

mvn -pl standalone/sparta-cli,standalone/sparta-ci -Djavadoc.skip=false javadoc:javadoc

In PowerShell, put the -D option in quotes ("-Djavadoc.skip=false"). The Javadoc of each module is written to its target/docs/2026.2.0/apidocs folder.