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.
Each release has a git tag with its version number, for example 2026.3.0 for release 2026.3.0.
To build a release, clone the repository and check out its tag:
git clone https://github.com/SPARTA-Threat-Modeling/SPARTA.git
cd SPARTA
git checkout 2026.3.0
Note
The build derives the build qualifiers of the plug-ins from the git history, so it fails in a copy of the sources without the .git folder, such as the source code archive of a GitHub release, with the error No git repository found.
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-21execution environment, and the product build bundles a Java 21 runtime. Run Maven with a JDK 21: the build of the standalone modules checks that Maven runs on Java 21 and fails on any other Java version.- Maven
Use Maven 3.9.9 or later, which is the minimum version for Tycho 5.0.4, the Tycho version that SPARTA 2026.3 uses.
Changed in version 2026.3: SPARTA uses Tycho 5.0.4 instead of 4.0.13, which requires Maven 3.9.9 instead of 3.9.0.
- 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=falseto 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-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
By default, the product gets the latest JustJ release of Java 21. To build it with an earlier JustJ release, add that release to the Maven command, for example
-Djustj.release=21.0.12; the releases are listed at https://download.eclipse.org/justj/jres/21/updates/release/.gitlab-mavenSPARTA 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:
bundlesThe 11 SPARTA plug-ins:
sparta.spartamodel,sparta.spartamodel.edit,sparta.spartamodel.editor,sparta.design,sparta.rcp,sparta.welcome,sparta.queries,sparta.analysis,sparta.core,sparta.ioandsparta.threatanalysis, and the test plug-inssparta.spartamodel.tests,sparta.core.tests,sparta.analysis.tests,sparta.io.testsandsparta.threatanalysis.tests(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),be.kuleuven.cs.distrinet.sparta.product(the SPARTA product definition, its icons, and the target platform filetarget-platform.target, see Working in Eclipse),be.kuleuven.cs.distrinet.sparta.coverage(the aggregated test coverage report, see Test coverage),scripts(the script with which the release builds set the version), andupdatesite(the files for the update site server, see Release pipelines).standaloneThe standalone Maven modules
sparta-model,sparta-core,sparta-analysis,sparta-io,sparta-cliandsparta-ci(see SPARTA Standalone libraries), with their parent POMstandalone.
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, CONTRIBUTING.md and SECURITY.md (see Contributing), CHANGELOG.md (the changes of each release), .mvn/maven.config (options that Maven adds to every build of the repository), and the GitHub Actions workflows and the Dependabot configuration in .github.
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,
check the license headers of the Java source files (see License headers),
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.spartamodel.tests, 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.
The tests of sparta-ci use the example models of sparta-cli, which sparta-cli packages in its test jar sparta-cli-<version>-tests.jar.
Test coverage
mvn verify and mvn install also measure the test coverage with JaCoCo, and write the coverage reports in HTML and XML:
releng/be.kuleuven.cs.distrinet.sparta.coverage/target/site/jacoco-aggregate: the coverage of the plug-inssparta.spartamodel,sparta.queries,sparta.core,sparta.io,sparta.analysisandsparta.threatanalysisby the tests of the five test plug-ins.target/site/jacocoinstandalone/sparta-cliandstandalone/sparta-ci: the coverage of these modules by their own tests.
The test plug-ins also get a report in their own target/site/jacoco folder, but it only covers the classes of the test plug-in itself.
When you add a test plug-in, add it to the pom.xml of releng/be.kuleuven.cs.distrinet.sparta.coverage with scope test, and the plug-in it tests without a scope, so that the aggregated report includes them.
The build only measures the coverage: it does not fail on a low coverage.
The GitHub continuous integration keeps the aggregated report and the reports of sparta-cli and sparta-ci of each run as the workflow artifact jacoco-coverage, for 14 days.
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.3.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.
The POMs of sparta-cli and sparta-ci declare no dependencies, because the build replaces them with the reduced POMs of their shaded jars (see SPARTA Standalone libraries).
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).
The installed plug-ins do not affect later builds of the plug-ins themselves: .mvn/maven.config sets -Dtycho.localArtifacts=ignore, so Tycho ignores the plug-ins in your local Maven repository when it resolves the plug-ins.
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; a release publishes this file assparta-updatesite-<version>.zip.- 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.3.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.3.0-shaded.jarandstandalone/sparta-ci/target/sparta-ci-2026.3.0-shaded.jarare the runnable jars described in Command-line tools.
Working in Eclipse
All SPARTA projects are Maven projects.
The plug-in projects in bundles contain their Eclipse project metadata (.project, .classpath and .settings), because the Tycho build reads their Java compiler settings.
For the standalone projects, and for the Maven settings of all projects (org.eclipse.m2e.core.prefs), the repository contains no Eclipse metadata: the Maven integration of Eclipse (m2e) creates it from the POMs when you import the projects.
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.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.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).
During and after the import, Eclipse reports the following problems for SPARTA 2026.3, which you can ignore:
The warning
No required execution environment has been setfor every plug-in. The plug-ins declare that they require Java 21 with aRequire-Capabilityheader, which the Eclipse plug-in tooling does not recognize as an execution environment; the Maven build uses it.The warnings
Unknown referenced naturefor the Sirius, VIATRA Query and Xtext natures, if you did not install that tooling in step 1.
Changed in version 2026.3: The repository no longer contains the Eclipse metadata of the standalone projects and the org.eclipse.m2e.core.prefs files, so git deletes them when you update an existing clone.
If your workspace already contains the SPARTA projects, select all of them afterward and click (Alt+F5), so that m2e creates these files again.
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, 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 , 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)
- 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.
When you change the Eclipse release, the Orbit release or the VIATRA version in target-platform.target or in the root pom.xml, change it in the other file as well.
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.
License headers
Every Java source file must carry the EPL-2.0 license header of EPL-header.txt (owner “DistriNet, KU Leuven”, years 2018-2026).
Every Maven build from the root directory checks the headers of the Java files under src in the be.kuleuven.cs.distrinet packages in its validate phase, and fails if a header is missing or different.
The license-maven-plugin also adds or updates the 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.
Contributing
CONTRIBUTING.md in the repository describes how to contribute to SPARTA, and SECURITY.md how to report security vulnerabilities privately.
Report bugs and feature requests in the GitHub issue tracker, https://github.com/SPARTA-Threat-Modeling/SPARTA/issues.
Important
Do not report security vulnerabilities in the public GitHub issue tracker: report them privately as described in SECURITY.md.
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
The command does not change the minimum versions (bundle-version) with which the SPARTA plug-ins require each other in their MANIFEST.MF files; README.maintainers.md describes how to update them.
Afterward, check the places that contain version numbers outside the Maven and OSGi metadata: in 2026.3, 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.3.0 or v2026.3.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.
Javadoc
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.3, you can only generate the Javadoc of the command-line tools sparta-cli and sparta-ci from the sources (see Known limitations in 2026.3).
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.3.0/apidocs folder.
Known limitations in 2026.3
There are no builds for ARM (
aarch64) platforms.The build fails when the path of your clone contains a space: the tests of
sparta-clithen fail with acom.google.inject.ProvisionExceptioncaused by aNoSuchFileExceptionfor the jar ofsparta.queries, the same problem as for the standalone libraries (see Standalone Prerequisites). Clone the repository into a folder without spaces.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 Javadoc.