Skip to main content

Importing external recipes

External recipes can be imported into Moderne for use by your organization.

It is the responsibility of the administrator configuring this to ensure that the recipe JARs and versions are up-to-date. It is also their responsibility to select/curate the recipe JARs that should be uploaded.

Prerequisites

  • You will need an Administrator-level account in your Moderne tenant to upload new recipe artifacts.

Importing recipes from the Moderne Platform

Step 1: Load the recipes

From your Moderne tenant, click on Deploy in the left-hand menu:

Moderne left sidebar menu with Deploy option highlighted

Step 2: Upload the recipe artifacts

  1. Click Add to open the form to import a recipe:

Deploy artifacts page with Add button highlighted

  1. Provide the Group ID, Artifact ID, and Version for the published artifact. You can also configure what organization to deploy it to and what ecosystem your artifacts live in.

Deploy new recipe artifact form with Group ID, Artifact ID, and Version fields

  1. Click deploy recipe artifact to deploy it.

The artifact information will appear in the table if Moderne successfully locates the requested artifact.

Note: If you have an on-premise Connector connected to an Artifactory instance that has been configured to serve recipes, we will look up recipes in your Artifactory repositories in addition to Nexus and Maven Central.

Step 3: View recipes in the catalog

Your custom recipes will appear in the Marketplace, and they will be discoverable through search once they have been successfully deployed.

Importing recipes via a GraphQL API call

You can also use the GraphQL API to automate importing external recipes:

mutation loadRecipe($loadGroupId: String!, $loadArtifactId: String!, $loadVersion: String!, $loadDatedSnapshotVersion: String) {
loadRecipesAsync(
groupId: $loadGroupId
artifactId: $loadArtifactId
version: $loadVersion
datedSnapshotVersion: $loadDatedSnapshotVersion
) {
id
}
}

Query variables:

{
"loadGroupId": "io.moderne.recipe",
"loadArtifactId": "rewrite-devcenter",
"loadVersion": "LATEST"
}

Importing recipes via the CLI

You can also import recipes via CLI calls.

First, you have to install the recipe artifacts into your local CLI recipe marketplace (below is an example of installing rewrite-spring from a pre-configured list of artifact repositories):

mod config recipes jar install org.openrewrite.recipe:rewrite-spring:LATEST

Next, you can upload all of these recipe artifacts from your local CLI marketplace to the Moderne Platform by running the following command:

mod config recipes moderne push