Apache Maven best practices
Recipe ID
io.moderne.devcenter.ApacheMavenBestPracticesArtifact
io.moderne.recipe:rewrite-devcenterA collection of recipes that apply best practices to Maven POMs. Some of these recipes affect build stability, so they are reported as security issues in the DevCenter card.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe io.moderne.devcenter.ApacheMavenBestPracticesIf the recipe isn’t available locally, install it with:
mod config recipes jar install io.moderne.recipe:rewrite-devcenter:1.30.0Definition
This recipe runs the following recipes in order.
- Add explicit
groupIdto Maven pluginsorg.openrewrite.maven.cleanup.ExplicitPluginGroupId - Add explicit plugin versions
org.openrewrite.maven.cleanup.ExplicitPluginVersion - Drop prefixless expressions in POM
org.openrewrite.maven.cleanup.PrefixlessExpressions - Order POM elements
org.openrewrite.maven.OrderPomElements - Remove duplicate Maven dependencies
org.openrewrite.maven.RemoveDuplicateDependencies - Remove redundant explicit dependency and plugin versions
org.openrewrite.maven.RemoveRedundantDependencyVersions - Remove redundant properties
org.openrewrite.maven.RemoveRedundantProperties - Migrate to
maven-dependency-plugingoalresolve-sourcesorg.openrewrite.maven.plugin.DependencyPluginGoalResolveSources - Update SCM with Git origin
org.openrewrite.maven.UpdateScmFromGitOrigin - Report as security issues
io.moderne.devcenter.ReportAsSecurityIssues
Data tables
Structured output this recipe can produce.
- Security issuesSecurity issues in the repository.
io.moderne.devcenter.table.SecurityIssues - Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats