SPARTA Standalone libraries
The standalone libraries let you use the SPARTA meta-model, the threat elicitation and risk analysis engine, the aggregate analyses and the exporters in your own Java programs, outside Eclipse and without OSGi.
They are regular Maven artifacts that you add to your project as dependencies.
Two runnable command-line tools, sparta-cli and sparta-ci, are built on top of them (see Command-line tools).
Overview of the standalone artifacts
All artifacts share the groupId be.kuleuven.cs.distrinet.sparta and, for this release, the version 2026.2.0.
The four library artifacts (sparta-model, sparta-core, sparta-analysis and sparta-io) contain no code of their own.
They only declare dependencies, so that Maven fetches everything a library needs:
the jar of the corresponding SPARTA Eclipse plug-in, published as a plain Maven artifact under the plug-in’s name (for example
be.kuleuven.cs.distrinet.sparta.core);the other SPARTA plug-in jars and library artifacts that this plug-in depends on;
the third-party libraries it needs, such as EMF, VIATRA and Apache POI.
For example, adding sparta-core to your project also brings in the plug-in jars sparta.core, sparta.queries and sparta.spartamodel, together with EMF and VIATRA.
The classes you use are therefore exactly those of the Eclipse plug-ins, with the same packages; they are described in SPARTA Java API.
sparta-cli and sparta-ci do contain their own code.
Besides a regular library jar, each of them produces a runnable jar with all dependencies included (classifier shaded).
The artifacts are listed below.
Note
All plug-in and package names below are abbreviated, as in SPARTA in Eclipse: they all start with be.kuleuven.cs.distrinet..
For example, sparta.core stands for be.kuleuven.cs.distrinet.sparta.core.
sparta-model(library)The SPARTA meta-model (EMF): create, load and save
.spartamodels and catalogs.Plug-in:
sparta.spartamodel; classes described in Meta-model.sparta-core(library)The threat elicitation and risk analysis engine (
Engine) and the threat classes (Threat,PatternThreat).Plug-ins:
sparta.coreandsparta.queries; classes described in Threat elicitation and risk analysis.sparta-analysis(library)Aggregate analyses over collections of threats (
ThreatAggregationAnalysis).Plug-in:
sparta.threatanalysis; classes described in Aggregated risk analyses.sparta-io(library)Exporters for collections of threats: CSV, text, XLSX, JSON, code-quality JSON and a LaTeX report.
Plug-in:
sparta.io; classes described in Exporters.sparta-cli(library and runnableshadedjar)Command-line tool that analyzes a model and exports the results (see Command-line tools).
Packages:
sparta.cli,sparta.cli.cmd,sparta.cli.cmd.exportsparta-ci(library and runnableshadedjar)Variant of
sparta-clifor continuous integration pipelines (see Command-line tools).Packages:
sparta.cli.cistandalone(POM)The parent POM of the artifacts above. It sets the versions of the third-party libraries (see Third-party dependency versions), and you import it as a BOM in your own project (see Standalone Prerequisites).
The exported packages of the plug-ins are listed in SPARTA in Eclipse.
Changed in version 2026.2: The unused project standalone-dependencies was removed from SPARTA; depend on sparta-model (or on a library that includes it) instead.
Dependencies between the artifacts
The graph shows the direct Maven dependencies between the standalone artifacts.
Depending on an artifact brings in everything it depends on, so a project that uses sparta-io also gets sparta-analysis, sparta-core and sparta-model.
flowchart LR
model["sparta-model"]
core["sparta-core"]
analysis["sparta-analysis"]
io["sparta-io"]
cli["sparta-cli"]
ci["sparta-ci"]
core --> model
analysis --> core
analysis --> model
io --> analysis
io --> core
io --> model
cli --> io
cli --> analysis
cli --> core
cli --> model
ci --> cli
Using the libraries in a Maven project
The 2026.2.0 artifacts are available from the SPARTA Maven repository https://maven.sparta.distrinet-research.be.
Configure the repositories and import the standalone BOM as described in Standalone Prerequisites, and add a dependency on the library that covers what you need: sparta-model to create, load and save models only, sparta-core to run threat elicitation and risk analysis, and sparta-io for everything including the exporters.
For example, a dependency on sparta-io:
<dependency>
<groupId>be.kuleuven.cs.distrinet.sparta</groupId>
<artifactId>sparta-io</artifactId>
<version>2026.2.0</version>
</dependency>
Some points to keep in mind:
The libraries are compiled for Java 21, so a consumer project needs Java 21 or later.
Import the
standaloneBOM; without it, the first analysis fails with aSecurityException(see Standalone Prerequisites).The analysis fails when the path of the SPARTA jars contains a space, for example a local Maven repository in
C:\Users\Jane Doe\.m2(see Standalone Prerequisites).VIATRA is not available from Maven Central. It comes from the Eclipse repository
https://repo.eclipse.org/content/groups/releases/, which the SPARTA parent POM declares. If you use a Maven mirror for all repositories (<mirrorOf>*</mirrorOf>), make sure it also proxies that repository.Before loading or creating models, initialize EMF as shown in Setting up a standalone program.
The runnable jar
sparta-cli-2026.2.0-shaded.jar(see Command-line tools) contains all libraries and their dependencies, so it also works as a single-jar classpath (java -cp) for your own programs.
Concrete code for the common tasks is in Development scenarios, and a complete example project is in Example project.
Third-party dependency versions
The standalone POM sets the versions of the third-party libraries in its dependencyManagement.
When you import it as a BOM, your project uses the same versions as the SPARTA build, among others:
Library |
Version |
|---|---|
EMF ( |
2.40.0 |
|
3.20.300 |
Apache POI ( |
5.4.1 |
Jackson ( |
2.17.1 |
|
2.2 |
|
2.16.1 |
|
1.8.0 |
|
6.10.0.202406032230-r |
VIATRA 2.9.1 is not managed by the BOM; sparta-core depends on it directly.
Changed in version 2026.2: The third-party versions are set in the standalone POM, and several were upgraded.
The XLSX export of sparta-io works with these versions; the workaround of 2026.1, adding poi-ooxml and commons-io to your project, is no longer needed.
Code that uses SnakeYAML together with the libraries must use the SnakeYAML 2 API.
Using sparta-cli as a library
The classes of sparta-cli can also be used as a library.
For example, SpartaCliProcessor.setupEMFStandalone(), setupVIATRAStandalone(), loadModel(String), runThreatAnalysis(String) and runThreatAnalysis(ResourceSet) are public static helpers.
loadModel and runThreatAnalysis(String) take a path that is relative to the working directory or absolute.
Changed in version 2026.2: Exporter.process returns a boolean (false when the export fails), so your own exporters must be adapted.
runThreatAnalysis(ResourceSet) was added.