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.
git clone https://github.com/SPARTA-Threat-Modeling/SPARTA.git
Prerequisites
- JDK 21
The build uses Java 21. Tycho resolves the plug-ins against the
JavaSE-21execution environment, because the Eclipse 2025-06 platform requires a recent Java version, and the product build bundles a Java 21 runtime.- Maven
Use Maven 3.9.0 or later, which is the minimum version for Tycho 4.0.13, the Tycho version that SPARTA 2026.0 uses.
- Network access
The build downloads the Eclipse platform, Sirius, VIATRA and third-party libraries from the repositories below.
The Maven build resolves its dependencies from the repositories declared in the root pom.xml:
eclipse-releaseEclipse platform, EMF, Sirius and other Eclipse projects (p2 repository). https://download.eclipse.org/releases/2025-06
viatra-p2VIATRA plug-ins (p2 repository). https://download.eclipse.org/viatra/updates/release/2.9.1
viatra-mvnVIATRA Maven artifacts. https://repo.eclipse.org/content/groups/viatra2/
eclipse-orbitThird-party libraries, such as Apache POI, Jackson and Commons Math (p2 repository). https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2025-06
jre-updatesJava 21 runtime (Eclipse JustJ) for the product (p2 repository). https://download.eclipse.org/justj/jres/21/updates/release/latest
gitlab-mavenSPARTA artifacts in the KU Leuven GitLab package registry. https://gitlab.kuleuven.be/api/v4/projects/3377/packages/maven
This repository is not publicly accessible. The build logs
401 Unauthorizedwarnings for it, which you can ignore: the build does not need it.
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/viatra/.
Warning
The https://repo.eclipse.org/content/groups/viatra/ repository no longer exists.
Unless viatra-maven-plugin 2.9.1 is already in your local Maven repository, the build fails in sparta.queries with the error Plugin org.eclipse.viatra:viatra-maven-plugin:2.9.1 or one of its dependencies could not be resolved.
Before you build, change the plug-in repository URL in bundles/be.kuleuven.cs.distrinet.sparta.queries/pom.xml to https://repo.eclipse.org/content/groups/viatra2/.
If the build already failed, add -U to the next Maven command, because Maven caches the failed lookup.
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:
bundlesThe 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.ioandsparta.threatanalysis(all prefixed withbe.kuleuven.cs.distrinet.). They are described in SPARTA in Eclipse.featuresThe four SPARTA Eclipse features:
sparta.feature,sparta.modeling.feature,sparta.graphicalmodeling.featureandsparta.threatanalysis.feature.relengRelease engineering:
be.kuleuven.cs.distrinet.sparta.update(the p2 update site) andbe.kuleuven.cs.distrinet.sparta.product(the SPARTA product definition, its icons, and the target platform filetarget-platform.target, see Working in Eclipse).standaloneThe standalone Maven modules
sparta-model,sparta-core,sparta-analysis,sparta-io,sparta-cliandsparta-ci(see SPARTA Standalone libraries). The folder also containsstandalone-dependencies, which is no longer part of the build.
Other files in the root directory are LICENSE (EPL-2.0), EPL-header.txt (the license header template for source files), README.md and README.maintainers.md.
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.
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).
The build does not run any tests: the only test plug-in, sparta.spartamodel.tests, is an empty placeholder.
Installing the libraries in your local Maven repository
The SPARTA Maven repository does not host the 2026.0.0 artifacts. To use them in your own Maven projects (see Standalone Prerequisites), install them into your local Maven repository:
mvn clean install
install also runs the integration-test phases, so this builds the SPARTA product 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:*:2026.0.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.
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/repositoryA 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.- SPARTA product
releng/be.kuleuven.cs.distrinet.sparta.product/target/productsCreated by
mvn verifyormvn install(not bymvn package), with one archive per platform:SPARTA-win32.win32.x86_64.zip,SPARTA-linux.gtk.x86_64.tar.gzandSPARTA-macosx.cocoa.x86_64.tar.gz. Each archive contains aSPARTA-2026.0.0folder (SPARTA.appon macOS) with theSPARTAlauncher (SPARTA.exeon Windows) and a bundled Java 21 runtime, so it runs without a separate Java installation. The unpacked products are intarget/products/SPARTA/<os>/<ws>/<arch>/.- Plug-ins and features
The
targetfolder of each module inbundlesandfeatures.- Standalone libraries and tools
standalone/<module>/targetFor example,
standalone/sparta-cli/target/sparta-cli-2026.0.0-shaded.jarandstandalone/sparta-ci/target/sparta-ci-2026.0.0-shaded.jarare 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:
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.Import the projects with , and select the root directory of your clone. This imports the root project
be.kuleuven.cs.distrinet.sparta.root, the aggregator projectsbundles,features,relengandstandalone, and all modules. If JDK 21 is the only JRE in your workspace, Eclipse warns that no JRE is strictly compatible with theJavaSE-11andJavaSE-1.8execution environments of the plug-ins. You can ignore these warnings.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.Make sure that the generated query code exists in
sparta.queries/src-gen. Thesparta.queriesproject 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).
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 , make sure that you select the SPARTA definition and not the default one.
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 4.36 and EMF SDK 2.42
- 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
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.0
The plug-in repository of the VIATRA code generator,
https://repo.eclipse.org/content/groups/viatra/, no longer exists. Unlessviatra-maven-plugin2.9.1 is already in your local Maven repository, the build fails insparta.queriesuntil you change the URL (see the warning in Prerequisites).There are no builds for ARM (
aarch64) platforms.You cannot generate the Javadoc of the Eclipse plug-ins from the sources:
javadoc:javadocfails for them, either because the classes of the other plug-ins are missing or, together withpackage, because it cannot derive a module descriptor for a jar of the Eclipse platform. The other standalone modules thansparta-cliandsparta-cihave 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
Set the version of all projects with the Tycho versions plug-in:
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.0 these are releng/be.kuleuven.cs.distrinet.sparta.update/category.xml, which refers to the main feature by version, the About texts in about.ini and plugin.properties of bundles/be.kuleuven.cs.distrinet.sparta.rcp, and the update sites of the product (updatesite/2025 and updatesite/2026 in the .product file).
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.
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.0, you can only generate the Javadoc of the command-line tools sparta-cli and sparta-ci from the sources (see Known limitations in 2026.0).
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.0.0/apidocs folder.