Skip to main content

Add JUnit Platform Launcher

org.openrewrite.gradle.AddJUnitPlatformLauncher

Add the JUnit Platform Launcher to the buildscript dependencies.

Recipe source

GitHub, Issue Tracker, Maven Central

This recipe is available under the Apache License Version 2.0.

Definition

  • Add Gradle dependency
    • groupId: org.junit.platform
    • artifactId: junit-platform-launcher
    • version: 1.x
    • configuration: testRuntimeOnly
    • onlyIfUsing: org.junit.jupiter.api.Test
    • acceptTransitive: true

Examples

Example 1
Unchanged
build.gradle
plugins {
id "java-library"
}

repositories {
mavenCentral()
}
Unchanged
import org.junit.jupiter.api.Test;
public class A {
@Test
void foo() {
}
}
Unchanged
project

Example 2
Unchanged
build.gradle
plugins {
id "java-library"
}

repositories {
mavenCentral()
}
Unchanged
import org.junit.jupiter.api.Test;
public class A {
@Test
void foo() {
}
}
Unchanged
project

Usage

This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("7.6.1")
}

rewrite {
activeRecipe("org.openrewrite.gradle.AddJUnitPlatformLauncher")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Maven metadata failures

org.openrewrite.maven.table.MavenMetadataFailures

Attempts to resolve maven metadata that failed.

Column NameDescription
Group idThe groupId of the artifact for which the metadata download failed.
Artifact idThe artifactId of the artifact for which the metadata download failed.
VersionThe version of the artifact for which the metadata download failed.
Maven repositoryThe URL of the Maven repository that the metadata download failed on.
SnapshotsDoes the repository support snapshots.
ReleasesDoes the repository support releases.
FailureThe reason the metadata download failed.