Align version numbers for all OpenRewrite maintained recipe modules. Intended to help with developing Recipe modules which take dependencies or otherwise build upon rewrite-maintained Recipe modules.
The BOM manages the modules from the repositories below, where each arrow points from a repository to the ones that depend on it. The published page also lists the order to build them in from source.
Releases after 3.38.0 are published to the Code Genome Project rather than Maven Central, and that repository requires authentication. To get access, sign in to the Code Genome Project and create a download token; your build then authenticates with the email or username you signed in with, plus that token as the password. What you can download depends on your account: the Apache-licensed modules are available to any authenticated user, while source-available modules require a Moderne subscription.
Keep Maven Central in your build alongside the Code Genome Project, which hosts only OpenRewrite and Moderne artifacts, so the third-party libraries these modules depend on still resolve from Maven Central. See the quickstart guide for more details.
Maven provides the Bill of Materials pattern for aligning dependency versions.
<project>
<repositories>
<repository>
<id>codegenome</id>
<url>https://artifacts.codegenomeproject.org/maven</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-logging-frameworks</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-testing-frameworks</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-recipe-bom</artifactId>
<version><!-- desired version here --></version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>Add your credentials to your Maven settings.xml (typically at ~/.m2/settings.xml):
<settings>
<servers>
<server>
<id>codegenome</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>Gradle provides the platform function for aligning dependency versions.
repositories {
mavenCentral()
maven {
url = "https://artifacts.codegenomeproject.org/maven"
credentials {
username = providers.gradleProperty("codegenomeUsername").get()
password = providers.gradleProperty("codegenomePassword").get()
}
}
}
dependencies {
implementation(platform("org.openrewrite.recipe:rewrite-recipe-bom:<version>"))
// No need to specify version numbers
implementation("org.openrewrite.recipe:rewrite-logging-frameworks")
implementation("org.openrewrite.recipe:rewrite-testing-frameworks")
}Add your credentials to ~/.gradle/gradle.properties rather than the copy in your repository, so they are never committed:
codegenomeUsername=you@example.com
codegenomePassword=your-download-tokenIn CI, set the ORG_GRADLE_PROJECT_codegenomeUsername and ORG_GRADLE_PROJECT_codegenomePassword environment variables instead.