Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.UnitTestBot:juliet-java-test-suite:v1.3.2'
}
dependencies {
implementation("com.github.UnitTestBot:juliet-java-test-suite:v1.3.2")
}
<dependency>
<groupId>com.github.UnitTestBot</groupId>
<artifactId>juliet-java-test-suite</artifactId>
<version>v1.3.2</version>
</dependency>
libraryDependencies += "com.github.UnitTestBot" % "juliet-java-test-suite" % "v1.3.2"
:dependencies [[com.github.UnitTestBot/juliet-java-test-suite "v1.3.2"]]
A collection of test cases in the Java language. It contains examples organized under 112 different CWEs.
The Juliet Java 1.3 test suite is taken from the NIST website
To build the Juliet Java Test Suite, simply execute the following command:
./gradlew build
Once built, you can locate the compiled JARs within juliet-*/build/libs/*.jar
directories.
Each CWE is available as a separate artifact on JitPack:
repositories {
maven(url = "https://jitpack.io/")
}
dependencies {
// CWE476: NULL Pointer Dereference
implementation("com.github.UnitTestBot.juliet-java-test-suite:cwe476:$version")
// Include the `support` module, if needed:
implementation("com.github.UnitTestBot.juliet-java-test-suite:support:$version")
}
You also have the option to include the entire repository as a dependency
by adding com.github.UnitTestBot:juliet-java-test-suite:$version
to your project.
However, please be aware that the complete artifact, which includes all CWEs,
is quite substantial in size, exceeding 60MB.